commit 7d308772cf08bd97081ecc8996d6033c018dc99b Author: dimentox Date: Thu Apr 29 03:23:31 2010 +0000 Initial import git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@1 3f4676ac-adda-40fd-8265-58d1435b1672 diff --git a/About.Designer.cs b/About.Designer.cs new file mode 100644 index 0000000..65f1179 --- /dev/null +++ b/About.Designer.cs @@ -0,0 +1,145 @@ +namespace LSLEditor +{ + partial class About + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.button1 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Image = global::LSLEditor.Properties.Resources.logo; + this.pictureBox1.Location = new System.Drawing.Point(16, 16); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(184, 80); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.webBrowser1); + this.groupBox1.Controls.Add(this.linkLabel1); + this.groupBox1.Controls.Add(this.pictureBox1); + this.groupBox1.Location = new System.Drawing.Point(16, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(320, 360); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "LSL-Editor"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(72, 112); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(16, 13); + this.label2.TabIndex = 4; + this.label2.Text = "..."; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 112); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(45, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Version:"; + // + // webBrowser1 + // + this.webBrowser1.Location = new System.Drawing.Point(8, 128); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.Size = new System.Drawing.Size(304, 224); + this.webBrowser1.TabIndex = 2; + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(16, 96); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(220, 13); + this.linkLabel1.TabIndex = 1; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "(C) 2006,2007,2008 Alphons van der Heijden"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(240, 376); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Ok"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // About + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(352, 410); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "About"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "About"; + this.Load += new System.EventHandler(this.About_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/About.cs b/About.cs new file mode 100644 index 0000000..c10a50e --- /dev/null +++ b/About.cs @@ -0,0 +1,80 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Reflection; +using System.ComponentModel; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class About : Form + { + public About(LSLEditorForm parent) + { + InitializeComponent(); + + this.Icon = parent.Icon; + + string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + this.label2.Text = strVersion; + } + + private void button1_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start(Properties.Settings.Default.ContactUrl); + } + + private void About_Load(object sender, EventArgs e) + { + string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase); + this.webBrowser1.Navigate("res://" + strExeFileName + "/"+ Properties.Settings.Default.About); + } + } +} \ No newline at end of file diff --git a/About.resx b/About.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/About.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/BZip2Decompress/BZip2.cs b/BZip2Decompress/BZip2.cs new file mode 100644 index 0000000..3c736af --- /dev/null +++ b/BZip2Decompress/BZip2.cs @@ -0,0 +1,24 @@ +using System; +using System.IO; + +// BZip2.Decompress(File.OpenRead("in"), File.Create("out")); + + +namespace LSLEditor.BZip2Decompress +{ + public sealed class Decompressor + { + public static void Decompress(Stream inStream, Stream outStream) + { + using ( outStream ) { + using ( BZip2InputStream bzis = new BZip2InputStream(inStream) ) { + int ch = bzis.ReadByte(); + while (ch != -1) { + outStream.WriteByte((byte)ch); + ch = bzis.ReadByte(); + } + } + } + } + } +} diff --git a/BZip2Decompress/BZip2Constants.cs b/BZip2Decompress/BZip2Constants.cs new file mode 100644 index 0000000..e86e8de --- /dev/null +++ b/BZip2Decompress/BZip2Constants.cs @@ -0,0 +1,122 @@ +namespace LSLEditor.BZip2Decompress +{ + + /// + /// Defines internal values for both compression and decompression + /// + public sealed class BZip2Constants + { + /// + /// Random numbers used to randomise repetitive blocks + /// + public readonly static int[] rNums = { + 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, + 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, + 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, + 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, + 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, + 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, + 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, + 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, + 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, + 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, + 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, + 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, + 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, + 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, + 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, + 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, + 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, + 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, + 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, + 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, + 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, + 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, + 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, + 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, + 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, + 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, + 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, + 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, + 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, + 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, + 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, + 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, + 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, + 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, + 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, + 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, + 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, + 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, + 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, + 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, + 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, + 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, + 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, + 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, + 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, + 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, + 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, + 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, + 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, + 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, + 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, + 936, 638 + }; + + /// + /// When multiplied by compression parameter (1-9) gives the block size for compression + /// 9 gives the best compresssion but uses the most memory. + /// + public const int baseBlockSize = 100000; + + /// + /// Backend constant + /// + public const int MAX_ALPHA_SIZE = 258; + + /// + /// Backend constant + /// + public const int MAX_CODE_LEN = 23; + + /// + /// Backend constant + /// + public const int RUNA = 0; + + /// + /// Backend constant + /// + public const int RUNB = 1; + + /// + /// Backend constant + /// + public const int N_GROUPS = 6; + + /// + /// Backend constant + /// + public const int G_SIZE = 50; + + /// + /// Backend constant + /// + public const int N_ITERS = 4; + + /// + /// Backend constant + /// + public const int MAX_SELECTORS = (2 + (900000 / G_SIZE)); + + /// + /// Backend constant + /// + public const int NUM_OVERSHOOT_BYTES = 20; + + private BZip2Constants() + { + } + } +} diff --git a/BZip2Decompress/BZip2InputStream.cs b/BZip2Decompress/BZip2InputStream.cs new file mode 100644 index 0000000..fadd35d --- /dev/null +++ b/BZip2Decompress/BZip2InputStream.cs @@ -0,0 +1,924 @@ +using System; +using System.IO; + +namespace LSLEditor.BZip2Decompress +{ + + /// + /// An input stream that decompresses files in the BZip2 format + /// + public class BZip2InputStream : Stream + { + #region Constants + const int START_BLOCK_STATE = 1; + const int RAND_PART_A_STATE = 2; + const int RAND_PART_B_STATE = 3; + const int RAND_PART_C_STATE = 4; + const int NO_RAND_PART_A_STATE = 5; + const int NO_RAND_PART_B_STATE = 6; + const int NO_RAND_PART_C_STATE = 7; + #endregion + #region Constructors + /// + /// Construct instance for reading from stream + /// + /// Data source + public BZip2InputStream(Stream stream) + { + // init arrays + for (int i = 0; i < BZip2Constants.N_GROUPS; ++i) + { + limit[i] = new int[BZip2Constants.MAX_ALPHA_SIZE]; + baseArray[i] = new int[BZip2Constants.MAX_ALPHA_SIZE]; + perm[i] = new int[BZip2Constants.MAX_ALPHA_SIZE]; + } + + BsSetStream(stream); + Initialize(); + InitBlock(); + SetupBlock(); + } + + #endregion + + /// + /// Get/set flag indicating ownership of underlying stream. + /// When the flag is true will close the underlying stream also. + /// + public bool IsStreamOwner + { + get { return isStreamOwner; } + set { isStreamOwner = value; } + } + + + #region Stream Overrides + /// + /// Gets a value indicating if the stream supports reading + /// + public override bool CanRead + { + get { + return baseStream.CanRead; + } + } + + /// + /// Gets a value indicating whether the current stream supports seeking. + /// + public override bool CanSeek { + get { + return baseStream.CanSeek; + } + } + + /// + /// Gets a value indicating whether the current stream supports writing. + /// This property always returns false + /// + public override bool CanWrite { + get { + return false; + } + } + + /// + /// Gets the length in bytes of the stream. + /// + public override long Length { + get { + return baseStream.Length; + } + } + + /// + /// Gets or sets the streams position. + /// Setting the position is not supported and will throw a NotSupportException + /// + /// Any attempt to set the position + public override long Position { + get { + return baseStream.Position; + } + set { + throw new NotSupportedException("BZip2InputStream position cannot be set"); + } + } + + /// + /// Flushes the stream. + /// + public override void Flush() + { + if (baseStream != null) { + baseStream.Flush(); + } + } + + /// + /// Set the streams position. This operation is not supported and will throw a NotSupportedException + /// + /// Any access + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("BZip2InputStream Seek not supported"); + } + + /// + /// Sets the length of this stream to the given value. + /// This operation is not supported and will throw a NotSupportedExceptionortedException + /// + /// Any access + public override void SetLength(long value) + { + throw new NotSupportedException("BZip2InputStream SetLength not supported"); + } + + /// + /// Writes a block of bytes to this stream using data from a buffer. + /// This operation is not supported and will throw a NotSupportedException + /// + /// Any access + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("BZip2InputStream Write not supported"); + } + + /// + /// Writes a byte to the current position in the file stream. + /// This operation is not supported and will throw a NotSupportedException + /// + /// The value to write. + /// Any access + public override void WriteByte(byte value) + { + throw new NotSupportedException("BZip2InputStream WriteByte not supported"); + } + + /// + /// Read a sequence of bytes and advances the read position by one byte. + /// + /// Array of bytes to store values in + /// Offset in array to begin storing data + /// The maximum number of bytes to read + /// The total number of bytes read into the buffer. This might be less + /// than the number of bytes requested if that number of bytes are not + /// currently available or zero if the end of the stream is reached. + /// + public override int Read(byte[] buffer, int offset, int count) + { + if ( buffer == null ) + { + throw new ArgumentNullException("buffer"); + } + + for (int i = 0; i < count; ++i) { + int rb = ReadByte(); + if (rb == -1) { + return i; + } + buffer[offset + i] = (byte)rb; + } + return count; + } + + /// + /// Closes the stream, releasing any associated resources. + /// + public override void Close() + { + if ( IsStreamOwner && (baseStream != null) ) { + baseStream.Close(); + } + } + /// + /// Read a byte from stream advancing position + /// + /// byte read or -1 on end of stream + public override int ReadByte() + { + if (streamEnd) + { + return -1; // ok + } + + int retChar = currentChar; + switch (currentState) + { + case RAND_PART_B_STATE: + SetupRandPartB(); + break; + case RAND_PART_C_STATE: + SetupRandPartC(); + break; + case NO_RAND_PART_B_STATE: + SetupNoRandPartB(); + break; + case NO_RAND_PART_C_STATE: + SetupNoRandPartC(); + break; + case START_BLOCK_STATE: + case NO_RAND_PART_A_STATE: + case RAND_PART_A_STATE: + break; + default: + break; + } + return retChar; + } + + #endregion + + void MakeMaps() + { + nInUse = 0; + for (int i = 0; i < 256; ++i) { + if (inUse[i]) { + seqToUnseq[nInUse] = (byte)i; + unseqToSeq[i] = (byte)nInUse; + nInUse++; + } + } + } + + void Initialize() + { + char magic1 = BsGetUChar(); + char magic2 = BsGetUChar(); + + char magic3 = BsGetUChar(); + char magic4 = BsGetUChar(); + + if (magic1 != 'B' || magic2 != 'Z' || magic3 != 'h' || magic4 < '1' || magic4 > '9') { + streamEnd = true; + return; + } + + SetDecompressStructureSizes(magic4 - '0'); + computedCombinedCRC = 0; + } + + void InitBlock() + { + char magic1 = BsGetUChar(); + char magic2 = BsGetUChar(); + char magic3 = BsGetUChar(); + char magic4 = BsGetUChar(); + char magic5 = BsGetUChar(); + char magic6 = BsGetUChar(); + + if (magic1 == 0x17 && magic2 == 0x72 && magic3 == 0x45 && magic4 == 0x38 && magic5 == 0x50 && magic6 == 0x90) { + Complete(); + return; + } + + if (magic1 != 0x31 || magic2 != 0x41 || magic3 != 0x59 || magic4 != 0x26 || magic5 != 0x53 || magic6 != 0x59) { + BadBlockHeader(); + streamEnd = true; + return; + } + + storedBlockCRC = BsGetInt32(); + + blockRandomised = (BsR(1) == 1); + + GetAndMoveToFrontDecode(); + + mCrc.Reset(); + currentState = START_BLOCK_STATE; + } + + void EndBlock() + { + computedBlockCRC = (int)mCrc.Value; + + // -- A bad CRC is considered a fatal error. -- + if (storedBlockCRC != computedBlockCRC) { + CrcError(); + } + + // 1528150659 + computedCombinedCRC = ((computedCombinedCRC << 1) & 0xFFFFFFFF) | (computedCombinedCRC >> 31); + computedCombinedCRC = computedCombinedCRC ^ (uint)computedBlockCRC; + } + + void Complete() + { + storedCombinedCRC = BsGetInt32(); + if (storedCombinedCRC != (int)computedCombinedCRC) { + CrcError(); + } + + streamEnd = true; + } + + void BsSetStream(Stream stream) + { + baseStream = stream; + bsLive = 0; + bsBuff = 0; + } + + void FillBuffer() + { + int thech = 0; + + try { + thech = baseStream.ReadByte(); + } catch (Exception) { + CompressedStreamEOF(); + } + + if (thech == -1) { + CompressedStreamEOF(); + } + + bsBuff = (bsBuff << 8) | (thech & 0xFF); + bsLive += 8; + } + + int BsR(int n) + { + while (bsLive < n) { + FillBuffer(); + } + + int v = (bsBuff >> (bsLive - n)) & ((1 << n) - 1); + bsLive -= n; + return v; + } + + char BsGetUChar() + { + return (char)BsR(8); + } + + int BsGetint() + { + int u = BsR(8); + u = (u << 8) | BsR(8); + u = (u << 8) | BsR(8); + u = (u << 8) | BsR(8); + return u; + } + + int BsGetIntVS(int numBits) + { + return BsR(numBits); + } + + int BsGetInt32() + { + return BsGetint(); + } + + void RecvDecodingTables() + { + char[][] len = new char[BZip2Constants.N_GROUPS][]; + for (int i = 0; i < BZip2Constants.N_GROUPS; ++i) { + len[i] = new char[BZip2Constants.MAX_ALPHA_SIZE]; + } + + bool[] inUse16 = new bool[16]; + + //--- Receive the mapping table --- + for (int i = 0; i < 16; i++) { + inUse16[i] = (BsR(1) == 1); + } + + for (int i = 0; i < 16; i++) { + if (inUse16[i]) { + for (int j = 0; j < 16; j++) { + inUse[i * 16 + j] = (BsR(1) == 1); + } + } else { + for (int j = 0; j < 16; j++) { + inUse[i * 16 + j] = false; + } + } + } + + MakeMaps(); + int alphaSize = nInUse + 2; + + //--- Now the selectors --- + int nGroups = BsR(3); + int nSelectors = BsR(15); + + for (int i = 0; i < nSelectors; i++) { + int j = 0; + while (BsR(1) == 1) { + j++; + } + selectorMtf[i] = (byte)j; + } + + //--- Undo the MTF values for the selectors. --- + byte[] pos = new byte[BZip2Constants.N_GROUPS]; + for (int v = 0; v < nGroups; v++) { + pos[v] = (byte)v; + } + + for (int i = 0; i < nSelectors; i++) { + int v = selectorMtf[i]; + byte tmp = pos[v]; + while (v > 0) { + pos[v] = pos[v - 1]; + v--; + } + pos[0] = tmp; + selector[i] = tmp; + } + + //--- Now the coding tables --- + for (int t = 0; t < nGroups; t++) { + int curr = BsR(5); + for (int i = 0; i < alphaSize; i++) { + while (BsR(1) == 1) { + if (BsR(1) == 0) { + curr++; + } else { + curr--; + } + } + len[t][i] = (char)curr; + } + } + + //--- Create the Huffman decoding tables --- + for (int t = 0; t < nGroups; t++) { + int minLen = 32; + int maxLen = 0; + for (int i = 0; i < alphaSize; i++) { + maxLen = Math.Max(maxLen, len[t][i]); + minLen = Math.Min(minLen, len[t][i]); + } + HbCreateDecodeTables(limit[t], baseArray[t], perm[t], len[t], minLen, maxLen, alphaSize); + minLens[t] = minLen; + } + } + + void GetAndMoveToFrontDecode() + { + byte[] yy = new byte[256]; + int nextSym; + + int limitLast = BZip2Constants.baseBlockSize * blockSize100k; + origPtr = BsGetIntVS(24); + + RecvDecodingTables(); + int EOB = nInUse+1; + int groupNo = -1; + int groupPos = 0; + + /*-- + Setting up the unzftab entries here is not strictly + necessary, but it does save having to do it later + in a separate pass, and so saves a block's worth of + cache misses. + --*/ + for (int i = 0; i <= 255; i++) { + unzftab[i] = 0; + } + + for (int i = 0; i <= 255; i++) { + yy[i] = (byte)i; + } + + last = -1; + + if (groupPos == 0) { + groupNo++; + groupPos = BZip2Constants.G_SIZE; + } + + groupPos--; + int zt = selector[groupNo]; + int zn = minLens[zt]; + int zvec = BsR(zn); + int zj; + + while (zvec > limit[zt][zn]) { + if (zn > 20) { // the longest code + throw new Exception("Bzip data error"); + } + zn++; + while (bsLive < 1) { + FillBuffer(); + } + zj = (bsBuff >> (bsLive-1)) & 1; + bsLive--; + zvec = (zvec << 1) | zj; + } + if (zvec - baseArray[zt][zn] < 0 || zvec - baseArray[zt][zn] >= BZip2Constants.MAX_ALPHA_SIZE) { + throw new Exception("Bzip data error"); + } + nextSym = perm[zt][zvec - baseArray[zt][zn]]; + + while (true) { + if (nextSym == EOB) { + break; + } + + if (nextSym == BZip2Constants.RUNA || nextSym == BZip2Constants.RUNB) { + int s = -1; + int n = 1; + do { + if (nextSym == BZip2Constants.RUNA) { + s += (0 + 1) * n; + } else if (nextSym == BZip2Constants.RUNB) { + s += (1 + 1) * n; + } + + n <<= 1; + + if (groupPos == 0) { + groupNo++; + groupPos = BZip2Constants.G_SIZE; + } + + groupPos--; + + zt = selector[groupNo]; + zn = minLens[zt]; + zvec = BsR(zn); + + while (zvec > limit[zt][zn]) { + zn++; + while (bsLive < 1) { + FillBuffer(); + } + zj = (bsBuff >> (bsLive - 1)) & 1; + bsLive--; + zvec = (zvec << 1) | zj; + } + nextSym = perm[zt][zvec - baseArray[zt][zn]]; + } while (nextSym == BZip2Constants.RUNA || nextSym == BZip2Constants.RUNB); + + s++; + byte ch = seqToUnseq[yy[0]]; + unzftab[ch] += s; + + while (s > 0) { + last++; + ll8[last] = ch; + s--; + } + + if (last >= limitLast) { + BlockOverrun(); + } + continue; + } else { + last++; + if (last >= limitLast) { + BlockOverrun(); + } + + byte tmp = yy[nextSym - 1]; + unzftab[seqToUnseq[tmp]]++; + ll8[last] = seqToUnseq[tmp]; + + for (int j = nextSym-1; j > 0; --j) { + yy[j] = yy[j - 1]; + } + yy[0] = tmp; + + if (groupPos == 0) { + groupNo++; + groupPos = BZip2Constants.G_SIZE; + } + + groupPos--; + zt = selector[groupNo]; + zn = minLens[zt]; + zvec = BsR(zn); + while (zvec > limit[zt][zn]) { + zn++; + while (bsLive < 1) { + FillBuffer(); + } + zj = (bsBuff >> (bsLive-1)) & 1; + bsLive--; + zvec = (zvec << 1) | zj; + } + nextSym = perm[zt][zvec - baseArray[zt][zn]]; + continue; + } + } + } + + void SetupBlock() + { + int[] cftab = new int[257]; + + cftab[0] = 0; + Array.Copy(unzftab, 0, cftab, 1, 256); + + for (int i = 1; i <= 256; i++) { + cftab[i] += cftab[i - 1]; + } + + for (int i = 0; i <= last; i++) { + byte ch = ll8[i]; + tt[cftab[ch]] = i; + cftab[ch]++; + } + + cftab = null; + + tPos = tt[origPtr]; + + count = 0; + i2 = 0; + ch2 = 256; /*-- not a char and not EOF --*/ + + if (blockRandomised) { + rNToGo = 0; + rTPos = 0; + SetupRandPartA(); + } else { + SetupNoRandPartA(); + } + } + + void SetupRandPartA() + { + if (i2 <= last) { + chPrev = ch2; + ch2 = ll8[tPos]; + tPos = tt[tPos]; + if (rNToGo == 0) { + rNToGo = BZip2Constants.rNums[rTPos]; + rTPos++; + if (rTPos == 512) { + rTPos = 0; + } + } + rNToGo--; + ch2 ^= (int)((rNToGo == 1) ? 1 : 0); + i2++; + + currentChar = ch2; + currentState = RAND_PART_B_STATE; + mCrc.Update(ch2); + } else { + EndBlock(); + InitBlock(); + SetupBlock(); + } + } + + void SetupNoRandPartA() + { + if (i2 <= last) { + chPrev = ch2; + ch2 = ll8[tPos]; + tPos = tt[tPos]; + i2++; + + currentChar = ch2; + currentState = NO_RAND_PART_B_STATE; + mCrc.Update(ch2); + } else { + EndBlock(); + InitBlock(); + SetupBlock(); + } + } + + void SetupRandPartB() + { + if (ch2 != chPrev) { + currentState = RAND_PART_A_STATE; + count = 1; + SetupRandPartA(); + } else { + count++; + if (count >= 4) { + z = ll8[tPos]; + tPos = tt[tPos]; + if (rNToGo == 0) { + rNToGo = BZip2Constants.rNums[rTPos]; + rTPos++; + if (rTPos == 512) { + rTPos = 0; + } + } + rNToGo--; + z ^= (byte)((rNToGo == 1) ? 1 : 0); + j2 = 0; + currentState = RAND_PART_C_STATE; + SetupRandPartC(); + } else { + currentState = RAND_PART_A_STATE; + SetupRandPartA(); + } + } + } + + void SetupRandPartC() + { + if (j2 < (int)z) { + currentChar = ch2; + mCrc.Update(ch2); + j2++; + } else { + currentState = RAND_PART_A_STATE; + i2++; + count = 0; + SetupRandPartA(); + } + } + + void SetupNoRandPartB() + { + if (ch2 != chPrev) { + currentState = NO_RAND_PART_A_STATE; + count = 1; + SetupNoRandPartA(); + } else { + count++; + if (count >= 4) { + z = ll8[tPos]; + tPos = tt[tPos]; + currentState = NO_RAND_PART_C_STATE; + j2 = 0; + SetupNoRandPartC(); + } else { + currentState = NO_RAND_PART_A_STATE; + SetupNoRandPartA(); + } + } + } + + void SetupNoRandPartC() + { + if (j2 < (int)z) { + currentChar = ch2; + mCrc.Update(ch2); + j2++; + } else { + currentState = NO_RAND_PART_A_STATE; + i2++; + count = 0; + SetupNoRandPartA(); + } + } + + void SetDecompressStructureSizes(int newSize100k) + { + if (!(0 <= newSize100k && newSize100k <= 9 && 0 <= blockSize100k && blockSize100k <= 9)) { + throw new Exception("Invalid block size"); + } + + blockSize100k = newSize100k; + + if (newSize100k == 0) { + return; + } + + int n = BZip2Constants.baseBlockSize * newSize100k; + ll8 = new byte[n]; + tt = new int[n]; + } + + static void CompressedStreamEOF() + { + throw new Exception("BZip2 input stream end of compressed stream"); + } + + static void BlockOverrun() + { + throw new Exception("BZip2 input stream block overrun"); + } + + static void BadBlockHeader() + { + throw new Exception("BZip2 input stream bad block header"); + } + + static void CrcError() + { + throw new Exception("BZip2 input stream crc error"); + } + + static void HbCreateDecodeTables(int[] limit, int[] baseArray, int[] perm, char[] length, int minLen, int maxLen, int alphaSize) + { + int pp = 0; + + for (int i = minLen; i <= maxLen; ++i) + { + for (int j = 0; j < alphaSize; ++j) + { + if (length[j] == i) + { + perm[pp] = j; + ++pp; + } + } + } + + for (int i = 0; i < BZip2Constants.MAX_CODE_LEN; i++) + { + baseArray[i] = 0; + } + + for (int i = 0; i < alphaSize; i++) + { + ++baseArray[length[i] + 1]; + } + + for (int i = 1; i < BZip2Constants.MAX_CODE_LEN; i++) + { + baseArray[i] += baseArray[i - 1]; + } + + for (int i = 0; i < BZip2Constants.MAX_CODE_LEN; i++) + { + limit[i] = 0; + } + + int vec = 0; + + for (int i = minLen; i <= maxLen; i++) + { + vec += (baseArray[i + 1] - baseArray[i]); + limit[i] = vec - 1; + vec <<= 1; + } + + for (int i = minLen + 1; i <= maxLen; i++) + { + baseArray[i] = ((limit[i - 1] + 1) << 1) - baseArray[i]; + } + } + + #region Instance Fields + /*-- + index of the last char in the block, so + the block size == last + 1. + --*/ + int last; + + /*-- + index in zptr[] of original string after sorting. + --*/ + int origPtr; + + /*-- + always: in the range 0 .. 9. + The current block size is 100000 * this number. + --*/ + int blockSize100k; + + bool blockRandomised; + + int bsBuff; + int bsLive; + IChecksum mCrc = new StrangeCRC(); + + bool[] inUse = new bool[256]; + int nInUse; + + byte[] seqToUnseq = new byte[256]; + byte[] unseqToSeq = new byte[256]; + + byte[] selector = new byte[BZip2Constants.MAX_SELECTORS]; + byte[] selectorMtf = new byte[BZip2Constants.MAX_SELECTORS]; + + int[] tt; + byte[] ll8; + + /*-- + freq table collected to save a pass over the data + during decompression. + --*/ + int[] unzftab = new int[256]; + + int[][] limit = new int[BZip2Constants.N_GROUPS][]; + int[][] baseArray = new int[BZip2Constants.N_GROUPS][]; + int[][] perm = new int[BZip2Constants.N_GROUPS][]; + int[] minLens = new int[BZip2Constants.N_GROUPS]; + + Stream baseStream; + bool streamEnd; + + int currentChar = -1; + + int currentState = START_BLOCK_STATE; + + int storedBlockCRC, storedCombinedCRC; + int computedBlockCRC; + uint computedCombinedCRC; + + int count, chPrev, ch2; + int tPos; + int rNToGo; + int rTPos; + int i2, j2; + byte z; + bool isStreamOwner = true; + #endregion + } +} diff --git a/BZip2Decompress/IChecksum.cs b/BZip2Decompress/IChecksum.cs new file mode 100644 index 0000000..75462b8 --- /dev/null +++ b/BZip2Decompress/IChecksum.cs @@ -0,0 +1,93 @@ +// IChecksum.cs - Interface to compute a data checksum +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +// +// 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 +// of the License, 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. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +namespace LSLEditor.BZip2Decompress +{ + + /// + /// Interface to compute a data checksum used by checked input/output streams. + /// A data checksum can be updated by one byte or with a byte array. After each + /// update the value of the current checksum can be returned by calling + /// getValue. The complete checksum object can also be reset + /// so it can be used again with new data. + /// + public interface IChecksum + { + /// + /// Returns the data checksum computed so far. + /// + long Value + { + get; + } + + /// + /// Resets the data checksum as if no update was ever called. + /// + void Reset(); + + /// + /// Adds one byte to the data checksum. + /// + /// + /// the data value to add. The high byte of the int is ignored. + /// + void Update(int value); + + /// + /// Updates the data checksum with the bytes taken from the array. + /// + /// + /// buffer an array of bytes + /// + void Update(byte[] buffer); + + /// + /// Adds the byte array to the data checksum. + /// + /// + /// The buffer which contains the data + /// + /// + /// The offset in the buffer where the data starts + /// + /// + /// the number of data bytes to add. + /// + void Update(byte[] buffer, int offset, int count); + } +} diff --git a/BZip2Decompress/MD5Verify.cs b/BZip2Decompress/MD5Verify.cs new file mode 100644 index 0000000..0a6e710 --- /dev/null +++ b/BZip2Decompress/MD5Verify.cs @@ -0,0 +1,18 @@ +using System; +using System.Security.Cryptography; +using System.IO; + +namespace LSLEditor.BZip2Decompress +{ + class MD5Verify + { + public static string ComputeHash(string strFile) + { + MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider(); + FileStream stream = File.OpenRead(strFile); + byte[] hash = csp.ComputeHash(stream); + stream.Close(); + return BitConverter.ToString(hash).Replace("-", "").ToLower(); + } + } +} diff --git a/BZip2Decompress/StrangeCrc.cs b/BZip2Decompress/StrangeCrc.cs new file mode 100644 index 0000000..2a0e452 --- /dev/null +++ b/BZip2Decompress/StrangeCrc.cs @@ -0,0 +1,207 @@ +// StrangeCRC.cs - computes a crc used in the bziplib +// +// Copyright (C) 2001 Mike Krueger +// +// This file was translated from java, it was part of the GNU Classpath +// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +// +// 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 +// of the License, 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. +// +// Linking this library statically or dynamically with other modules is +// making a combined work based on this library. Thus, the terms and +// conditions of the GNU General Public License cover the whole +// combination. +// +// As a special exception, the copyright holders of this library give you +// permission to link this library with independent modules to produce an +// executable, regardless of the license terms of these independent +// modules, and to copy and distribute the resulting executable under +// terms of your choice, provided that you also meet, for each linked +// independent module, the terms and conditions of the license of that +// module. An independent module is a module which is not derived from +// or based on this library. If you modify this library, you may extend +// this exception to your version of the library, but you are not +// obligated to do so. If you do not wish to do so, delete this +// exception statement from your version. + +using System; + +namespace LSLEditor.BZip2Decompress +{ + /// + /// Bzip2 checksum algorithm + /// + public class StrangeCRC : IChecksum + { + readonly static uint[] crc32Table = { + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, + 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, + 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, + 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, + 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, + 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, + 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, + 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, + 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, + 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, + 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, + 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, + 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, + 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, + 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, + 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, + 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, + 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, + 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, + 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, + 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, + 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, + 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, + 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, + 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, + 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, + 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, + 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, + 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, + 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, + 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, + 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, + 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, + 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, + 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 + }; + + int globalCrc; + + /// + /// Initialise a default instance of + /// + public StrangeCRC() + { + Reset(); + } + + /// + /// Reset the state of Crc. + /// + public void Reset() + { + globalCrc = -1; + } + + /// + /// Get the current Crc value. + /// + public long Value { + get { + return ~globalCrc; + } + } + + /// + /// Update the Crc value. + /// + /// data update is based on + public void Update(int value) + { + int temp = (globalCrc >> 24) ^ value; + if (temp < 0) { + temp = 256 + temp; + } + globalCrc = unchecked((int)((globalCrc << 8) ^ crc32Table[temp])); + } + + /// + /// Update Crc based on a block of data + /// + public void Update(byte[] buffer) + { + if (buffer == null) { + throw new ArgumentNullException("buffer"); + } + + Update(buffer, 0, buffer.Length); + } + + /// + /// Update Crc based on a portion of a block of data + /// + /// block of data + /// index of first byte to use + /// number of bytes to use + public void Update(byte[] buffer, int offset, int count) + { + if (buffer == null) { + throw new ArgumentNullException("buffer"); + } + + if ( offset < 0 ) + { +#if COMPACT_FRAMEWORK_V10 + throw new ArgumentOutOfRangeException("offset"); +#else + throw new ArgumentOutOfRangeException("offset", "cannot be less than zero"); +#endif + } + + if ( count < 0 ) + { +#if COMPACT_FRAMEWORK_V10 + throw new ArgumentOutOfRangeException("count"); +#else + throw new ArgumentOutOfRangeException("count", "cannot be less than zero"); +#endif + } + + if ( offset + count > buffer.Length ) + { + throw new ArgumentOutOfRangeException("count"); + } + + for (int i = 0; i < count; ++i) { + Update(buffer[offset++]); + } + } + } +} diff --git a/Browser.Designer.cs b/Browser.Designer.cs new file mode 100644 index 0000000..2bf08cb --- /dev/null +++ b/Browser.Designer.cs @@ -0,0 +1,81 @@ +namespace LSLEditor +{ + partial class Browser + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tabControl1 = new System.Windows.Forms.TabControlExtended(this.components); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.closeToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(112, 26); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(111, 22); + this.closeToolStripMenuItem.Text = "Close"; + this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + // + // tabControl1 + // + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(592, 366); + this.tabControl1.TabIndex = 1; + this.tabControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseDown); + // + // Browser + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(592, 366); + this.Controls.Add(this.tabControl1); + this.Name = "Browser"; + this.Text = "Browser"; + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControlExtended tabControl1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + } +} \ No newline at end of file diff --git a/Browser.cs b/Browser.cs new file mode 100644 index 0000000..3a0ae25 --- /dev/null +++ b/Browser.cs @@ -0,0 +1,179 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Imaging; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class Browser : Form + { + private LSLEditorForm lslEditorForm; + + public Browser(LSLEditorForm lslEditorForm) + { + InitializeComponent(); + + this.Icon = lslEditorForm.Icon; + this.lslEditorForm = lslEditorForm; + + // enables close buttons on tabs + this.tabControl1.SetDrawMode(); + } + + private void axWebBrowser1_StatusTextChanged(object sender, EventArgs e) + { + WebBrowser axWebBrowser1 = sender as WebBrowser; + ToolStripStatusLabel status = axWebBrowser1.Tag as ToolStripStatusLabel; + if (status == null) + return; + status.Text = axWebBrowser1.StatusText; + } + + + private void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) + { + string strUrl = e.Url.ToString(); + if (strUrl.EndsWith(".lsl")) + { + e.Cancel = true; + if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) == DialogResult.Cancel) + return; + + WebBrowser axWebBrowser1 = sender as WebBrowser; + axWebBrowser1.Stop(); + + this.lslEditorForm.OpenFile(strUrl,Guid.NewGuid()); + } + } + + public void ShowWebBrowser(string strTabName, string strUrl) + { + WebBrowser axWebBrowser1 = null; + try + { + if (!Properties.Settings.Default.HelpNewTab) + { + TabPage tabPage = this.tabControl1.TabPages[0]; + tabPage.Text = strTabName + " "; + axWebBrowser1 = tabPage.Controls[0] as WebBrowser; + } + } + catch + { + } + + if (axWebBrowser1 == null) + { + TabPage tabPage = new TabPage(strTabName + " "); + tabPage.BackColor = Color.White; + + axWebBrowser1 = new WebBrowser(); + + ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel(); + StatusStrip statusStrip1 = new StatusStrip(); + + statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { toolStripStatusLabel1}); + statusStrip1.Location = new System.Drawing.Point(0, 318); + statusStrip1.Name = "statusStrip1"; + statusStrip1.Size = new System.Drawing.Size(584, 22); + statusStrip1.TabIndex = 0; + statusStrip1.Text = "statusStrip1"; + + toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17); + toolStripStatusLabel1.Text = "toolStripStatusLabel1"; + + tabPage.Controls.Add(axWebBrowser1); + + tabPage.Controls.Add(statusStrip1); + + this.tabControl1.TabPages.Add(tabPage); + this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1; + + // reference + axWebBrowser1.Tag = toolStripStatusLabel1; + + axWebBrowser1.Dock = DockStyle.Fill; + axWebBrowser1.StatusTextChanged += new EventHandler(axWebBrowser1_StatusTextChanged); + axWebBrowser1.Navigating += new WebBrowserNavigatingEventHandler(axWebBrowser1_Navigating); + } + axWebBrowser1.Navigate(strUrl); + } + + private void closeToolStripMenuItem_Click(object sender, EventArgs e) + { + int intTabToClose = (int)this.contextMenuStrip1.Tag; + if (intTabToClose >= this.tabControl1.TabCount) + return; + this.tabControl1.TabPages.RemoveAt(intTabToClose); + } + + private void tabControl1_MouseDown(object sender, MouseEventArgs e) + { + TabControl tabControl = sender as TabControl; + if (tabControl == null) + return; + if (e.Button == MouseButtons.Right) + { + for (int intI = 0; intI < tabControl.TabCount; intI++) + { + Rectangle rt = tabControl.GetTabRect(intI); + if (e.X > rt.Left && e.X < rt.Right + && e.Y > rt.Top && e.Y < rt.Bottom) + { + this.contextMenuStrip1.Tag = intI; + this.contextMenuStrip1.Show(this.tabControl1, new Point(e.X, e.Y)); + } + } + } + + } + + + + } +} \ No newline at end of file diff --git a/Browser.resx b/Browser.resx new file mode 100644 index 0000000..174d5e9 --- /dev/null +++ b/Browser.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 127, 17 + + \ No newline at end of file diff --git a/BugReport/BugReportForm.Designer.cs b/BugReport/BugReportForm.Designer.cs new file mode 100644 index 0000000..54ad41c --- /dev/null +++ b/BugReport/BugReportForm.Designer.cs @@ -0,0 +1,437 @@ +namespace LSLEditor.BugReport +{ + partial class BugReportForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.panel2 = new System.Windows.Forms.Panel(); + this.button4 = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.listView1 = new System.Windows.Forms.ListView(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.panel1 = new System.Windows.Forms.Panel(); + this.button3 = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.textBox5 = new System.Windows.Forms.TextBox(); + this.splitter2 = new System.Windows.Forms.Splitter(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.listView2 = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.groupBox1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox3); + this.groupBox1.Controls.Add(this.panel2); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(8); + this.groupBox1.Size = new System.Drawing.Size(712, 330); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "report"; + // + // textBox3 + // + this.textBox3.AcceptsReturn = true; + this.textBox3.AcceptsTab = true; + this.textBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox3.Location = new System.Drawing.Point(8, 160); + this.textBox3.Multiline = true; + this.textBox3.Name = "textBox3"; + this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox3.Size = new System.Drawing.Size(696, 162); + this.textBox3.TabIndex = 4; + // + // panel2 + // + this.panel2.Controls.Add(this.button4); + this.panel2.Controls.Add(this.label6); + this.panel2.Controls.Add(this.label5); + this.panel2.Controls.Add(this.label4); + this.panel2.Controls.Add(this.label3); + this.panel2.Controls.Add(this.label1); + this.panel2.Controls.Add(this.textBox1); + this.panel2.Controls.Add(this.listView1); + this.panel2.Controls.Add(this.textBox2); + this.panel2.Controls.Add(this.label2); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(8, 21); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(696, 139); + this.panel2.TabIndex = 6; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(312, 112); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 24); + this.button4.TabIndex = 9; + this.button4.Text = "check all"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(0, 80); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(191, 13); + this.label6.TabIndex = 8; + this.label6.Text = "and will not be made public in any way!"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(0, 64); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(217, 13); + this.label5.TabIndex = 7; + this.label5.Text = "Uploaded files will only be used for bugfixing,"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(208, 8); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(98, 13); + this.label4.TabIndex = 6; + this.label4.Text = "Files to be included"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(0, 104); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(130, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Description of the problem"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(0, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Name"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(40, 8); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(168, 20); + this.textBox1.TabIndex = 1; + // + // listView1 + // + this.listView1.CheckBoxes = true; + this.listView1.Location = new System.Drawing.Point(312, 8); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(248, 104); + this.listView1.TabIndex = 3; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(40, 40); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(168, 20); + this.textBox2.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(0, 40); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(32, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Email"; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(8, 8); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(726, 402); + this.tabControl1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.groupBox1); + this.tabPage1.Controls.Add(this.panel1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(718, 376); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "New bug report"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // panel1 + // + this.panel1.Controls.Add(this.button3); + this.panel1.Controls.Add(this.progressBar1); + this.panel1.Controls.Add(this.button2); + this.panel1.Controls.Add(this.button1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(3, 333); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(712, 40); + this.panel1.TabIndex = 0; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(504, 8); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 7; + this.button3.Text = "Close"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(8, 8); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(280, 23); + this.progressBar1.TabIndex = 0; + // + // button2 + // + this.button2.Enabled = false; + this.button2.Location = new System.Drawing.Point(416, 8); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 6; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(296, 8); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(112, 23); + this.button1.TabIndex = 5; + this.button1.Text = "Send bug report"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.textBox5); + this.tabPage2.Controls.Add(this.splitter2); + this.tabPage2.Controls.Add(this.textBox4); + this.tabPage2.Controls.Add(this.splitter1); + this.tabPage2.Controls.Add(this.listView2); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(718, 376); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Bug tracker"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // textBox5 + // + this.textBox5.AcceptsReturn = true; + this.textBox5.AcceptsTab = true; + this.textBox5.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox5.Location = new System.Drawing.Point(267, 131); + this.textBox5.Multiline = true; + this.textBox5.Name = "textBox5"; + this.textBox5.ReadOnly = true; + this.textBox5.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox5.Size = new System.Drawing.Size(448, 242); + this.textBox5.TabIndex = 10; + // + // splitter2 + // + this.splitter2.Dock = System.Windows.Forms.DockStyle.Top; + this.splitter2.Location = new System.Drawing.Point(267, 128); + this.splitter2.Name = "splitter2"; + this.splitter2.Size = new System.Drawing.Size(448, 3); + this.splitter2.TabIndex = 3; + this.splitter2.TabStop = false; + // + // textBox4 + // + this.textBox4.AcceptsReturn = true; + this.textBox4.AcceptsTab = true; + this.textBox4.Dock = System.Windows.Forms.DockStyle.Top; + this.textBox4.Location = new System.Drawing.Point(267, 3); + this.textBox4.Multiline = true; + this.textBox4.Name = "textBox4"; + this.textBox4.ReadOnly = true; + this.textBox4.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox4.Size = new System.Drawing.Size(448, 125); + this.textBox4.TabIndex = 9; + // + // splitter1 + // + this.splitter1.Location = new System.Drawing.Point(264, 3); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(3, 370); + this.splitter1.TabIndex = 1; + this.splitter1.TabStop = false; + // + // listView2 + // + this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listView2.ContextMenuStrip = this.contextMenuStrip1; + this.listView2.Dock = System.Windows.Forms.DockStyle.Left; + this.listView2.FullRowSelect = true; + this.listView2.HideSelection = false; + this.listView2.Location = new System.Drawing.Point(3, 3); + this.listView2.Name = "listView2"; + this.listView2.Size = new System.Drawing.Size(261, 370); + this.listView2.TabIndex = 8; + this.listView2.UseCompatibleStateImageBehavior = false; + this.listView2.View = System.Windows.Forms.View.Details; + this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged); + // + // columnHeader1 + // + this.columnHeader1.Text = "Number"; + this.columnHeader1.Width = 85; + // + // columnHeader2 + // + this.columnHeader2.Text = "Date/Time"; + this.columnHeader2.Width = 145; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.deleteToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(117, 26); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + // + // timer1 + // + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // BugReportForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(742, 418); + this.Controls.Add(this.tabControl1); + this.Name = "BugReportForm"; + this.Padding = new System.Windows.Forms.Padding(8); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "LSLEditor bug report"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TextBox textBox5; + private System.Windows.Forms.Splitter splitter2; + private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.ListView listView2; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.ColumnHeader columnHeader2; + } +} \ No newline at end of file diff --git a/BugReport/BugReportForm.cs b/BugReport/BugReportForm.cs new file mode 100644 index 0000000..bac561f --- /dev/null +++ b/BugReport/BugReportForm.cs @@ -0,0 +1,298 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.Reflection; + +using LSLEditor.org.lsleditor.www; + + +namespace LSLEditor.BugReport +{ + public partial class BugReportForm : Form + { + private bool blnComplete; + private UploadBugReport ubr; + + private LSLEditorForm parent; + + public BugReportForm(LSLEditorForm parent) + { + InitializeComponent(); + this.parent = parent; + this.Icon = parent.Icon; + this.textBox1.Text = Properties.Settings.Default.AvatarName; + this.textBox2.Text = Properties.Settings.Default.EmailAddress; + this.listView1.Columns.Add("ScriptName",this.listView1.Width-30); + foreach (Form form in parent.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + ListViewItem lvi = new ListViewItem(editForm.ScriptName); + lvi.Checked = false; + this.listView1.Items.Add(lvi); + } + ShowBugReportsList(); + } + + private void ShowBugReportsList() + { + if (Properties.Settings.Default.Bugreports == null) + return; + this.listView2.Items.Clear(); + foreach (string Handle in Properties.Settings.Default.Bugreports) + { + long result; + if (!long.TryParse(Handle, out result)) + continue; + result *= (long)1e7; + DateTime dateTime = new DateTime(result); + ListViewItem lvi = new ListViewItem(Handle); + lvi.SubItems.Add(dateTime.ToString()); + lvi.Tag = Handle; + this.listView2.Items.Add(lvi); + } + } + + //close + private void button3_Click(object sender, EventArgs e) + { + this.timer1.Stop(); + if (ubr != null) + ubr.Stop(); + this.Close(); + } + + // cancel + private void button2_Click(object sender, EventArgs e) + { + this.button2.Enabled = false; + this.timer1.Stop(); + this.progressBar1.Value = 0; + if (ubr != null) + ubr.Stop(); + this.button1.Enabled = true; + } + + private void button1_Click(object sender, EventArgs e) + { + string strMessage = this.textBox3.Text.Trim(); + if (strMessage == "") + { + MessageBox.Show("The bug report is empty(?!), it is not send!", "Bug report", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + ubr = new UploadBugReport(); + this.button1.Enabled = false; + this.button2.Enabled = true; + this.blnComplete = false; + this.timer1.Start(); + ubr.OnComplete += new UploadBugReport.UploadCompleteHandler(ubr_OnComplete); + List list = new List(); + StringBuilder sb = new StringBuilder(); + + Properties.Settings.Default.AvatarName = this.textBox1.Text; + Properties.Settings.Default.EmailAddress = this.textBox2.Text; + + sb.AppendFormat("Version: {0} {1}\r\n", + this.parent.Text, + Assembly.GetExecutingAssembly().GetName().Version.ToString()); + sb.AppendFormat("Name: {0}\r\n", this.textBox1.Text); + sb.AppendFormat("Email: {0}\r\n\r\n", this.textBox2.Text); + sb.Append(this.textBox3.Text); + list.Add(new UploadBugReport.FileToUpload("bugreport.txt", sb.ToString())); + foreach (ListViewItem lvi in this.listView1.Items) + { + if (!lvi.Checked) + continue; + string strScriptName = lvi.Text; + string strBody = null; + foreach (Form form in parent.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + if (editForm.ScriptName == strScriptName) + strBody = editForm.SourceCode; + } + if(strBody != null) + list.Add(new UploadBugReport.FileToUpload(strScriptName, strBody)); + } + ubr.UploadAsync(list, this.progressBar1); + } + + void ubr_OnComplete(object sender, UploadBugReport.UploadCompleteEventArgs e) + { + if(e.TotalBytes == -1) + MessageBox.Show("There is something wrong. Your bug report has not been sent!!", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + else + MessageBox.Show("Your bug report has been sent (" + e.TotalBytes + " bytes)", "Ready", MessageBoxButtons.OK, MessageBoxIcon.Information); + this.blnComplete = true; + } + + private void timer1_Tick(object sender, EventArgs e) + { + if (this.blnComplete) + { + this.timer1.Stop(); + + this.button1.Enabled = true; + this.button2.Enabled = false; + + this.progressBar1.Value = 0; + this.textBox3.Clear(); + ShowBugReportsList(); + this.tabControl1.SelectedIndex = 1; + } + + if (ubr != null) + { + if (!ubr.blnRunning) + { + this.button1.Enabled = true; + this.timer1.Stop(); + } + } + + } + + private void listView2_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.listView2.SelectedItems.Count == 0) + return; + ListViewItem lvi = this.listView2.SelectedItems[0]; + string Handle = lvi.Tag.ToString(); + + Service1 service1 = new Service1(); + service1.GetStatusCompleted += new GetStatusCompletedEventHandler(service1_GetStatusCompleted); + service1.GetStatusAsync(Handle, Handle); + } + + void service1_GetStatusCompleted(object sender, GetStatusCompletedEventArgs e) + { + this.textBox5.Clear(); + string Handle = e.UserState.ToString(); + if (e.Error != null) + { + this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)"; + return; + } + + string strResult = e.Result; + if (strResult == null) + { + this.textBox5.Text = "Bug report [" + Handle + "] does not exist (anymore)"; + return; + } + + this.textBox5.Text = strResult.Replace("\n", "\r\n"); + + Service1 service1 = new Service1(); + service1.GetBugReportCompleted += new GetBugReportCompletedEventHandler(service1_GetBugReportCompleted); + service1.GetBugReportAsync(Handle, Handle); + } + + void service1_GetBugReportCompleted(object sender, GetBugReportCompletedEventArgs e) + { + this.textBox4.Clear(); + string Handle = e.UserState.ToString(); + + if (e.Error != null) + { + this.textBox4.Text = "Bug report [" + Handle + "] not available (at this time)"; + return; + } + + string strResult = e.Result; + if (strResult == null) + { + this.textBox4.Text = "Bug report [" + Handle + "] does not extist (anymore)"; + return; + } + + this.textBox4.Text = strResult.Replace("\n", "\r\n"); + } + + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.listView2.SelectedItems.Count == 0) + return; + + if (MessageBox.Show("Delete " + this.listView2.SelectedItems.Count + " bugreports?", "Delete Bugreports", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) + { + for(int intI=0; intI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 100, 17 + + + 17, 17 + + + 42 + + \ No newline at end of file diff --git a/BugReport/UploadBugReport.cs b/BugReport/UploadBugReport.cs new file mode 100644 index 0000000..db59d22 --- /dev/null +++ b/BugReport/UploadBugReport.cs @@ -0,0 +1,222 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Text; +using System.Drawing; +using System.Text.RegularExpressions; +using System.Threading; +using System.Collections; +using System.Collections.Specialized; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace LSLEditor.BugReport +{ + class UploadBugReport + { + public struct FileToUpload + { + public string FileName; + public string Body; + public string Path; + public FileToUpload(string FileName, string Body) + { + this.FileName = FileName; + this.Body = Body; + this.Path = null; + } + } + + public class UploadCompleteEventArgs : EventArgs + { + public int TotalBytes; + public UploadCompleteEventArgs(int intTotal) + { + this.TotalBytes = intTotal; + } + } + + public bool blnRunning; + + public delegate void UploadCompleteHandler(object sender, UploadCompleteEventArgs e); + public event UploadCompleteHandler OnComplete; + + private Thread thread; + private ProgressBar progressbar; + private List list; + + public void UploadAsync(List list, ProgressBar progressbar) + { + this.list = list; + this.progressbar = progressbar; + + this.blnRunning = true; + + thread = new Thread(new ThreadStart(Worker)); + thread.IsBackground = true; + thread.Name = "Worker"; + thread.Start(); + } + + public void Stop() + { + this.blnRunning = false; + if (thread != null) + { + thread.Join(1000); + thread = null; + } + } + + private void Worker() + { + int intTotal = 0; + try + { + org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1(); + + string Handle = webservice.Open(); + if (Handle == null) + { + MessageBox.Show("Can't get an upload handle", "Oops..."); + this.blnRunning = false; + return; + } + + if (Properties.Settings.Default.Bugreports == null) + Properties.Settings.Default.Bugreports = new StringCollection(); + Properties.Settings.Default.Bugreports.Add(Handle); + + // Properties.Settings.Default.Save(); + + int intNumber = 0; + foreach (FileToUpload file in this.list) + { + string strFileName = string.Format("{0}-{1}", intNumber, file.FileName); + if (file.Path == null) + { + intTotal += Upload(Handle, strFileName, Encoding.ASCII.GetBytes(file.Body)); + } + else + { + intTotal += Upload(Handle, strFileName, file.Path); + } + intNumber++; + } + } + catch + { + intTotal = -1; + } + if (this.blnRunning) + if (OnComplete != null) + OnComplete(this, new UploadCompleteEventArgs(intTotal)); + this.blnRunning = false; + } + + private delegate void SetValueDelegate(int intValue); + + private void SetMaximum(int intMaximum) + { + if (this.progressbar.InvokeRequired) + { + this.progressbar.Invoke(new SetValueDelegate(SetMaximum), new object[] { intMaximum }); + } + else + { + this.progressbar.Maximum = intMaximum; + } + } + + private void SetValue(int intValue) + { + if (this.progressbar.InvokeRequired) + { + this.progressbar.Invoke(new SetValueDelegate(SetValue), new object[] { intValue }); + } + else + { + this.progressbar.Value = intValue; + } + } + private int Upload(string Handle, string FileName, byte[] buffer) + { + org.lsleditor.www.Service1 webservice = new org.lsleditor.www.Service1(); + if (Handle == null) + return 0; + + SetMaximum(buffer.Length); + int intOffset = 0; + int intTotal = 0; + byte[] smallbuffer = new byte[1024]; + while (this.blnRunning) + { + int intLength = Math.Min(smallbuffer.Length, buffer.Length - intOffset); + if (intLength <= 0) + break; + Array.Copy(buffer, intOffset, smallbuffer, 0, intLength); + intOffset += intLength; + string strError = webservice.Write(Handle, FileName, smallbuffer, intLength); + if (strError != null) + { + MessageBox.Show("Error:" + strError, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + break; + } + intTotal += intLength; + SetValue(intTotal); + } + return intTotal; + } + + private int Upload(string Handle, string FileName, string strPath) + { + FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read); + byte[] buffer = new byte[fs.Length]; + fs.Read(buffer, 0, (int)fs.Length); + fs.Close(); + return Upload(Handle, FileName, buffer); + } + } +} diff --git a/Decompressor/Decompress.cs b/Decompressor/Decompress.cs new file mode 100644 index 0000000..39e6f0b --- /dev/null +++ b/Decompressor/Decompress.cs @@ -0,0 +1,97 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; // bitconvertor +using System.IO; +using System.IO.Compression; + +using System.Security.Cryptography; + +namespace LSLEditor.Decompressor +{ + public class MD5Verify + { + public static string ComputeHash(string strFile) + { + MD5CryptoServiceProvider csp = new MD5CryptoServiceProvider(); + FileStream stream = File.OpenRead(strFile); + byte[] hash = csp.ComputeHash(stream); + stream.Close(); + return BitConverter.ToString(hash).Replace("-", "").ToLower(); + } + } + + + public sealed class Gzip + { + public static void Decompress(Stream inStream, Stream outStream) + { + using (outStream) + { + using (GZipStream zipStream = new GZipStream(inStream, CompressionMode.Decompress)) + { + int ch = zipStream.ReadByte(); + while (ch != -1) + { + outStream.WriteByte((byte)ch); + ch = zipStream.ReadByte(); + } + } + } + } + } + + + public sealed class Zip + { + public static void Decompress(Stream inStream, Stream outStream) + { + ZipEntry zipEntry = ZipEntry.Read(inStream); + inStream.Close(); + using (outStream) + { + zipEntry.Extract(outStream); + } + } + } +} diff --git a/Decompressor/ZipEntry.cs b/Decompressor/ZipEntry.cs new file mode 100644 index 0000000..0546d60 --- /dev/null +++ b/Decompressor/ZipEntry.cs @@ -0,0 +1,371 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; + +namespace LSLEditor.Decompressor +{ + + public class ZipEntry + { + + private const int ZipEntrySignature = 0x04034b50; + private const int ZipEntryDataDescriptorSignature = 0x08074b50; + + private DateTime _LastModified; + + private string _FileName; + + private Int16 _VersionNeeded; + + private Int16 _BitField; + + private Int16 _CompressionMethod; + + private Int32 _CompressedSize; + + private Int32 _UncompressedSize; + + private Int32 _LastModDateTime; + private Int32 _Crc32; + private byte[] _Extra; + + private byte[] __filedata; + private byte[] _FileData + { + get + { + if (__filedata == null) + { + } + return __filedata; + } + } + + private System.IO.MemoryStream _UnderlyingMemoryStream; + private System.IO.Compression.DeflateStream _CompressedStream; + private System.IO.Compression.DeflateStream CompressedStream + { + get + { + if (_CompressedStream == null) + { + _UnderlyingMemoryStream = new System.IO.MemoryStream(); + bool LeaveUnderlyingStreamOpen = true; + _CompressedStream = new System.IO.Compression.DeflateStream(_UnderlyingMemoryStream, + System.IO.Compression.CompressionMode.Compress, + LeaveUnderlyingStreamOpen); + } + return _CompressedStream; + } + } + + private static bool ReadHeader(System.IO.Stream s, ZipEntry ze) + { + int signature = Shared.ReadSignature(s); + + // return null if this is not a local file header signature + if (SignatureIsNotValid(signature)) + { + s.Seek(-4, System.IO.SeekOrigin.Current); + return false; + } + + byte[] block = new byte[26]; + int n = s.Read(block, 0, block.Length); + if (n != block.Length) return false; + + int i = 0; + ze._VersionNeeded = (short)(block[i++] + block[i++] * 256); + ze._BitField = (short)(block[i++] + block[i++] * 256); + ze._CompressionMethod = (short)(block[i++] + block[i++] * 256); + ze._LastModDateTime = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + + // the PKZIP spec says that if bit 3 is set (0x0008), then the CRC, Compressed size, and uncompressed size + // come directly after the file data. The only way to find it is to scan the zip archive for the signature of + // the Data Descriptor, and presume that that signature does not appear in the (compressed) data of the compressed file. + + if ((ze._BitField & 0x0008) != 0x0008) + { + ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + } + else + { + // the CRC, compressed size, and uncompressed size are stored later in the stream. + // here, we advance the pointer. + i += 12; + } + + Int16 filenameLength = (short)(block[i++] + block[i++] * 256); + Int16 extraFieldLength = (short)(block[i++] + block[i++] * 256); + + block = new byte[filenameLength]; + n = s.Read(block, 0, block.Length); + ze._FileName = Shared.StringFromBuffer(block, 0, block.Length); + + ze._Extra = new byte[extraFieldLength]; + n = s.Read(ze._Extra, 0, ze._Extra.Length); + + // transform the time data into something usable + ze._LastModified = Shared.PackedToDateTime(ze._LastModDateTime); + + // actually get the compressed size and CRC if necessary + if ((ze._BitField & 0x0008) == 0x0008) + { + long posn = s.Position; + long SizeOfDataRead = Shared.FindSignature(s, ZipEntryDataDescriptorSignature); + if (SizeOfDataRead == -1) return false; + + // read 3x 4-byte fields (CRC, Compressed Size, Uncompressed Size) + block = new byte[12]; + n = s.Read(block, 0, block.Length); + if (n != 12) return false; + i = 0; + ze._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + ze._CompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + ze._UncompressedSize = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + + if (SizeOfDataRead != ze._CompressedSize) + throw new Exception("Data format error (bit 3 is set)"); + + // seek back to previous position, to read file data + s.Seek(posn, System.IO.SeekOrigin.Begin); + } + + return true; + } + + + private static bool SignatureIsNotValid(int signature) + { + return (signature != ZipEntrySignature); + } + + public static ZipEntry Read(System.IO.Stream s) + { + ZipEntry entry = new ZipEntry(); + if (!ReadHeader(s, entry)) return null; + + entry.__filedata = new byte[entry._CompressedSize]; + int n = s.Read(entry._FileData, 0, entry._FileData.Length); + if (n != entry._FileData.Length) + { + throw new Exception("badly formatted zip file."); + } + // finally, seek past the (already read) Data descriptor if necessary + if ((entry._BitField & 0x0008) == 0x0008) + { + s.Seek(16, System.IO.SeekOrigin.Current); + } + return entry; + } + + + public void Extract(System.IO.Stream s) + { + using (System.IO.MemoryStream memstream = new System.IO.MemoryStream(_FileData)) + { + System.IO.Stream input = null; + try + { + if (this._CompressedSize == this._UncompressedSize) + { + input = memstream; + } + else + { + input = new System.IO.Compression.DeflateStream(memstream, System.IO.Compression.CompressionMode.Decompress); + } + + System.IO.Stream output = null; + try + { + output = s; + + + byte[] bytes = new byte[4096]; + int n; + + n = 1; // anything non-zero + while (n != 0) + { + n = input.Read(bytes, 0, bytes.Length); + if (n > 0) + { + output.Write(bytes, 0, n); + } + } + } + finally + { + // we only close the output stream if we opened it. + if (output != null) + { + output.Close(); + output.Dispose(); + } + } + } + finally + { + // we only close the output stream if we opened it. + // we cannot use using() here because in some cases we do not want to Dispose the stream! + if ((input != null) && (input != memstream)) + { + input.Close(); + input.Dispose(); + } + } + } + } + + } + + class Shared + { + protected internal static string StringFromBuffer(byte[] buf, int start, int maxlength) + { + int i; + char[] c = new char[maxlength]; + for (i = 0; (i < maxlength) && (i < buf.Length) && (buf[i] != 0); i++) + { + c[i] = (char)buf[i]; // System.BitConverter.ToChar(buf, start+i*2); + } + string s = new System.String(c, 0, i); + return s; + } + + protected internal static int ReadSignature(System.IO.Stream s) + { + int n = 0; + byte[] sig = new byte[4]; + n = s.Read(sig, 0, sig.Length); + if (n != sig.Length) throw new Exception("Could not read signature - no data!"); + int signature = (((sig[3] * 256 + sig[2]) * 256) + sig[1]) * 256 + sig[0]; + return signature; + } + + protected internal static long FindSignature(System.IO.Stream s, int SignatureToFind) + { + long startingPosition = s.Position; + + int BATCH_SIZE = 1024; + byte[] targetBytes = new byte[4]; + targetBytes[0] = (byte)(SignatureToFind >> 24); + targetBytes[1] = (byte)((SignatureToFind & 0x00FF0000) >> 16); + targetBytes[2] = (byte)((SignatureToFind & 0x0000FF00) >> 8); + targetBytes[3] = (byte)(SignatureToFind & 0x000000FF); + byte[] batch = new byte[BATCH_SIZE]; + int n = 0; + bool success = false; + do + { + n = s.Read(batch, 0, batch.Length); + if (n != 0) + { + for (int i = 0; i < n; i++) + { + if (batch[i] == targetBytes[3]) + { + s.Seek(i - n, System.IO.SeekOrigin.Current); + int sig = ReadSignature(s); + success = (sig == SignatureToFind); + if (!success) s.Seek(-3, System.IO.SeekOrigin.Current); + break; // out of for loop + } + } + } + else break; + if (success) break; + } while (true); + if (!success) + { + s.Seek(startingPosition, System.IO.SeekOrigin.Begin); + return -1; // or throw? + } + + // subtract 4 for the signature. + long bytesRead = (s.Position - startingPosition) - 4; + // number of bytes read, should be the same as compressed size of file + return bytesRead; + } + protected internal static DateTime PackedToDateTime(Int32 packedDateTime) + { + Int16 packedTime = (Int16)(packedDateTime & 0x0000ffff); + Int16 packedDate = (Int16)((packedDateTime & 0xffff0000) >> 16); + + int year = 1980 + ((packedDate & 0xFE00) >> 9); + int month = (packedDate & 0x01E0) >> 5; + int day = packedDate & 0x001F; + + + int hour = (packedTime & 0xF800) >> 11; + int minute = (packedTime & 0x07E0) >> 5; + int second = packedTime & 0x001F; + + DateTime d = System.DateTime.Now; + try { d = new System.DateTime(year, month, day, hour, minute, second, 0); } + catch + { + Console.Write("\nInvalid date/time?:\nyear: {0} ", year); + Console.Write("month: {0} ", month); + Console.WriteLine("day: {0} ", day); + Console.WriteLine("HH:MM:SS= {0}:{1}:{2}", hour, minute, second); + } + + return d; + } + + + protected internal static Int32 DateTimeToPacked(DateTime time) + { + UInt16 packedDate = (UInt16)((time.Day & 0x0000001F) | ((time.Month << 5) & 0x000001E0) | (((time.Year - 1980) << 9) & 0x0000FE00)); + UInt16 packedTime = (UInt16)((time.Second & 0x0000001F) | ((time.Minute << 5) & 0x000007E0) | ((time.Hour << 11) & 0x0000F800)); + return (Int32)(((UInt32)(packedDate << 16)) | packedTime); + } + } + +} + diff --git a/EditForm.Designer.cs b/EditForm.Designer.cs new file mode 100644 index 0000000..21d8b19 --- /dev/null +++ b/EditForm.Designer.cs @@ -0,0 +1,113 @@ +namespace LSLEditor +{ + partial class EditForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.disableCompilesyntaxCheckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // tabControl1 + // + this.tabControl1.ContextMenuStrip = this.contextMenuStrip1; + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(551, 323); + this.tabControl1.TabIndex = 1; + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.numberedTextBoxUC1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(543, 297); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Script"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.disableCompilesyntaxCheckToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(225, 26); + // + // disableCompilesyntaxCheckToolStripMenuItem + // + this.disableCompilesyntaxCheckToolStripMenuItem.Name = "disableCompilesyntaxCheckToolStripMenuItem"; + this.disableCompilesyntaxCheckToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.disableCompilesyntaxCheckToolStripMenuItem.Text = "Disable compile/syntax check"; + this.disableCompilesyntaxCheckToolStripMenuItem.Click += new System.EventHandler(this.disableCompilesyntaxCheckToolStripMenuItem_Click); + // + // numberedTextBoxUC1 + // + this.numberedTextBoxUC1.Dock = System.Windows.Forms.DockStyle.Fill; + this.numberedTextBoxUC1.Location = new System.Drawing.Point(3, 3); + this.numberedTextBoxUC1.Name = "numberedTextBoxUC1"; + this.numberedTextBoxUC1.Size = new System.Drawing.Size(537, 291); + this.numberedTextBoxUC1.TabIndex = 4; + // + // EditForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(551, 323); + this.Controls.Add(this.tabControl1); + this.Name = "EditForm"; + this.Text = "EditForm"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EditForm_FormClosing); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem disableCompilesyntaxCheckToolStripMenuItem; + + + } +} \ No newline at end of file diff --git a/EditForm.cs b/EditForm.cs new file mode 100644 index 0000000..36ab45f --- /dev/null +++ b/EditForm.cs @@ -0,0 +1,449 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Xml; +using System.Drawing; +using System.Windows.Forms; + +using LSLEditor.Helpers; + +namespace LSLEditor +{ + public partial class EditForm : Form + { + public RuntimeConsole runtime; + + private string m_FullPathName; + private Guid m_Guid; + + public LSLEditorForm parent; + + private const int WM_NCACTIVATE = 0x0086; + protected override void WndProc(ref Message m) + { + if (m.Msg == WM_NCACTIVATE) + { + if (m.LParam != IntPtr.Zero) + { + m.WParam = new IntPtr(1); + } + else + { + this.numberedTextBoxUC1.TextBox.MakeAllInvis(); + } + } + try { base.WndProc(ref m); } catch {} + } + + public SyntaxRichTextBox TextBox + { + get + { + return this.numberedTextBoxUC1.TextBox; + } + } + + public XmlDocument ConfLSL + { + get + { + return this.parent.ConfLSL; + } + } + + public XmlDocument ConfCSharp + { + get + { + return this.parent.ConfCSharp; + } + } + + public Guid guid + { + get + { + return m_Guid; + } + set + { + this.m_Guid = value; + } + } + + public bool IsScript + { + get + { + return this.TextBox.ToolTipping; + } + set + { + if(value) + this.tabPage1.Text = "Script"; + else + this.tabPage1.Text = "Text"; + this.TextBox.ToolTipping = value; + } + } + + public EditForm(LSLEditorForm lslEditorForm) + { + InitializeComponent(); + + this.guid = new Guid(); + + this.components = new System.ComponentModel.Container(); + + this.Icon = lslEditorForm.Icon; + this.parent = lslEditorForm; + + this.numberedTextBoxUC1.TextBox.Init(this.parent, this.parent.ConfLSL); + this.numberedTextBoxUC1.TextBox.OnDirtyChanged += new IsDirtyHandler(TextBox_OnDirtyChanged); + + this.Move += new EventHandler(EditForm_Position); + this.Resize += new EventHandler(EditForm_Position); + + this.Layout += new LayoutEventHandler(EditForm_Layout); + + SetFont(); + } + + public void SetFont() + { + this.numberedTextBoxUC1.Font = Properties.Settings.Default.FontEditor; + } + + void EditForm_Layout(object sender, LayoutEventArgs e) + { + if (this.WindowState == FormWindowState.Minimized) + this.numberedTextBoxUC1.TextBox.MakeAllInvis(); + } + + void EditForm_Position(object sender, EventArgs e) + { + this.numberedTextBoxUC1.TextBox.SetPosition(this.MdiParent.RectangleToScreen(this.MdiParent.ClientRectangle)); + } + + void TextBox_OnDirtyChanged(object sender, EventArgs e) + { + this.Text = this.ScriptName; + if (this.numberedTextBoxUC1.TextBox.Dirty) + this.Text = this.Text.Trim()+"* "; + else + this.Text = this.Text.Trim()+" "; + TabPage tabPage = this.Tag as TabPage; + if (tabPage != null) + tabPage.Text = this.Text; + this.parent.OnDirtyChanged(this.numberedTextBoxUC1.TextBox.Dirty); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + + public string FullPathName + { + get + { + return this.m_FullPathName; + } + set + { + this.m_FullPathName = value; + string strDirectory = Path.GetDirectoryName(this.m_FullPathName); + if (Directory.Exists(strDirectory)) + { + Properties.Settings.Default.WorkingDirectory = strDirectory; + } + else + { + if(!Directory.Exists(Properties.Settings.Default.WorkingDirectory)) + Properties.Settings.Default.WorkingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + this.m_FullPathName = Path.Combine(Properties.Settings.Default.WorkingDirectory, this.m_FullPathName); + } + this.Text = this.ScriptName; + TabPage tabPage = this.Tag as TabPage; + if (tabPage != null) + tabPage.Text = this.Text + " "; + } + } + + public string ScriptName + { + get + { + return Path.GetFileName(this.m_FullPathName); + } + } + + public string ProjectName + { + get + { + return parent.SolutionExplorer.GetProjectName(this.guid); + } + } + + public string SourceCode + { + get + { + return this.numberedTextBoxUC1.TextBox.Text; + } + set + { + this.numberedTextBoxUC1.TextBox.Text = value; + } + } + + private int PercentageIndentTab() + { + int intSpaces = 0; + int intTabs = 0; + StringReader sr = new StringReader(this.TextBox.Text); + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + if (strLine.Length == 0) + continue; + if (strLine[0] == ' ') + intSpaces++; + else if (strLine[0] == '\t') + intTabs++; + } + if (intTabs == 0 && intSpaces==0) + return 50; + return (int)Math.Round((100.0 * intTabs) / (intTabs + intSpaces)); + } + + public void LoadFile(string strPath) + { + if(strPath.StartsWith("http://")) + this.FullPathName = Path.GetFileName(strPath); + else + this.FullPathName = strPath; + this.numberedTextBoxUC1.TextBox.LoadFile(strPath); + + if (!this.IsScript) + return; + + if (Properties.Settings.Default.IndentAutoCorrect) + { + this.TextBox.FormatDocument(); + this.TextBox.ClearUndoStack(); + } + else + { + if (Properties.Settings.Default.IndentWarning) + { + if ((PercentageIndentTab() > 50 && Properties.Settings.Default.SL4SpacesIndent) || + (PercentageIndentTab() < 50 && !Properties.Settings.Default.SL4SpacesIndent)) + { + if (MessageBox.Show("Indent scheme differs from settings\nDo you want to correct it?\nIt can also be corrected by pressing Ctrl-D or turn on Autocorrection (tools menu)", "Indent Warning!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) + { + this.TextBox.FormatDocument(); + //this.TextBox.ClearUndoStack(); + } + } + } + } + } + + public void SaveCurrentFile(string strPath) + { + this.FullPathName = strPath; + this.numberedTextBoxUC1.TextBox.SaveCurrentFile(strPath); + } + + public void SaveCurrentFile() + { + this.numberedTextBoxUC1.TextBox.SaveCurrentFile(this.FullPathName); + } + + public bool Dirty + { + get + { + return this.numberedTextBoxUC1.TextBox.Dirty; + } + set + { + this.numberedTextBoxUC1.TextBox.Dirty = value; + } + } + + public TabControl tabControl + { + get + { + return this.tabControl1; + } + } + + public void SetFocus() + { + this.numberedTextBoxUC1.TextBox.Focus(); + } + + public void StopCompiler() + { + this.numberedTextBoxUC1.TextBox.MakeAllInvis(); + + if (runtime != null) + { + this.components.Remove(runtime); + if (!runtime.IsDisposed) + runtime.Dispose(); + runtime = null; + } + + for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) + { + this.tabControl1.TabPages.RemoveAt(intI); + } + } + + public SecondLifeHost.SecondLifeHostChatHandler ChatHandler; + public SecondLifeHost.SecondLifeHostMessageLinkedHandler MessageLinkedHandler; + + public bool StartCompiler() + { + if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked) + return false; + + if (!this.IsScript) + return false; + + StopCompiler(); + + if (this.parent == null) + return false; + + runtime = new RuntimeConsole(this.parent); + + // for disposing + this.components.Add(runtime); + + if (!runtime.Compile(this)) + { + this.tabControl1.SelectedIndex = 0; + return false; + } + + TabPage tabPage = new TabPage("Debug"); + tabPage.Controls.Add(runtime); + this.tabControl1.TabPages.Add(tabPage); + this.tabControl1.SelectedIndex = 1; + return true; + } + + public bool SyntaxCheck() + { + if (this.disableCompilesyntaxCheckToolStripMenuItem.Checked) + return false; + + if (!this.IsScript) + return false; + + LSL2CSharp translator = new LSL2CSharp(ConfLSL); + string strCSharp = translator.Parse(SourceCode); + + if (System.Diagnostics.Debugger.IsAttached) + { + for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) + { + this.tabControl1.TabPages.RemoveAt(intI); + } + + // TODO + TabPage tabPage = new TabPage("C#"); + NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC(); + numberedTextBoxUC1.TextBox.Init(null, this.ConfCSharp); + numberedTextBoxUC1.TextBox.Text = strCSharp; + numberedTextBoxUC1.TextBox.ReadOnly = true; + numberedTextBoxUC1.Dock = DockStyle.Fill; + tabPage.Controls.Add(numberedTextBoxUC1); + this.tabControl.TabPages.Add(tabPage); + } + + return (null != CompilerHelper.CompileCSharp(this, strCSharp)); + } + + public int Find(string strSearch, int intStart, int intEnd, RichTextBoxFinds options) + { + intStart = this.numberedTextBoxUC1.TextBox.Find(strSearch, intStart, intEnd, options); + this.numberedTextBoxUC1.TextBox.Focus(); + return intStart; + } + + private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + this.numberedTextBoxUC1.TextBox.MakeAllInvis(); + } + + private void EditForm_FormClosing(object sender, FormClosingEventArgs e) + { + this.parent.CancelClosing = false; + if (this.Dirty) + { + DialogResult dialogResult = MessageBox.Show(this, @"Save """ + this.ScriptName + @"""?", "File has changed", MessageBoxButtons.YesNoCancel); + if (dialogResult == DialogResult.Yes) + e.Cancel = this.parent.SaveFile(this,false); + else + e.Cancel = (dialogResult == DialogResult.Cancel); + } + this.parent.CancelClosing = e.Cancel; + } + + private void disableCompilesyntaxCheckToolStripMenuItem_Click(object sender, EventArgs e) + { + this.disableCompilesyntaxCheckToolStripMenuItem.Checked = !this.disableCompilesyntaxCheckToolStripMenuItem.Checked; + } + } +} \ No newline at end of file diff --git a/EditForm.resx b/EditForm.resx new file mode 100644 index 0000000..3f402fe --- /dev/null +++ b/EditForm.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 37 + + \ No newline at end of file diff --git a/Editor/GListBox.Designer.cs b/Editor/GListBox.Designer.cs new file mode 100644 index 0000000..9bc0ead --- /dev/null +++ b/Editor/GListBox.Designer.cs @@ -0,0 +1,36 @@ +namespace LSLEditor +{ + partial class GListBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Editor/GListBox.cs b/Editor/GListBox.cs new file mode 100644 index 0000000..90e378f --- /dev/null +++ b/Editor/GListBox.cs @@ -0,0 +1,152 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.ComponentModel; + +namespace LSLEditor +{ + public partial class GListBox : ListBox + { + public ImageList ImageList; + + public GListBox(IContainer container) + { + container.Add(this); + + InitializeComponent(); + + // Set owner draw mode + this.DrawMode = DrawMode.OwnerDrawFixed; + this.ImageList = new ImageList(); + } + + public GListBox() + { + InitializeComponent(); + + // Set owner draw mode + this.DrawMode = DrawMode.OwnerDrawFixed; + this.ImageList = new ImageList(); + } + + protected override void OnDrawItem(DrawItemEventArgs e) + { + try + { + GListBoxItem item; + Rectangle bounds = new Rectangle(e.Bounds.X + e.Bounds.Height, e.Bounds.Y, e.Bounds.Width - e.Bounds.Height - 1, e.Bounds.Height); + item = (GListBoxItem)Items[e.Index]; + if (item.ImageIndex != -1) + { + e.Graphics.FillRectangle(new SolidBrush(this.BackColor), bounds); + if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) + e.Graphics.FillRectangle(SystemBrushes.Highlight, bounds); + + e.Graphics.DrawImage(ImageList.Images[item.ImageIndex], bounds.Left - bounds.Height, bounds.Top, bounds.Height, bounds.Height); + e.Graphics.DrawString(item.Text, e.Font, new SolidBrush(e.ForeColor), + bounds.Left, bounds.Top); + } + else + { + e.Graphics.DrawString(item.Text, e.Font, new SolidBrush(e.ForeColor), + bounds.Left, bounds.Top); + } + } + catch + { + e.DrawBackground(); + e.DrawFocusRectangle(); + if (e.Index != -1) + { + try + { + e.Graphics.DrawString(Items[e.Index].ToString(), e.Font, + new SolidBrush(e.ForeColor), e.Bounds.Left, e.Bounds.Top); + } + catch + { + } + } + else + { + e.Graphics.DrawString(Text, e.Font, new SolidBrush(e.ForeColor), + e.Bounds.Left, e.Bounds.Top); + } + } + base.OnDrawItem(e); + } + }//End of GListBox class + + // GListBoxItem class + public class GListBoxItem + { + private string _myText; + private int _myImageIndex; + // properties + public string Text + { + get { return _myText; } + set { _myText = value; } + } + public int ImageIndex + { + get { return _myImageIndex; } + set { _myImageIndex = value; } + } + //constructor + public GListBoxItem(string text, int index) + { + _myText = text; + _myImageIndex = index; + } + public GListBoxItem(string text) : this(text, -1) { } + public GListBoxItem() : this("") { } + public override string ToString() + { + return _myText; + } + }//End of GListBoxItem class +} diff --git a/Editor/GListBoxWindow.Designer.cs b/Editor/GListBoxWindow.Designer.cs new file mode 100644 index 0000000..79faa22 --- /dev/null +++ b/Editor/GListBoxWindow.Designer.cs @@ -0,0 +1,64 @@ +namespace LSLEditor +{ + partial class GListBoxWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.gListBox1 = new LSLEditor.GListBox(this.components); + this.SuspendLayout(); + // + // gListBox1 + // + this.gListBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.gListBox1.FormattingEnabled = true; + this.gListBox1.Location = new System.Drawing.Point(0, 0); + this.gListBox1.Name = "gListBox1"; + this.gListBox1.Size = new System.Drawing.Size(192, 134); + this.gListBox1.TabIndex = 0; + this.gListBox1.Resize += new System.EventHandler(this.gListBox1_Resize); + // + // GListBoxWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(212, 156); + this.Controls.Add(this.gListBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "GListBoxWindow"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "GListBoxWindow"; + this.ResumeLayout(false); + + } + + #endregion + + private GListBox gListBox1; + } +} \ No newline at end of file diff --git a/Editor/GListBoxWindow.cs b/Editor/GListBoxWindow.cs new file mode 100644 index 0000000..3d921e1 --- /dev/null +++ b/Editor/GListBoxWindow.cs @@ -0,0 +1,177 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.ComponentModel; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class GListBoxWindow : Form + { + public GListBox GListBox + { + get + { + return this.gListBox1; + } + } + + public GListBoxItem Selected + { + get + { + return (GListBoxItem)this.gListBox1.Items[this.gListBox1.SelectedIndex]; + } + } + + public GListBoxWindow(Form parent) + { + InitializeComponent(); + + this.Owner = parent; + + this.GListBox.Cursor = Cursors.Arrow; + this.GListBox.Sorted = true; + + this.FontChanged += new EventHandler(GListBoxWindow_FontChanged); + } + + void GListBoxWindow_FontChanged(object sender, EventArgs e) + { + this.GListBox.ItemHeight = 2 + (int)LSLEditor.Helpers.Measure.MeasureDisplayString(this.GListBox, "M", this.Font).Height; + } + + public void KeyDownHandler(KeyEventArgs e) + { + if (!this.Visible) + return; + + if (e.KeyCode == Keys.Enter) + { + // cancel richttext enter if listbox shows + e.Handled = true; + } + if (e.KeyCode == Keys.Down) + { + this.gListBox1.SelectedIndex = Math.Min(this.gListBox1.Items.Count - 1, this.gListBox1.SelectedIndex + 1); + e.Handled = true; + } + + if (e.KeyCode == Keys.Up) + { + this.gListBox1.SelectedIndex = Math.Max(0, this.gListBox1.SelectedIndex - 1); + e.Handled = true; + } + + if (e.KeyCode == Keys.PageUp) + { + this.gListBox1.SelectedIndex = Math.Max(0,this.gListBox1.SelectedIndex - 10); + e.Handled = true; + } + + if (e.KeyCode == Keys.PageDown) + { + this.gListBox1.SelectedIndex = Math.Min(this.gListBox1.Items.Count - 1, this.gListBox1.SelectedIndex + 10); + e.Handled = true; + } + } + + public void SetPosition(Rectangle rect,RichTextBox RichTextBox) + { + //Rectangle rect = Screen.PrimaryScreen.WorkingArea; + Point p = RichTextBox.GetPositionFromCharIndex(RichTextBox.SelectionStart); + + p = new Point(p.X - 20, p.Y + this.gListBox1.ItemHeight); // ItemHeight = exact line height + + Rectangle client = RichTextBox.ClientRectangle; + if (p.X < (client.Left-20) || p.Y < client.Top || p.X > client.Width || p.Y > client.Height) + { + this.Visible = false; + return; + } + + Point screen = RichTextBox.PointToScreen(p); + + //if ((screen.Y + this.Height) > rect.Height) + // screen = RichTextBox.PointToScreen(new Point(p.X - 20 + this.XOffset, p.Y - this.Height)); + + if (screen.Y > rect.Bottom) + { + this.Visible = false; + return; + //screen.Y = rect.Bottom; + } + + if (screen.X > rect.Right) + { + this.Visible = false; + return; + //screen.X = rect.Right; + } + + if (screen.X < rect.Left) + { + this.Visible = false; + return; + //screen.X = rect.Left; + } + + if ((screen.Y) < rect.Top) + { + this.Visible = false; + return; + //screen.Y = rect.Top; + } + + this.Location = screen; + } + + private void gListBox1_Resize(object sender, EventArgs e) + { + this.Size = this.gListBox1.Size; + } + + } +} \ No newline at end of file diff --git a/Editor/GListBoxWindow.resx b/Editor/GListBoxWindow.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Editor/GListBoxWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Editor/KeyWords.cs b/Editor/KeyWords.cs new file mode 100644 index 0000000..8280440 --- /dev/null +++ b/Editor/KeyWords.cs @@ -0,0 +1,410 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Drawing; +using System.Xml; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + public enum KeyWordTypeEnum : int + { + Unknown = 0, + Functions = 1, + Events = 2, + Constants = 3, + Class = 4, + Vars = 5, + Properties = 6 + } + + public struct KeyWordInfo + { + public KeyWordTypeEnum type; + public string name; + public Color color; + public KeyWordInfo(KeyWordTypeEnum type, string name, Color color) + { + this.type = type; + this.name = name; + this.color = color; + } + } + + class KeyWords + { + private ArrayList m_RegexColorList; + private Regex m_regexSplitter; + private Hashtable m_KeyWordColorList; + private XmlDocument xml; + + private void MakeSplitter(string strRegexSplitter) + { + m_regexSplitter = new Regex( + @"\s*(" + strRegexSplitter + @"|\w+|.)", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + } + + private struct RegexColor + { + public Regex regex; + public Color color; + public RegexColor(string strRegex, Color color) + { + this.regex = new Regex(strRegex, + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + this.color = color; + } + } + + public KeyWords(string ColorScheme, XmlDocument xml) + { + this.m_RegexColorList = new ArrayList(); + this.m_KeyWordColorList = new Hashtable(); + this.xml = xml; + + string strRegexSplitter = ""; + + foreach (XmlNode words in xml.SelectNodes("//Words")) + { + Color color = Color.FromArgb(int.Parse(words.Attributes[ColorScheme].InnerText.Replace("#", ""), System.Globalization.NumberStyles.HexNumber)); + KeyWordTypeEnum type = KeyWordTypeEnum.Unknown; + if (words.Attributes["icon"] != null) + { + switch (words.Attributes["icon"].InnerText) + { + case "Functions": + type = KeyWordTypeEnum.Functions; + break; + case "Events": + type = KeyWordTypeEnum.Events; + break; + case "Constants": + type = KeyWordTypeEnum.Constants; + break; + case "Class": + type = KeyWordTypeEnum.Class; + break; + case "Vars": + type = KeyWordTypeEnum.Vars; + break; + case "Enum": + if (!Properties.Settings.Default.CodeCompletionAnimation) + continue; + type = KeyWordTypeEnum.Properties; + break; + default: + type = KeyWordTypeEnum.Unknown; + break; + } + } + foreach (XmlNode word in words.SelectNodes(".//Word")) + { + if (word.Attributes["name"].InnerText == "regex") + { + string strRegex = word.InnerText; + AddRegex(strRegex, color); + if (strRegexSplitter != "") + strRegexSplitter += "|"; + strRegexSplitter += strRegex; + } + else + { + AddKeyword(type, word.Attributes["name"].InnerText, color); + } + } + } + MakeSplitter(strRegexSplitter); + } + + private void AddRegex(string strRegex, Color color) + { + m_RegexColorList.Add(new RegexColor(strRegex, color)); + } + + private void AddKeyword(KeyWordTypeEnum type, string name, Color color) + { + m_KeyWordColorList.Add(name, new KeyWordInfo(type, name, color)); + } + + public Color GetColorFromRegex(string strKeyWord) + { + // specials + Color color = Color.Black; + foreach (RegexColor regexColor in m_RegexColorList) + { + Match mm = regexColor.regex.Match(strKeyWord); + if (mm.Success) + { + // must be exact match + if (mm.Index != 0) + continue; + color = regexColor.color; + break; + } + } + return color; + } + + public KeyWordInfo GetKeyWordInfo(string strWord) + { + return (KeyWordInfo)this.m_KeyWordColorList[strWord]; + } + + public bool ContainsKeyWord(string strWord) + { + return m_KeyWordColorList.ContainsKey(strWord); + } + + public Color GetColorFromKeyWordList(string strKeyWord) + { + if (ContainsKeyWord(strKeyWord)) + return GetKeyWordInfo(strKeyWord).color; + else + return Color.Black; + } + + public MatchCollection Matches(string strLine) + { + return m_regexSplitter.Matches(strLine); + } + + public List KeyWordSearch(string strKeyWord, bool IsRegularExpression) + { + List list = new List(); + string strLowerCaseKeyWord = strKeyWord.ToLower(); + int intLen = strLowerCaseKeyWord.Length; + foreach (string strKey in m_KeyWordColorList.Keys) + { + if (IsRegularExpression) + { + if(new Regex("^"+strKeyWord+"$").Match(strKey).Success) + list.Add(GetKeyWordInfo(strKey)); + } + else + { + if (strKey.Length < intLen) + continue; + if (strKey.Substring(0, intLen).ToLower() == strLowerCaseKeyWord) + list.Add(GetKeyWordInfo(strKey)); + } + } + return list; + } + + public string GetDescription(string strKeyWord) + { + if(ContainsKeyWord(strKeyWord)) + { + XmlNode xmlNode = xml.SelectSingleNode("//Word[@name='"+strKeyWord+"']"); + if(xmlNode!=null) + { + if (xmlNode.ChildNodes.Count == 0) + return ""; + string strText = xmlNode.InnerXml; + if (strText == "") + return strKeyWord; + else + { + int intArgument = strText.IndexOf(" 0) + strText = strText.Substring(0, intArgument); + StringBuilder sb = new StringBuilder(); + StringReader sr = new StringReader(strText); + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + sb.AppendLine(strLine.Trim()); + } + return sb.ToString(); + } + } + } + return ""; + } + + private string MakeArgumentBold(string strText, int intArgument) + { + Regex regex = new Regex( +@"(?[^(]* \( ) + (?: + (? [^,\)]*) (?" + + @"[\,\)])+ + )* +(?.*) +", + RegexOptions.IgnorePatternWhitespace); + Match match = regex.Match(strText); + StringBuilder sb = new StringBuilder(); + sb.Append(match.Groups["prefix"].Value); + for (int intI = 0; intI < match.Groups["argument"].Captures.Count; intI++) + { + if (intI == intArgument) + { + sb.Append(@""); + sb.Append(match.Groups["argument"].Captures[intI].Value); + sb.Append(""); + } + else + { + sb.Append(match.Groups["argument"].Captures[intI].Value); + } + sb.Append(match.Groups["seperator"].Captures[intI].Value); + } + sb.Append(match.Groups["postfix"].Value); + sb.Append('\n'); + return sb.ToString(); + } + + private string GetFirstLineOfKeyWord(string strWord, out XmlNode xmlNode) + { + xmlNode = null; + + if (!ContainsKeyWord(strWord)) + return ""; + + xmlNode = xml.SelectSingleNode("//Word[@name='" + strWord + "']"); + if (xmlNode == null) + return ""; + + if (xmlNode.ChildNodes.Count == 0) + return ""; + + string strText = xmlNode.ChildNodes[0].InnerText; + if (strText == "") + return ""; + + strText = strText.TrimStart(); + int intI = strText.IndexOf("\r"); + if (intI > 0) + strText = strText.Substring(0, intI); + + return strText; + } + + public int GetNumberOfArguments(string strWord) + { + XmlNode xmlNode; + string strFirstLine = GetFirstLineOfKeyWord(strWord, out xmlNode); + + if (strFirstLine == "") + return -1; + + Regex regex = new Regex( +@"(?[^(]* \( ) + (?: + (? [^,\)]*) (?" + + @"[\,\)])+ + )* +(?.*) +", + RegexOptions.IgnorePatternWhitespace); + Match match = regex.Match(strFirstLine); + + // nr not 1, return nr + int intNr = match.Groups["argument"].Captures.Count; + if(intNr != 1) + return intNr; + + // nr = 1 can be void, returns also 0 + if(match.Groups["argument"].Captures[0].Value == "void") + return 0; + + // not void, return 1 + return 1; + } + + public string GetFunctionAndHiglightArgument(string strWord, int intArgument, out string strWild) + { + XmlNode xmlNode; + string strFirstLine = GetFirstLineOfKeyWord(strWord,out xmlNode); + + strWild = ""; + + if (strFirstLine == "") + return ""; + + string strRichText = MakeArgumentBold(strFirstLine, intArgument); + + if (xmlNode == null) + return strRichText; + + XmlNodeList nodeList = xmlNode.SelectNodes("./Argument"); + if (intArgument < nodeList.Count) + { + XmlNode xmlNodeArgument = nodeList[intArgument]; + if(xmlNodeArgument.Attributes["wild"]!=null) + strWild = xmlNodeArgument.Attributes["wild"].Value; + string strName = xmlNodeArgument.Attributes["name"].Value; + string strDescription = "\n" + @"" + strName + ":"; + strRichText += strDescription + " " + xmlNodeArgument.InnerText + "\n"; + } + return strRichText; + } + + public string GetEvent(string strEventName) + { + string strReturn = strEventName + "("; + + XmlNode xmlNode; + string strFirstLine = GetFirstLineOfKeyWord(strEventName, out xmlNode); + + if (strFirstLine == "") + return strReturn; + + return strFirstLine.Replace(";", "").Replace("void", ""); + } + + } +} diff --git a/Editor/MsXsltContext.cs b/Editor/MsXsltContext.cs new file mode 100644 index 0000000..e28a6dc --- /dev/null +++ b/Editor/MsXsltContext.cs @@ -0,0 +1,43 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ diff --git a/Editor/Numbered.Designer.cs b/Editor/Numbered.Designer.cs new file mode 100644 index 0000000..a4bb174 --- /dev/null +++ b/Editor/Numbered.Designer.cs @@ -0,0 +1,37 @@ +namespace LSLEditor.Editor +{ + partial class Numbered + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/Editor/Numbered.cs b/Editor/Numbered.cs new file mode 100644 index 0000000..0a4f120 --- /dev/null +++ b/Editor/Numbered.cs @@ -0,0 +1,142 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace LSLEditor.Editor +{ + public partial class Numbered : UserControl + { + public RichTextBox richTextBox1; + private Brush brush; + public float LineHeight; + + public Numbered() + { + InitializeComponent(); + + this.SetStyle( + ControlStyles.DoubleBuffer | + ControlStyles.UserPaint | + ControlStyles.AllPaintingInWmPaint, + true); + + this.UpdateStyles(); + + brush = new SolidBrush(this.ForeColor); + + LineHeight = 0.0F; + } + + private void updateNumberLabel(PaintEventArgs e) + { + if (this.brush == null) + return; + + if (this.ClientSize.Width <= 0 || this.ClientSize.Height <= 0) + return; + + int delta = 0; + int firstLine = 0; + int lastLine = 10; + Font font = this.Font; + + if (this.richTextBox1 == null) + { + LineHeight = 16.0F; + } + else + { + //we get index of first visible char and number of first visible line + Point pos = new Point(0, 0); + + int firstIndex = this.richTextBox1.GetCharIndexFromPosition(pos); + firstLine = this.richTextBox1.GetLineFromCharIndex(firstIndex); + + font = this.richTextBox1.Font; + + if (LineHeight < 0.01) + { + if (this.richTextBox1.Lines.Length > 1) + { + Point pos1 = this.richTextBox1.GetPositionFromCharIndex(this.richTextBox1.GetFirstCharIndexFromLine(1)); + LineHeight = pos1.Y; + } + } + + lastLine = Math.Min(this.richTextBox1.Lines.Length, 2 + firstLine + (int)(this.richTextBox1.ClientRectangle.Height / LineHeight)); + + int intCharIndex = this.richTextBox1.GetCharIndexFromPosition(Point.Empty); + delta = 1 + this.richTextBox1.GetPositionFromCharIndex(intCharIndex).Y % font.Height; + } + + // here we go + lastLine = Math.Max(lastLine, 1); + + Graphics g = e.Graphics; + g.Clear(this.BackColor); + if(this.richTextBox1==null) + g.SetClip(new Rectangle(0, 0, this.Width, this.Height)); + else + g.SetClip(new Rectangle(0, 0, this.Width, this.richTextBox1.ClientRectangle.Height)); + + for (int i = firstLine; i < lastLine; i++) + g.DrawString(string.Format("{0:0###}", i + 1), font, brush, + new PointF(0F, delta + (i - firstLine) * LineHeight) ); + //g.DrawLine(new Pen(brush), backBuffer.Width - 1, 0, backBuffer.Width - 1, backBuffer.Height); + } + + protected override void OnPaint(PaintEventArgs e) + { + updateNumberLabel(e); + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + //base.OnPaintBackground(e); + } + + } +} diff --git a/Editor/NumberedTextBoxUC.cs b/Editor/NumberedTextBoxUC.cs new file mode 100644 index 0000000..0cbebf7 --- /dev/null +++ b/Editor/NumberedTextBoxUC.cs @@ -0,0 +1,83 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace NumberedTextBox +{ + public partial class NumberedTextBoxUC : UserControl + { + public NumberedTextBoxUC() + { + InitializeComponent(); + + this.numbered1.richTextBox1 = this.syntaxRichTextBox1; + this.syntaxRichTextBox1.OnPaintNumbers += new EventHandler(syntaxRichTextBox1_OnPaintNumbers); + this.FontChanged += new EventHandler(NumberedTextBoxUC_FontChanged); + } + + void NumberedTextBoxUC_FontChanged(object sender, EventArgs e) + { + this.numbered1.LineHeight = 0.0F; // reset!! + RectangleF rect = LSLEditor.Helpers.Measure.MeasureDisplayString(this.syntaxRichTextBox1, "M", this.Font); + this.splitContainer1.SplitterDistance = (int)(4 * rect.Width + 5.0); + } + + void syntaxRichTextBox1_OnPaintNumbers(object sender, EventArgs e) + { + this.numbered1.Invalidate(); + } + + public LSLEditor.SyntaxRichTextBox TextBox + { + get + { + return this.syntaxRichTextBox1; + } + } + + } +} diff --git a/Editor/NumberedTextBoxUC.designer.cs b/Editor/NumberedTextBoxUC.designer.cs new file mode 100644 index 0000000..c5e7838 --- /dev/null +++ b/Editor/NumberedTextBoxUC.designer.cs @@ -0,0 +1,106 @@ +namespace NumberedTextBox +{ + partial class NumberedTextBoxUC + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.numbered1 = new LSLEditor.Editor.Numbered(); + this.syntaxRichTextBox1 = new LSLEditor.SyntaxRichTextBox(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = true; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.ActiveBorder; + this.splitContainer1.Panel1.Controls.Add(this.numbered1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.syntaxRichTextBox1); + this.splitContainer1.Size = new System.Drawing.Size(403, 267); + this.splitContainer1.SplitterDistance = 41; + this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.TabIndex = 2; + this.splitContainer1.Text = "splitContainer1"; + // + // numbered1 + // + this.numbered1.BackColor = System.Drawing.SystemColors.ButtonFace; + this.numbered1.Dock = System.Windows.Forms.DockStyle.Fill; + this.numbered1.Location = new System.Drawing.Point(0, 0); + this.numbered1.Name = "numbered1"; + this.numbered1.Size = new System.Drawing.Size(41, 267); + this.numbered1.TabIndex = 0; + // + // syntaxRichTextBox1 + // + this.syntaxRichTextBox1.AcceptsTab = true; + this.syntaxRichTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.syntaxRichTextBox1.DetectUrls = false; + this.syntaxRichTextBox1.Dirty = true; + this.syntaxRichTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.syntaxRichTextBox1.Location = new System.Drawing.Point(0, 0); + this.syntaxRichTextBox1.Name = "syntaxRichTextBox1"; + this.syntaxRichTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; + this.syntaxRichTextBox1.Size = new System.Drawing.Size(361, 267); + this.syntaxRichTextBox1.TabIndex = 0; + this.syntaxRichTextBox1.Text = ""; + this.syntaxRichTextBox1.ToolTipping = false; + this.syntaxRichTextBox1.WordWrap = false; + // + // NumberedTextBoxUC + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "NumberedTextBoxUC"; + this.Size = new System.Drawing.Size(403, 267); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private LSLEditor.Editor.Numbered numbered1; + private LSLEditor.SyntaxRichTextBox syntaxRichTextBox1; + } +} diff --git a/Editor/NumberedTextBoxUC.resx b/Editor/NumberedTextBoxUC.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Editor/NumberedTextBoxUC.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Editor/RichLabel.Designer.cs b/Editor/RichLabel.Designer.cs new file mode 100644 index 0000000..4dc493b --- /dev/null +++ b/Editor/RichLabel.Designer.cs @@ -0,0 +1,42 @@ +namespace LSLEditor +{ + partial class RichLabel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // RichLabel + // + this.Name = "RichLabel"; + this.ResumeLayout(false); + + } + + #endregion + } +} diff --git a/Editor/RichLabel.cs b/Editor/RichLabel.cs new file mode 100644 index 0000000..4e0b15a --- /dev/null +++ b/Editor/RichLabel.cs @@ -0,0 +1,272 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.Globalization; +using System.Windows.Forms; +using System.ComponentModel; +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + public partial class RichLabel : UserControl + { + private Regex m_regex; + + public override string Text + { + get + { + return base.Text; + } + set + { + base.Text = value; + this.Invalidate(); + } + } + + public RichLabel() + { + InitializeComponent(); + + this.SetStyle( + ControlStyles.DoubleBuffer | + ControlStyles.UserPaint | + ControlStyles.AllPaintingInWmPaint, + true); + + this.UpdateStyles(); + + this.Text = "richLabel1"; + this.BackColor = Color.LightGoldenrodYellow; + + this.m_regex = new Regex(@" +(?: + <(?: + (?[^>/\s]*) + (? [\s]+ (?[^=]*) = ""(?[^""]*)"")* + )> +| + <[/]* (?[^>\s/]*) [/]*> +| + (?[^<]*) +) +", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled); + + //this.m_regex = new Regex(@"(?\w*)"); + } + + private void SafePaint(PaintEventArgs e) + { + try + { + Graphics g = e.Graphics; + + e.Graphics.Clear(this.BackColor); + + Stack fontFace = new Stack(); + Stack fontSize = new Stack(); + Stack fontColor = new Stack(); + Stack fontStyle = new Stack(); + + fontFace.Push(this.Font.Name); + fontSize.Push(this.Font.Size); + fontStyle.Push(this.Font.Style); + fontColor.Push(this.ForeColor); + + float fltLineHeight = 0; + float fltLineHeightMax = 0; + float fltWidth = 0; + float fltHeight = 0; + + PointF point = new PointF(this.Margin.Left, this.Margin.Top); + + string strLines = this.Text.Replace("\r", "").Replace("\n", "
"); + foreach (Match m in this.m_regex.Matches(strLines)) + { + string strText = m.Groups["text"].Value.Replace("<", "<").Replace(">", ">"); + + switch (m.Groups["startTag"].Value) + { + case "font": + for (int intI = 0; intI < m.Groups["attName"].Captures.Count; intI++) + { + string strValue = m.Groups["attValue"].Captures[intI].Value; + switch (m.Groups["attName"].Captures[intI].Value) + { + case "color": + if (strValue.StartsWith("#")) + { + int intColor = 255; + int.TryParse(strValue.Substring(1), NumberStyles.HexNumber, null, out intColor); + fontColor.Push(Color.FromArgb(255, Color.FromArgb(intColor))); + } + else + { + fontColor.Push(Color.FromName(strValue)); + } + break; + case "face": + fontFace.Push(strValue); + break; + case "size": + float fltSize = 10.0F; + float.TryParse(strValue, out fltSize); + fontSize.Push(fltSize); + break; + default: + break; + } + } + break; + case "b": + fontStyle.Push(fontStyle.Peek() | FontStyle.Bold); + break; + case "u": + fontStyle.Push(fontStyle.Peek() | FontStyle.Underline); + break; + case "i": + fontStyle.Push(fontStyle.Peek() | FontStyle.Italic); + break; + case "s": + fontStyle.Push(fontStyle.Peek() | FontStyle.Strikeout); + break; + case "br": + point = new PointF(this.Margin.Left, point.Y + fltLineHeightMax); + fltLineHeightMax = fltLineHeight; + break; + default: + break; + } + switch (m.Groups["endTag"].Value) + { + case "font": + if (fontColor.Count > 1) + fontColor.Pop(); + if (fontSize.Count > 1) + fontSize.Pop(); + if (fontFace.Count > 1) + fontFace.Pop(); + break; + case "b": + case "u": + case "i": + case "s": + if (fontStyle.Count > 1) + fontStyle.Pop(); + break; + case "br": + point = new PointF(this.Margin.Left, point.Y + fltLineHeightMax); + fltLineHeightMax = fltLineHeight; + break; + default: + break; + } + + if (strText.Length == 0) + continue; + + Font fontTmp = new Font(fontFace.Peek(), fontSize.Peek(), fontStyle.Peek()); + Size rect = MeasureTextIncludingSpaces(g, strText, fontTmp); // TextRenderer.MeasureText(strText, fontTmp); + PointF pointToDraw = new PointF(point.X, point.Y); + + point = new PointF(point.X + rect.Width, point.Y); + fltWidth = Math.Max(fltWidth, point.X); + fltHeight = Math.Max(fltHeight, point.Y + rect.Height); + fltLineHeight = rect.Height; + fltLineHeightMax = Math.Max(fltLineHeightMax, fltLineHeight); + + Brush brush = new SolidBrush(fontColor.Peek()); + g.DrawString(strText, fontTmp, brush, pointToDraw); + brush.Dispose(); + fontTmp.Dispose(); + } + int intWidth = (int)fltWidth + (Margin.Right <<1); + int intHeight = (int)fltHeight + Margin.Bottom; + this.Size = new Size(intWidth, intHeight); + + //System.Drawing.Drawing2D.GraphicsPath path = Editor.RoundCorners.RoundedRectangle(new Rectangle(this.Location, this.Size), 10); + //g.DrawPath(new Pen(Color.Black,2F), path); + //this.Region = Editor.RoundCorners.RoundedRegion(this.Size, 4); + } + catch + { + } + } + + public static SizeF MeasureTextVisible(Graphics graphics, string text, Font font) + { + StringFormat format = new StringFormat(); + RectangleF rect = new RectangleF(0, 0, 4096, 1000); + CharacterRange[] ranges = { new CharacterRange(0, text.Length) }; + format.SetMeasurableCharacterRanges(ranges); + Region[] regions = graphics.MeasureCharacterRanges(text, font, rect, format); + rect = regions[0].GetBounds(graphics); + return new SizeF(rect.Width, rect.Height); + } + + public static Size MeasureTextIncludingSpaces(Graphics graphics, string text, Font font) + { + SizeF sizePostfix = MeasureTextVisible(graphics, "|", font); + SizeF size = MeasureTextVisible(graphics, text + "|", font); + return new Size((int)(size.Width - sizePostfix.Width + 1), (int)(size.Height + 1)); + } + + + protected override void OnPaint(PaintEventArgs e) + { + SafePaint(e); + } + + protected override void OnPaintBackground(PaintEventArgs e) + { + // base.OnPaintBackground(e); + } + + } +} diff --git a/Editor/RichLabel.resx b/Editor/RichLabel.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Editor/RichLabel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Editor/RoundCorners.cs b/Editor/RoundCorners.cs new file mode 100644 index 0000000..93b59e7 --- /dev/null +++ b/Editor/RoundCorners.cs @@ -0,0 +1,189 @@ +using System; + +//Author: Arman Ghazanchyan +//Created date: 01/27/2007 +//Last updated: 01/28/2007 +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace LSLEditor.Editor +{ + class RoundCorners + { + /// + /// Rounds a rectangle corners' and returns the graphics path. + /// + /// A rectangle whose corners should be rounded. + /// The radius of the rounded corners. This value should be + /// bigger then 0 and less or equal to the (a half of the smallest value + /// of the rectangle’s width and height). + /// A value that specifies if the top-left + /// corner of the rectangle should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the top-right + /// corner of the rectangle should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the bottom-right + /// corner of the rectangle should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the bottom-left + /// corner of the rectangle should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + public static GraphicsPath RoundedRectangle(Rectangle rec, int r) + { + return RoundedRectangle(rec,r,false,false,false,false); + } + + public static GraphicsPath RoundedRectangle(Rectangle rec, int r, + bool exclude_TopLeft, + bool exclude_TopRight, + bool exclude_BottomRight, + bool exclude_BottomLeft) + { + GraphicsPath path = new GraphicsPath(); + int s = r * 2; + //If 's' is less than or equal to zero, + //then return a simple rectangle. + if (s <= 0) + { + path.StartFigure(); + path.AddLine(rec.Right, rec.Y, rec.Right, rec.Y); + path.AddLine(rec.Right, rec.Bottom, rec.Right, rec.Bottom); + path.AddLine(rec.X, rec.Bottom, rec.X, rec.Bottom); + path.AddLine(rec.X, rec.Y, rec.X, rec.Y); + path.CloseAllFigures(); + return path; + } + //If 's' is bigger than the smallest value of the size, + //then assign the value to 's'. + if (rec.Height <= rec.Width) + { + if (s > rec.Height) + s = rec.Height; + } + else + { + if (s > rec.Width) + s = rec.Width; + } + + path.StartFigure(); + //Set top-right corner. + if (!exclude_TopRight) + path.AddArc(rec.Right - s, rec.Y, s, s, 270, 90); + else + path.AddLine(rec.Right, rec.Y, rec.Right, rec.Y); + + //Set bottom-right corner. + if (!exclude_BottomRight) + path.AddArc(rec.Right - s, rec.Bottom - s, s, s, 0, 90); + else + path.AddLine(rec.Right, rec.Bottom, rec.Right, rec.Bottom); + + //Set bottom-left corner. + if (!exclude_BottomLeft) + path.AddArc(rec.X, rec.Bottom - s, s, s, 90, 90); + else + path.AddLine(rec.X, rec.Bottom, rec.X, rec.Bottom); + + //Set top-left corner. + if (!exclude_TopLeft) + path.AddArc(rec.X, rec.Y, s, s, 180, 90); + else + path.AddLine(rec.X, rec.Y, rec.X, rec.Y); + + path.CloseAllFigures(); + return path; + } + + /// + /// Rounds the corners of the newly created rectangle-shape region and returns the region. + /// + /// The size of the region. + /// The radius of the rounded corners. This value should be + /// bigger then 0 and less or equal to the (a half of the smallest value + /// of the region’s width and height). + /// A value that specifies if the top-left + /// corner of the region should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the top-right + /// corner of the region should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the bottom-right + /// corner of the region should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + /// A value that specifies if the bottom-left + /// corner of the region should be rounded. If the value is True + /// then the corner is not rounded otherwise it is. + public static Region RoundedRegion(Size rSize, int r) + { + return RoundedRegion(rSize, r, false, false, false, false); + } + + public static Region RoundedRegion(Size rSize, int r, + bool exclude_TopLeft, + bool exclude_TopRight, + bool exclude_BottomRight, + bool exclude_BottomLeft) + { + int s = r * 2; + GraphicsPath path = new GraphicsPath(); + //If 's' is less than or equal to zero, + //then return a simple rectangle. + if (s <= 0) + { + path.StartFigure(); + path.AddLine(rSize.Width, 0, rSize.Width, 0); + path.AddLine(rSize.Width, rSize.Height, rSize.Width, rSize.Height); + path.AddLine(0, rSize.Height, 0, rSize.Height); + path.AddLine(0, 0, 0, 0); + path.CloseAllFigures(); + return new Region(path); + } + //If 's' is bigger than the smallest value of the size, + //then assign the value to 's'. + if (rSize.Height < rSize.Width) + { + if (s > rSize.Height) + s = rSize.Height; + } + else + { + if (s > rSize.Width) + s = rSize.Width; + } + path.StartFigure(); + //Set top-right corner. + if (!exclude_TopRight) + path.AddArc(rSize.Width - s, 0, s - 1, s - 1, 270, 90); + else + path.AddLine(rSize.Width, 0, rSize.Width, 0); + //Set bottom-right corner. + if (!exclude_BottomRight) + { + path.AddLine(rSize.Width, r, rSize.Width, rSize.Height - r); + path.AddArc(rSize.Width - s, rSize.Height - s, s - 1, s - 1, 0, 90); + } + else + path.AddLine(rSize.Width, rSize.Height, rSize.Width, rSize.Height); + + //Set bottom-left corner. + if (!exclude_BottomLeft) + { + path.AddLine(rSize.Width - r, rSize.Height, r, rSize.Height); + path.AddArc(0, rSize.Height - s, s - 1, s - 1, 90, 90); + } + else + path.AddLine(0, rSize.Height, 0, rSize.Height); + + //Set top-left corner. + if (!exclude_TopLeft) + path.AddArc(0, 0, s - 1, s - 1, 180, 90); + else + path.AddLine(0, 0, 0, 0); + + path.CloseAllFigures(); + return new Region(path); + } + } +} diff --git a/Editor/SyntaxRichTextBox.cs b/Editor/SyntaxRichTextBox.cs new file mode 100644 index 0000000..75169d5 --- /dev/null +++ b/Editor/SyntaxRichTextBox.cs @@ -0,0 +1,2078 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Drawing; + +using System.Collections.Generic; +using System.Windows.Forms; +using System.ComponentModel; +using System.Drawing.Printing; +using System.Text.RegularExpressions; +using System.Runtime.InteropServices; + +namespace LSLEditor +{ + public delegate void IsDirtyHandler(object sender, EventArgs e); + + public class SyntaxRichTextBox : RichTextBox + { + private const int WM_SETREDRAW = 0x000B; + private const int WM_USER = 0x400; + private const int EM_GETEVENTMASK = (WM_USER + 59); + private const int EM_SETEVENTMASK = (WM_USER + 69); + + // Scroll position + [DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hwndLock, Int32 wMsg, Int32 wParam, ref Point pt); + + // Anti flicker + [DllImport("user32", CharSet = CharSet.Auto)] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam); + + // Tabs + [DllImport("User32", CharSet = CharSet.Auto)] + public static extern IntPtr SendMessage(IntPtr h, int msg, int wParam, int[] lParam); + + private bool m_Dirty; + + private bool blnEscape; + + private bool blnInsert; + + // for tooltipping + private bool m_blnToolTipping; + private System.Windows.Forms.Timer timer1; + private GListBoxWindow GListBoxWindow; + private TooltipWindow TooltipMouse; + private TooltipWindow TooltipKeyboard; + private TooltipWindow TooltipListBox; + + private Point OldMouseLocation; + + private int intKeyWordLength; + + // needed for flicker-free updates + private int intUpdate; + private IntPtr eventMask; + + private int intOldLines; + + // colored words + private KeyWords keyWords; + + private Helpers.CodeCompletion codeCompletion; + + // after clicking on error + private int HighLightLine; + + // bracket highlighting + private List HighLightList; + + public float CharWidth; + public int LineHeight; + + // undo + private struct UndoElement + { + public int SelectionStart; + public int SelectionLength; + public string SelectedText; + public string RedoText; + public UndoElement(int SelectionStart, string SelectedText, int SelectionLength, string RedoText) + { + this.SelectionStart = SelectionStart; + this.SelectionLength = SelectionLength; + this.SelectedText = SelectedText; + this.RedoText = RedoText; + } + } + private Stack UndoStack; + private Stack RedoStack; + + #region printing + //Convert the unit used by the .NET framework (1/100 inch) + //and the unit used by Win32 API calls (twips 1/1440 inch) + private const double anInch = 14.4; + + [StructLayout(LayoutKind.Sequential)] + private struct RECT + { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + + [StructLayout(LayoutKind.Sequential)] + private struct CHARRANGE + { + public int cpMin; //First character of range (0 for start of doc) + public int cpMax; //Last character of range (-1 for end of doc) + } + + [StructLayout(LayoutKind.Sequential)] + private struct FORMATRANGE + { + public IntPtr hdc; //Actual DC to draw on + public IntPtr hdcTarget; //Target DC for determining text formatting + public RECT rc; //Region of the DC to draw to (in twips) + public RECT rcPage; //Region of the whole DC (page size) (in twips) + public CHARRANGE chrg; //Range of text to draw (see earlier declaration) + } + + private const int EM_FORMATRANGE = WM_USER + 57; + + [DllImport("user32", CharSet = CharSet.Auto)] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); + + // Render the contents of the RichTextBox for printing + // Return the last character printed + 1 (printing start from this point for next page) + public int Print(int charFrom, int charTo, PrintPageEventArgs e) + { + //Calculate the area to render and print + RECT rectToPrint; + rectToPrint.Top = (int)(e.MarginBounds.Top * anInch); + rectToPrint.Bottom = (int)(e.MarginBounds.Bottom * anInch); + rectToPrint.Left = (int)(e.MarginBounds.Left * anInch); + rectToPrint.Right = (int)(e.MarginBounds.Right * anInch); + + //Calculate the size of the page + RECT rectPage; + rectPage.Top = (int)(e.PageBounds.Top * anInch); + rectPage.Bottom = (int)(e.PageBounds.Bottom * anInch); + rectPage.Left = (int)(e.PageBounds.Left * anInch); + rectPage.Right = (int)(e.PageBounds.Right * anInch); + + IntPtr hdc = e.Graphics.GetHdc(); + + FORMATRANGE fmtRange; + fmtRange.chrg.cpMax = charTo; //Indicate character from to character to + fmtRange.chrg.cpMin = charFrom; + fmtRange.hdc = hdc; //Use the same DC for measuring and rendering + fmtRange.hdcTarget = hdc; //Point at printer hDC + fmtRange.rc = rectToPrint; //Indicate the area on page to print + fmtRange.rcPage = rectPage; //Indicate size of page + + IntPtr wparam = new IntPtr(1); + + //Get the pointer to the FORMATRANGE structure in memory + IntPtr lparam = Marshal.AllocCoTaskMem(Marshal.SizeOf(fmtRange)); + Marshal.StructureToPtr(fmtRange, lparam, false); + + //Send the rendered data for printing + IntPtr res = SendMessage(Handle, EM_FORMATRANGE, wparam, lparam); + + //Free the block of memory allocated + Marshal.FreeCoTaskMem(lparam); + + //Release the device context handle obtained by a previous call + e.Graphics.ReleaseHdc(hdc); + + //Return last + 1 character printer + return res.ToInt32(); + } + #endregion + + public event IsDirtyHandler OnDirtyChanged; + public event EventHandler OnPaintNumbers; + + public delegate void CursorPositionChangedHandler(object sender, CursorPositionEventArgs e); + public event CursorPositionChangedHandler OnCursorPositionChanged; + public class CursorPositionEventArgs : EventArgs + { + public int Line; + public int Column; + public int Char; + public int Total; + public bool Insert; + public bool Caps; + public CursorPositionEventArgs(int intLine, int intColumn, int intChar, int intTotal, bool blnInsert, bool blnCaps) + { + this.Line = intLine; + this.Column = intColumn; + this.Char = intChar; + this.Total = intTotal; + this.Insert = blnInsert; + this.Caps = blnCaps; + } + } + + public SyntaxRichTextBox() + { + this.intUpdate = 0; + this.eventMask = IntPtr.Zero; + this.m_blnToolTipping = false; + + this.intKeyWordLength = 0; + + this.AcceptsTab = true; + this.BorderStyle = BorderStyle.None; + this.DetectUrls = false; + this.Dirty = false; + + this.ScrollBars = RichTextBoxScrollBars.ForcedBoth; + this.WordWrap = false; + + this.FontChanged += new EventHandler(SyntaxRichTextBox_FontChanged); + + this.MouseMove += new MouseEventHandler(SyntaxRichTextBox_MouseMove); + + this.VScroll += new EventHandler(SyntaxRichTextBox_Position); + this.HScroll += new EventHandler(SyntaxRichTextBox_Position); + + this.HighLightLine = -1; + this.HighLightList = new List(); + + this.UndoStack = new Stack(); + this.RedoStack = new Stack(); + + this.blnEscape = false; + + this.blnInsert = true; + + this.intOldLines = -1; + + this.CharWidth = 10; //TODO + this.LineHeight = 16; + + this.OldMouseLocation = Point.Empty; + + this.codeCompletion = new Helpers.CodeCompletion(); + + this.HideSelection = false; + + // are these of any use? + //this.DoubleBuffered = true; + //SetStyle(ControlStyles.AllPaintingInWmPaint, true); + //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + //SetStyle(ControlStyles.Opaque, true); + } + + public void Init(LSLEditorForm parent, XmlDocument xml) + { + if (parent != null) + { + this.ToolTipping = true; + this.GListBoxWindow = parent.GListBoxWindow; + this.TooltipMouse = parent.TooltipMouse; + this.TooltipKeyboard = parent.TooltipKeyboard; + this.TooltipListBox = parent.TooltipListBox; + } + + string ColorScheme = "color"; + if (this.ToolTipping) + { + if (Properties.Settings.Default.SLColorScheme) + { + ColorScheme = "sl" + ColorScheme; + } + + XmlNode BackgroundColorNode = xml.SelectSingleNode("/Conf"); + if (BackgroundColorNode != null) + { + Color bgColor = Color.FromArgb(255, Color.FromArgb(int.Parse(BackgroundColorNode.Attributes[ColorScheme].InnerText.Replace("#", ""), System.Globalization.NumberStyles.HexNumber))); + this.BackColor = bgColor; + } + } + keyWords = new KeyWords(ColorScheme, xml); + } + + private void MeasureFont() + { + Size size = TextRenderer.MeasureText("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM", this.Font); + CharWidth = (int)(size.Width / 50.0F); + LineHeight = size.Height; + } + + void SyntaxRichTextBox_FontChanged(object sender, EventArgs e) + { + this.SelectAll(); + + TabStops(); + + // recolor all + ColorLine(0, this.Text.Length); + } + + private void TabStops() + { + MeasureFont(); + + const int EM_SETTABSTOPS = 0xCB; + + int intNumberOfChars = Properties.Settings.Default.TabStops; + int[] tabs = new int[30]; // TODO + float fltTabWidth = intNumberOfChars * CharWidth; + + float totalWidth = 0.0F; + for (int intI = 0; intI < tabs.Length; intI++) + { + totalWidth += fltTabWidth; + tabs[intI] = (int)totalWidth; + } + + SendMessage(this.Handle, EM_SETTABSTOPS, 0, null); + SendMessage(this.Handle, EM_SETTABSTOPS, tabs.Length, tabs); + + this.SelectionTabs = tabs; + } + + private void PaintNumbers() + { + if (OnPaintNumbers != null) + OnPaintNumbers(null, null); + } + + protected override void OnVScroll(EventArgs e) + { + base.OnVScroll(e); + PaintNumbers(); + } + + + private Point RTBScrollPos + { + get + { + const int EM_GETSCROLLPOS = 0x0400 + 221; + Point pt = new Point(); + + SendMessage(this.Handle, EM_GETSCROLLPOS, 0, ref pt); + return pt; + } + set + { + const int EM_SETSCROLLPOS = 0x0400 + 222; + + SendMessage(this.Handle, EM_SETSCROLLPOS, 0, ref value); + } + } + + + public bool Dirty + { + get + { + return m_Dirty; + } + set + { + if (this.m_Dirty == value) + return; + this.m_Dirty = value; + + if (OnDirtyChanged == null) + return; + + OnDirtyChanged(this, new EventArgs()); + } + } + + private void SyntaxRichTextBox_Position(object sender, EventArgs e) + { + SetPosition(Screen.GetWorkingArea(this)); + } + + private void SyntaxRichTextBox_MouseMove(object sender, MouseEventArgs e) + { + if (!ToolTipping) + return; + + if (this.timer1 == null) + return; + + this.timer1.Stop(); + if (OldMouseLocation != e.Location) + { + OldMouseLocation = e.Location; + this.timer1.Start(); + } + } + + private int GetLine() + { + return 1 + this.GetLineFromCharIndex(this.SelectionStart); + } + + private int GetChar() + { + return 1 + this.SelectionStart - this.GetFirstCharIndexOfCurrentLine(); + } + + private int GetColumn() + { + Point p1 = this.GetPositionFromCharIndex(this.GetFirstCharIndexOfCurrentLine()); + Point p2 = this.GetPositionFromCharIndex(this.SelectionStart); + int intColumn = (int)((p2.X - p1.X) / this.CharWidth); + return 1+ intColumn; + } + + private int GetTotal() + { + return this.Text.Length; + } + + public void Goto(int Line, int Char) + { + BeginUpdate(); + LineDownlighting(); + + try + { + int intLine = Line - 1; + if (intLine < 0) + intLine = 0; + if (intLine >= this.Lines.Length) + intLine = this.Lines.Length - 1; + + if (intLine >= 0 && intLine < this.Lines.Length) + { + int intLength = this.Lines[intLine].Length; + int intStart = GetFirstCharIndexFromLine(intLine); + int intIndex = intStart + Char - 1; + HighLightLine = intLine; + this.SelectionStart = intStart; + this.SelectionLength = intLength; + this.SelectionBackColor = Color.LightBlue; + this.SelectionLength = 0; + this.SelectionStart = intIndex; + } + } + catch + { + } + + EndUpdate(); + this.Focus(); + } + + protected override void OnSelectionChanged(EventArgs e) + { + base.OnSelectionChanged(e); + if (!IsUpdating) + CursorPositionChanged(); // show cursor position + } + + private bool IsUpdating + { + get + { + return (intUpdate > 0); + } + } + + Point backupScrollPoint; + private void BeginUpdate() + { + ++intUpdate; + if (intUpdate > 1) // once is enough + return; + + backupScrollPoint = this.RTBScrollPos; + // Disable redrawing + SendMessage(this.Handle, WM_SETREDRAW, 0, IntPtr.Zero); + + // Disable generating events + eventMask = SendMessage(this.Handle, EM_GETEVENTMASK, 0, IntPtr.Zero); + } + + private void EndUpdate() + { + intUpdate = Math.Max(0, intUpdate - 1); + + if (intUpdate > 0) // only the last one + return; + + // Enable events + SendMessage(this.Handle, EM_SETEVENTMASK, 0, eventMask); + + // Enable redrawing + SendMessage(this.Handle, WM_SETREDRAW, 1, IntPtr.Zero); + + // also draw when linenumbers are shifted + if (intOldLines != this.Lines.Length || backupScrollPoint != this.RTBScrollPos) + { + intOldLines = this.Lines.Length; + PaintNumbers(); + } + Invalidate(); + } + + private bool IsAlpha(char chrC) + { + return (char.IsLetterOrDigit(chrC) || chrC == '_'); + } + + // used for F1 key, help and tooltipping, use Mouse of begin-selection + public string GetCurrentKeyWord(bool blnUserMousePosition, out Point PositionFirstCharacter) + { + PositionFirstCharacter = Point.Empty; + + int intIndex = this.SelectionStart; + if (blnUserMousePosition) + { + Point mp = this.PointToClient(Control.MousePosition); + intIndex = this.GetCharIndexFromPosition(mp); + + // check if mouse is in region of index + Point mpControle = this.GetPositionFromCharIndex(intIndex); + if (Math.Abs(mp.X - mpControle.X) > 5 || Math.Abs(mp.Y - mpControle.Y) > this.LineHeight) + return ""; + } + + int intLineNr = this.GetLineFromCharIndex(intIndex); + int intFirstChar = this.GetFirstCharIndexFromLine(intLineNr); + int intColumn = intIndex - intFirstChar; + + string strLine = this.Lines[intLineNr]; + + int intStart = intColumn; + while ((intStart > 0) && (IsAlpha(strLine[intStart - 1]))) + intStart--; + + // 22 jun 2007 + PositionFirstCharacter = this.GetPositionFromCharIndex(intFirstChar + intStart + 2); + + int intEnd = intColumn; + while ((intEnd < strLine.Length) && (IsAlpha(strLine[intEnd]))) + intEnd++; + + // Calculate the length of the keyword. + int intLength = intEnd - intStart; + + // return the keyword + return strLine.Substring(intStart, intLength); + } + + private string GetCurrentFunction(out int Argument, out bool DoWild) + { + DoWild = false; + Argument = 0; + int intIndex = this.SelectionStart; + int intLineNumber = this.GetLineFromCharIndex(intIndex); + int intStartChar = this.GetFirstCharIndexFromLine(intLineNumber); + + int intColumn = intIndex - intStartChar; + + string strLine = this.Lines[intLineNumber]; + + // Find the end of the current function + int intEnd = intColumn - 1; + while (intEnd > 0 && + strLine[intEnd] != '(' && + strLine[intEnd] != ')' && + strLine[intEnd] != '\n') + { + if (strLine[intEnd] == ',') + { + Argument++; + if (Argument == 1) + DoWild = (intColumn - intEnd) == 1; + } + intEnd--; + } + if (intEnd <= 0) + return ""; + + if (strLine[intEnd] != '(') + return ""; + + if (Argument == 0) + DoWild = (intColumn - intEnd) == 1; + + intEnd--; + + // Find the begin of the current function. + int intStart = intEnd; + while ((intStart > 0) && (IsAlpha(strLine[intStart]))) + intStart--; + + // Calculate the length of the function. + int intLength = intEnd - intStart; + + // return the Function name + return strLine.Substring(intStart + 1, intLength); + } + + private string GetNewWhiteSpace(int intOffset) + { + int intIndex = this.GetLineFromCharIndex(this.SelectionStart); + return AutoFormatter.GetNewWhiteSpace(this.Lines, intIndex + intOffset); + } + + private void AutoFormatFromLineToLine(int intLineStart, int intLineEnd) + { + BeginUpdate(); + int intStart = this.GetFirstCharIndexFromLine(intLineStart); + int intLength = this.GetFirstCharIndexFromLine(intLineEnd) + + this.Lines[intLineEnd].Length + 1 - intStart; + this.SelectionStart = intStart; + this.SelectionLength = intLength; + AutoFormat(true); + EndUpdate(); + } + + private void ProcessEnter() + { + BeginUpdate(); + this.ColoredText = "\n"; + if (ToolTipping) + { + if (Properties.Settings.Default.Indent) + { + if (Properties.Settings.Default.IndentFullAuto) + { + int intLine = this.GetLineFromCharIndex(this.SelectionStart); + AutoFormatFromLineToLine(intLine - 1, intLine - 1); + this.ColoredText = GetNewWhiteSpace(-1); + } + else if (Properties.Settings.Default.IndentCursorPlacement) + { + this.ColoredText = GetNewWhiteSpace(-1); + } + } + } + EndUpdate(); + } + + private void SmartIndenting() + { + int intFirstLine, intC; + int intLastLine = this.GetLineFromCharIndex(this.SelectionStart); + int intColumn = this.SelectionStart - this.GetFirstCharIndexFromLine(intLastLine); + + intColumn--; // because we are at position '}' + + if (MatchingBracket(intLastLine, intColumn, '}', '{', -1, out intFirstLine, out intC)) + { + if ((intLastLine - intFirstLine) >= 1) + AutoFormatFromLineToLine(intFirstLine + 1, intLastLine); + } + } + + private void ProcessBraces(char keyChar) + { + BeginUpdate(); + int intStart = this.SelectionStart; + + this.ColoredText = keyChar.ToString(); + + if (Properties.Settings.Default.Indent) + { + int intLength = this.Text.Length; + + if (Properties.Settings.Default.IndentFullAuto) + { + if (keyChar == '}') + { + SmartIndenting(); + } + else + { + int intCurrentLine = this.GetLineFromCharIndex(this.SelectionStart); + AutoFormatFromLineToLine(intCurrentLine, intCurrentLine); + } + } + + int intDelta = 1 + this.Text.Length - intLength; + + this.SelectionStart = intStart + intDelta; + + BracketHighlichting(); + } + + EndUpdate(); + } + + public void Delete() + { + BeginUpdate(); + if (this.SelectionLength == 0) + this.SelectionLength = 1; + this.ColoredText = ""; + EndUpdate(); + OnTextChanged(null); + } + + public new void Cut() + { + BeginUpdate(); + this.Copy(); + this.ColoredText = ""; + EndUpdate(); + OnTextChanged(null); + } + + + private void SaveUndo(UndoElement el) + { + if (RedoStack.Count > 0) + RedoStack.Clear(); + UndoStack.Push(el); + } + + public new void Redo() + { + if (RedoStack.Count == 0) + return; + + MakeAllInvis(); + + BeginUpdate(); + + this.Dirty = true; + + UndoElement el = RedoStack.Pop(); + + this.SelectionStart = el.SelectionStart; + this.SelectionLength = el.SelectedText.Length; + this.SelectedText = el.RedoText; + + el.RedoText = null; // dont need it anymore + UndoStack.Push(el); + + int intStartLine = this.GetLineFromCharIndex(el.SelectionStart); + int intStart = this.GetFirstCharIndexFromLine(intStartLine); + + int intStopLine = this.GetLineFromCharIndex(el.SelectionStart + el.SelectedText.Length); + if (intStopLine < this.Lines.Length) + { + int intLengthStopLine = this.Lines[intStopLine].Length; + int intStop = this.GetFirstCharIndexFromLine(intStopLine) + intLengthStopLine; + + ColorLine(intStart, intStop - intStart); + } + + EndUpdate(); + this.Focus(); + } + + public new void Undo() + { + if (UndoStack.Count == 0) + return; + + MakeAllInvis(); + + BeginUpdate(); + + UndoElement el = UndoStack.Pop(); + + this.Dirty = (UndoStack.Count != 0); + + this.SelectionStart = el.SelectionStart; + this.SelectionLength = el.SelectionLength; + el.RedoText = this.SelectedText; // save redo text!!!! + this.SelectedText = el.SelectedText; + + RedoStack.Push(el); + + int intStartLine = this.GetLineFromCharIndex(el.SelectionStart); + int intStart = this.GetFirstCharIndexFromLine(intStartLine); + + int intStopLine = this.GetLineFromCharIndex(el.SelectionStart + el.SelectedText.Length); + if (intStopLine < this.Lines.Length) + { + int intLengthStopLine = this.Lines[intStopLine].Length; + int intStop = this.GetFirstCharIndexFromLine(intStopLine) + intLengthStopLine; + + ColorLine(intStart, intStop - intStart); + } + + EndUpdate(); + this.Focus(); + } + + public void ToClipBoard() + { + bool backup = Properties.Settings.Default.SL4SpacesIndent; + Properties.Settings.Default.SL4SpacesIndent = true; + string strFormattedText = AutoFormatter.ApplyFormatting(0, this.Text); + Properties.Settings.Default.SL4SpacesIndent = backup; + + try + { + Clipboard.SetDataObject(strFormattedText, true); + } + catch(Exception exception) + { + // error + Console.WriteLine(exception.Message); + } + } + + public void ReplaceSelectedText(string strReplacement) + { + this.blnEscape = true; // prevent windows popping up + this.ColoredText = strReplacement; + } + + public void MakeAllInvis() + { + if (!ToolTipping) + return; + this.TooltipKeyboard.Visible = false; + this.TooltipListBox.Visible = false; + this.TooltipMouse.Visible = false; + this.GListBoxWindow.Visible = false; + this.Focus(); + } + + private void LineDownlighting() + { + if (this.HighLightLine < 0) + return; + + // doof line + BeginUpdate(); + int intBackupSelectionStart = this.SelectionStart; + int intBackupSelectionLength = this.SelectionLength; + this.SelectionStart = this.GetFirstCharIndexFromLine(this.HighLightLine); + this.SelectionLength = this.Lines[this.HighLightLine].Length; + this.SelectionBackColor = this.BackColor; + this.SelectionStart = intBackupSelectionStart; + this.SelectionLength = intBackupSelectionLength; + this.HighLightLine = -1; + EndUpdate(); + } + + private void CursorPositionChanged() + { + BracketHighlichting(); + + LineDownlighting(); + + if (OnCursorPositionChanged != null) + OnCursorPositionChanged(this, new CursorPositionEventArgs(this.GetLine(), this.GetColumn(), this.GetChar(), this.GetTotal(), this.blnInsert, Control.IsKeyLocked(Keys.CapsLock))); + } + + public new void Paste() + { + ResetHighlichting(); + + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text, true)) + { + string strTextToPaste = Clipboard.GetDataObject().GetData(DataFormats.Text, true).ToString().Replace("\r", ""); + this.ColoredText = strTextToPaste; + } + } + + private void GoEnd(bool blnShift) + { + if (this.Lines.Length == 0) + return; + int intLast = this.SelectionStart + this.SelectionLength; + int intLine = this.GetLineFromCharIndex(intLast); + int intColumn = intLast - this.GetFirstCharIndexFromLine(intLine); + string strLine = this.Lines[intLine]; + int intAdd = strLine.Length - intColumn; + if (blnShift) + this.SelectionLength += intAdd; + else + { + this.SelectionStart = intLast+intAdd; + this.SelectionLength = 0; + } + } + + private void GoHome(bool blnShift) + { + if (this.Lines.Length == 0) + return; + int intLine = this.GetLineFromCharIndex(this.SelectionStart); + string strLine = this.Lines[intLine]; + for (int intColumn = 0; intColumn <= strLine.Length; intColumn++) + { + // now we are at the front of the line, ex whitespace + if (intColumn == strLine.Length || strLine[intColumn] > ' ') + { + int intStart = this.GetFirstCharIndexFromLine(intLine) + intColumn; + if (intStart == this.SelectionStart) // already here + intStart = this.GetFirstCharIndexFromLine(intLine); + // intStart has now got the new start position + if (blnShift) + { + int intAddToLength = this.SelectionStart - intStart; + this.SelectionStart = intStart; + // can + of - + this.SelectionLength = Math.Max(0, this.SelectionLength + intAddToLength); + } + else + { + this.SelectionStart = intStart; + this.SelectionLength = 0; + } + return; + } + } + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + + if (this.TooltipMouse != null) + { + if (this.TooltipMouse.Visible) + { + this.TooltipMouse.Visible = false; + this.Focus(); + } + } + + if (this.GListBoxWindow != null && this.GListBoxWindow.Visible) + { + this.GListBoxWindow.KeyDownHandler(e); + } + else + { + if (e.KeyCode == Keys.Tab) + { + int intLineStart = this.GetLineFromCharIndex(this.SelectionStart); + int intLineStop = this.GetLineFromCharIndex(this.SelectionStart + this.SelectionLength); + if (intLineStart != intLineStop) + MultiLineTab(!e.Shift); + else + SingleLineTab(!e.Shift); + e.Handled = true; + } + } + + if (e.KeyCode == Keys.Insert) + { + blnInsert = !blnInsert; + CursorPositionChanged(); + } + + if (e.KeyCode == Keys.Left || + e.KeyCode == Keys.Right || + e.KeyCode == Keys.End || + e.KeyCode == Keys.Home) + MakeAllInvis(); + + if (e.KeyCode == Keys.Home) + { + if (!e.Control) + { + GoHome(e.Shift); + e.Handled = true; + } + } + + if (e.KeyCode == Keys.End) + { + if (!e.Control) + { + GoEnd(e.Shift); + e.Handled = true; + } + } + + if (e.KeyCode == Keys.Delete) + { + if (e.Control) + { + int intWissel = 0; + int intIndex = this.SelectionStart; + if (intIndex < this.Text.Length) + { + bool blnWhiteSpace = (this.Text[intIndex] <= ' '); + + while (intIndex < this.Text.Length) + { + if (this.Text[intIndex] > ' ') + { + if (blnWhiteSpace) + { + blnWhiteSpace = false; + intWissel++; + } + } + else // whitespace + { + if (!blnWhiteSpace) + { + blnWhiteSpace = true; + intWissel++; + } + } + if (intWissel == 2) + break; + intIndex++; + } + this.SelectionLength = intIndex - this.SelectionStart; + } + } // control + else + { + if (e.Shift) + { + if (this.SelectionLength == 0) + { + if (this.Lines.Length > 0) + { + BeginUpdate(); + this.SelectionStart = this.GetFirstCharIndexOfCurrentLine(); + int intLine = this.GetLineFromCharIndex(this.SelectionStart); + this.SelectionLength = this.Lines[intLine].Length + 1; + EndUpdate(); + } + } + this.Copy(); + } // shift + else + { + if (this.SelectionLength == 0) + this.SelectionLength = 1; + } // no shift + } + this.Delete(); + e.Handled = true; + } + + if (e.KeyCode == Keys.X && e.Control) + { + this.Cut(); + e.Handled = true; + } + + if (this.TooltipKeyboard != null) + { + if (this.TooltipKeyboard.Visible) + { + if (e.KeyCode == Keys.Up || + e.KeyCode == Keys.Down) + { + this.TooltipKeyboard.Visible = false; + this.Focus(); + } + } + } + + // 16 maart 2008 + if (e.KeyCode == Keys.Back && e.Alt) + this.Undo(); + + if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Back) + e.Handled = true; + + if (e.Control) + { + if (e.KeyCode == Keys.R) + { + e.Handled = true; + } + if (e.KeyCode == Keys.V) + { + this.Paste(); + e.Handled = true; + } + if (e.KeyCode == Keys.C) + { + this.Copy(); + e.Handled = true; + } + } + + if (e.KeyData == Keys.CapsLock) + CursorPositionChanged(); + } + + private void ProcessBackSpace() + { + if (this.SelectionStart == 0 && this.SelectionLength == 0) + return; + + BeginUpdate(); + if (this.SelectionStart > 0 && this.SelectionLength == 0) + this.SelectionStart--; + if (this.SelectionLength == 0) + this.SelectionLength = 1; + this.ColoredText = ""; + EndUpdate(); + OnTextChanged(null); + CursorPositionChanged(); + } + + protected override void OnKeyPress(KeyPressEventArgs e) + { + ResetHighlichting(); + + char keyChar = e.KeyChar; + + switch (e.KeyChar) + { + case '\r': // Return + if (this.GListBoxWindow.Visible) + InsertSelectedWord(); + else + ProcessEnter(); + e.Handled = true; + break; + case '\t': // TAB + if (this.GListBoxWindow.Visible) + InsertSelectedWord(); + e.Handled = true; + break; + case '{': + case '}': + ProcessBraces(keyChar); + e.Handled = true; + break; + case '\b': + ProcessBackSpace(); + MakeAllInvis(); + e.Handled = true; + break; + case (char)27: + this.blnEscape = !this.blnEscape; + MakeAllInvis(); + break; + default: + if (keyChar >= 32) + { + if (this.SelectionLength != 0) + this.Delete(); + SaveUndo(new UndoElement(this.SelectionStart, "", 1, null)); + } + if (keyChar > 32 && !Char.IsLetterOrDigit(keyChar)) + this.blnEscape = false; + break; + } + base.OnKeyPress(e); + } + + // event generated, make list of codecompletion words + private void CodeCompletion(string strKeyWord, bool IsRegularExpression) + { + if (!ToolTipping) + return; + + intKeyWordLength = strKeyWord.Length; + + if (IsRegularExpression) + intKeyWordLength = 0; // else it would delete typed keyword + + if (strKeyWord.Length == 0 || this.blnEscape) + { + this.TooltipListBox.Visible = false; + this.GListBoxWindow.Visible = false; + this.Focus(); + return; + } + + List list; + + if (Properties.Settings.Default.CodeCompletion) + list = keyWords.KeyWordSearch(strKeyWord, IsRegularExpression); + else + list = new List(); + + if (Properties.Settings.Default.CodeCompletionUserVar && !IsRegularExpression) + codeCompletion.CodeCompletionUserVar(strKeyWord, this.Text, this.SelectionStart, list); + + if (list.Count == 0) + { + this.TooltipListBox.Visible = false; + this.GListBoxWindow.Visible = false; + this.Focus(); + return; + } + + if (list.Count == 1) + { + // single keyword has been typed, make listbox invisible + if (list[0].name == strKeyWord) + { + /* + // this autocompletes 1 word, backspace is a problem, use escape + this.GListBoxWindow.GListBox.Items.Clear(); + KeyWordInfo keyWordInfo = list[0]; + GListBoxItem glbi = new GListBoxItem(keyWordInfo.name, (int)keyWordInfo.type); + this.GListBoxWindow.GListBox.Items.Add(glbi); + + this.GListBoxWindow.GListBox.SelectedIndex = 0; + InsertSelectedWord(); + */ + + if (strKeyWord == "else") // else autocompletion enoys people!!! TODO + { + this.TooltipListBox.Visible = false; + this.GListBoxWindow.Visible = false; + this.Focus(); + return; + } + } + } + + // Hide argument typing + this.TooltipKeyboard.Visible = false; + this.Focus(); + + this.GListBoxWindow.GListBox.Items.Clear(); + foreach (KeyWordInfo keyWordInfo in list) + { + GListBoxItem glbi = new GListBoxItem(keyWordInfo.name, (int)keyWordInfo.type); + this.GListBoxWindow.GListBox.Items.Add(glbi); + } + this.GListBoxWindow.GListBox.SelectedIndex = 0; + this.GListBoxWindow.GListBox.Height = Math.Min(list.Count + 1, 11) * this.GListBoxWindow.GListBox.ItemHeight; + this.GListBoxWindow.SetPosition(Screen.GetWorkingArea(this), this); + + // Just in case it pops up + this.TooltipListBox.SetPosition(Screen.GetWorkingArea(this), this); + + this.GListBoxWindow.Visible = true; + this.Focus(); + } + + private void SelectWordByDoubleClick() + { + int intSelectionStartBackup = this.SelectionStart; + + int intLineNumber = this.GetLineFromCharIndex(intSelectionStartBackup); + int intFirstChar = this.GetFirstCharIndexFromLine(intLineNumber); + int intColumn = intSelectionStartBackup - intFirstChar; + + string strLine = this.Lines[intLineNumber]; + + // start or ending in underscore then expand + int intStart = intColumn; + while ((intStart > 0) && IsAlpha(strLine[intStart - 1])) + intStart--; + + int intEnd = intColumn; + while ((intEnd < strLine.Length) && IsAlpha(strLine[intEnd])) + intEnd++; + + if (intStart != intColumn || intEnd != (intStart + this.SelectionLength)) + { + this.SelectionStart = intFirstChar + intStart; + this.SelectionLength = intEnd - intStart; + } + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + BracketHighlichting(); + + // this sucks!!!! + this.AutoWordSelection = true; + this.AutoWordSelection = Properties.Settings.Default.AutoWordSelection; + + if (this.ToolTipping) + MakeAllInvis(); + + if (e.Clicks == 2) + SelectWordByDoubleClick(); + } + + private void ShowKeyBoardHint() + { + if (!ToolTipping) + return; + + if (this.GListBoxWindow.Visible) + return; + + if (this.blnEscape) + return; + + int intArgument; + bool DoWild; + string strFunction = GetCurrentFunction(out intArgument, out DoWild); + + if (strFunction == "") + { + this.TooltipKeyboard.Visible = false; + this.Focus(); + return; + } + + SetArgumentListOnRichLabel(this.TooltipKeyboard, strFunction, intArgument); + if (DoWild && this.TooltipKeyboard.Wild != "") + { + CodeCompletion(this.TooltipKeyboard.Wild , true); + this.Focus(); + return; + } + + if (this.TooltipKeyboard.Text == "") + { + this.TooltipKeyboard.Visible = false; + } + else + { + this.TooltipKeyboard.SetPosition(Screen.GetWorkingArea(this), this); + this.TooltipKeyboard.Visible = true; + //this.SelectionColor = this.ForeColor; + } + this.Focus(); + } + + private bool IsInComment(string strLine, int intIndex) + { + bool blnInString = false; + for (int intI = 0; intI < intIndex; intI++) + { + char chrC = strLine[intI]; + if (chrC == '"') + blnInString = !blnInString; + if (blnInString) + { + if (chrC == '\\') + intI++; + continue; + } + if (chrC == '/') + { + if ((intI + 1) < intIndex) + if (strLine[intI + 1] == '/') + return true; + } + } + return false; + } + + private bool IsInString(string strLine, int intIndex) + { + int intQuotes = 0; + for (int intI = intIndex - 1; intI >= 0; intI--) + { + char chrC = strLine[intI]; + if (chrC == '"') + { + if ((intI - 1) >= 0) + if (strLine[intI - 1] != '\\') + intQuotes++; + } + } + return ((intQuotes % 2) != 0); + } + + /// + /// OnTextChanged + /// + protected override void OnTextChanged(EventArgs e) + { + if (IsUpdating) + return; + + if (this.Lines.Length == 0) + { + TabStops(); + return; + } + + this.Dirty = true; + + int intSelectionStartBackup = this.SelectionStart; + + int intLineNumber = this.GetLineFromCharIndex(intSelectionStartBackup); + int intFirstChar = this.GetFirstCharIndexFromLine(intLineNumber); + int intColumn = intSelectionStartBackup - intFirstChar; + + string strLine = this.Lines[intLineNumber]; + + ColorLine(intFirstChar, strLine.Length); + + if (IsInComment(strLine, intColumn)) + return; + + if (IsInString(strLine, intColumn)) + return; + + // not in comment and not in string, find the start of a word + int intStart = intColumn; + while ((intStart > 0) && IsAlpha(strLine[intStart - 1])) + intStart--; + + string strTypedWord = strLine.Substring(intStart, intColumn - intStart); + + CodeCompletion(strTypedWord , false); + + ShowKeyBoardHint(); + } + + /// + /// Color a line + /// + private void ColorLine(int intStart, int intLength) + { + if (!ToolTipping) + return; + + if (intLength <= 0) + return; + + BeginUpdate(); + + // Backup position + int SelectionStartBackup = this.SelectionStart; + + // get the line + string strLine = this.Text.Substring(intStart, intLength); + + // highlight all keywords + foreach (Match m in keyWords.Matches(strLine)) + { + Group g = m.Groups[1]; + string strKeyWord = g.Value; + + this.SelectionStart = intStart + g.Index; + this.SelectionLength = g.Length; + + // normal keywords + if (keyWords.ContainsKeyWord(strKeyWord)) + this.SelectionColor = keyWords.GetColorFromKeyWordList(strKeyWord); + else + this.SelectionColor = keyWords.GetColorFromRegex(strKeyWord); + } + + // Restore position + this.SelectionLength = 0; + this.SelectionStart = SelectionStartBackup; + this.SelectionColor = this.ForeColor; + + EndUpdate(); + } + + private int AutoFormat(bool OnlySelectedText) + { + int intTabs; + if (OnlySelectedText) + { + string strW = GetNewWhiteSpace(-1); + intTabs = (int)(strW.Length / AutoFormatter.GetTab().Length); + } + else + { + this.SelectionStart = 0; + this.SelectionLength = this.Text.Length; + intTabs = 0; + } + string strFormattedText = AutoFormatter.ApplyFormatting(intTabs, this.SelectedText); + + this.ColoredText = strFormattedText; + + return strFormattedText.Length; + } + + public void AutoFormatSelectedText() + { + BeginUpdate(); + Point scrollPoint = this.RTBScrollPos; + int intBackupStart = this.SelectionStart; + int intSelectionLength = AutoFormat(true); + this.SelectionStart = intBackupStart; + this.SelectionLength = intSelectionLength; + this.RTBScrollPos = scrollPoint; + EndUpdate(); + } + + public void FormatDocument() + { + BeginUpdate(); + Point scrollPoint = this.RTBScrollPos; + int intLine = this.GetLineFromCharIndex(this.SelectionStart); + AutoFormat(false); + this.SelectionStart = Math.Max(0,this.GetFirstCharIndexFromLine(intLine)); + this.RTBScrollPos = scrollPoint; + EndUpdate(); + } + + public void ClearUndoStack() + { + UndoStack.Clear(); + Dirty = false; + } + + public override string Text + { + get + { + return base.Text; + } + set + { + BeginUpdate(); + int intBackup = this.SelectionStart; + this.SelectionStart = 0; + this.SelectionLength = this.Text.Length; //TODO + this.ColoredText = value; + this.SelectionStart = intBackup; + EndUpdate(); + } + } + + private string GetWhiteSpaceFromCurrentLine() + { + int intIndex = this.GetLineFromCharIndex(this.SelectionStart); + if (intIndex < this.Lines.Length) + return AutoFormatter.GetWhiteSpaceFromLine(this.Lines[intIndex]); + return ""; + } + + // code-completion word is selected + // also comes from mainform (doubleclick), must be public + public void InsertSelectedWord() + { + this.GListBoxWindow.Visible = false; + this.TooltipListBox.Visible = false; + + if (this.GListBoxWindow.GListBox.SelectedIndex < 0) + return; + + int intOffset = 0; + + GListBoxItem glbi = this.GListBoxWindow.Selected; + string strSelected = glbi.ToString(); + if (strSelected == "") + { + this.Focus(); + return; + } + + if (glbi.ImageIndex == (int)KeyWordTypeEnum.Events + || strSelected == "default" && this.Text.IndexOf("default")<0) + { + if (strSelected != "default") + strSelected = keyWords.GetEvent(strSelected); + + string strW = GetWhiteSpaceFromCurrentLine(); + strSelected += "\n" + strW + "{\n" + strW + AutoFormatter.GetTab() + "\n" + strW + "}"; + intOffset = -(strW.Length + 2); + } + else if (glbi.ImageIndex == (int)KeyWordTypeEnum.Functions) + { + if(keyWords.GetNumberOfArguments(strSelected) == 0) + strSelected += "()"; + else + strSelected += "("; + } + else if (glbi.ImageIndex == (int)KeyWordTypeEnum.Properties) + { + strSelected = "\"" + strSelected.Trim() +"\""; + } + + BeginUpdate(); + this.SelectionStart -= intKeyWordLength; + this.SelectionLength = intKeyWordLength; + this.ColoredText = strSelected; + + this.SelectionStart += intOffset; + EndUpdate(); + + // if any + ShowKeyBoardHint(); + + this.Focus(); + } + + // this comes from the main form + public void ShowTooltipOnListBox() + { + string strSelected = this.GListBoxWindow.Selected.ToString(); + string strDescription = keyWords.GetDescription(strSelected); + if (strDescription != "") + { + this.TooltipListBox.Tag = strSelected; + this.TooltipListBox.Text = strDescription; + this.TooltipListBox.XOffset = this.GListBoxWindow.Width; + this.TooltipListBox.SetPosition(Screen.GetWorkingArea(this), this); + this.TooltipListBox.Visible = true; + this.Focus(); + } + else + { + this.TooltipListBox.Visible = false; + this.Focus(); + } + } + + // Tooltip mouse by (Windows.Forms) timer + private void timer1_Tick(object sender, EventArgs e) + { + this.timer1.Stop(); + + if (this.Disposing || this.IsDisposed) + return; + + if (!this.Visible) + return; + + if (!ToolTipping) + return; + + if (!Properties.Settings.Default.ToolTip) + return; + + if (Control.MouseButtons != MouseButtons.None) + return; + + Point point; + string strKeyWord = this.GetCurrentKeyWord(true, out point); + + if (strKeyWord == "") + { + this.TooltipMouse.Visible = false; + return; + } + + if (this.TooltipMouse.Tag.ToString() != strKeyWord) + { + this.TooltipMouse.Tag = strKeyWord; + this.TooltipMouse.Text = keyWords.GetDescription(strKeyWord); + } + + if (this.TooltipMouse.Text == "") + { + this.TooltipMouse.Visible = false; + return; + } + + this.TooltipMouse.SetPosition(this, point); + this.TooltipMouse.Visible = true; + this.Focus(); + } + + public bool ToolTipping + { + get + { + return m_blnToolTipping; + } + set + { + m_blnToolTipping = value; + if (m_blnToolTipping) + { + this.timer1 = new System.Windows.Forms.Timer(); + this.timer1.Interval = Properties.Settings.Default.ToolTipDelay; + this.timer1.Tick += new EventHandler(timer1_Tick); + } + } + } + + public void SetPosition(Rectangle rect) + { + if (!ToolTipping) + return; + if (this.GListBoxWindow.Visible) + this.GListBoxWindow.SetPosition(rect, this); + if (this.TooltipListBox.Visible) + this.TooltipListBox.SetPosition(rect, this); + if (this.TooltipKeyboard.Visible) + this.TooltipKeyboard.SetPosition(rect, this); + } + + private void SetArgumentListOnRichLabel(TooltipWindow window, string strKeyWord, int intArgument) + { + if (window.Tag.ToString() == (strKeyWord + intArgument)) + return; // cached information + + string strWild = ""; + window.Wild = ""; + window.Tag = (strKeyWord + intArgument); + window.Text = keyWords.GetFunctionAndHiglightArgument(strKeyWord, intArgument, out strWild); + if(Properties.Settings.Default.CodeCompletionArguments) + window.Wild = strWild; + } + + + public void Goto(int intLine) + { + this.SelectionStart = this.GetFirstCharIndexFromLine(intLine - 1); + this.Focus(); + } + + public void MultiLineComment(bool blnAdd) + { + BeginUpdate(); + + ResetHighlichting(); + + string strW = GetNewWhiteSpace(-1); + int intTabs = (int)(strW.Length / AutoFormatter.GetTab().Length); + + if (this.SelectionLength == 0) + { + int intLine = this.GetLineFromCharIndex(this.SelectionStart); + int intStart = this.GetFirstCharIndexFromLine(intLine); + int intLength = this.Lines[intLine].Length + 1; + this.SelectionStart = intStart; + this.SelectionLength = intLength; + } + string strSelectedText = AutoFormatter.MultiLineComment(blnAdd, intTabs, this.SelectedText); + + int intBackup = this.SelectionStart; + this.ColoredText = strSelectedText; + this.SelectionStart = intBackup; + this.SelectionLength = strSelectedText.Length; + EndUpdate(); + } + + public void MultiLineTab(bool blnAdd) + { + string strSelectedText = AutoFormatter.MultiLineTab(blnAdd, this.SelectedText); + + int intBackup = this.SelectionStart; + this.ColoredText = strSelectedText; + this.SelectionStart = intBackup; + this.SelectionLength = strSelectedText.Length; + } + + private void SingleLineTab(bool blnAdd) + { + if (blnAdd) + { + this.SelectedText = AutoFormatter.GetTab(); + } + else + { + // Shift tab on single line + string strTab = AutoFormatter.GetTab(); + if (this.SelectionStart > strTab.Length) + { + string strBefore = this.Text.Substring(this.SelectionStart - strTab.Length, strTab.Length); + if (strBefore == strTab) + { + int intBackupLength = this.SelectionLength; + this.SelectionStart -= strTab.Length; + this.SelectionLength = strTab.Length; + this.SelectedText = ""; + this.SelectionLength = intBackupLength; + } + else + { + // space remove? TODO + } + } + } + } + + private void HighLightCharAt(int intIndex, Color color) + { + this.SelectionStart = intIndex; + this.SelectionLength = 1; + this.SelectionBackColor = color; + + if (color != this.BackColor) + HighLightList.Add(intIndex); + } + + private void HighLightCharAt(int intLine, int intColumn, Color color) + { + int intIndex = this.GetFirstCharIndexFromLine(intLine) + intColumn; + HighLightCharAt(intIndex, color); + } + + private bool MatchingBracket(int intCurrentLine, int intCurrentColumn, char chrOpening, char chrClosing, int intDirection, out int intLine, out int intColumn) + { + if (this.Lines.Length == 0) + { + intLine = 0; + intColumn = 0; + return false; + } + intLine = intCurrentLine; + intColumn = intCurrentColumn; + string strLine = AutoFormatter.RemoveComment(this.Lines[intLine]); + + int intNumber = 1; + bool blnWithinString = false; + while (true) + { + intColumn += intDirection; + while (intColumn < 0) + { + intLine--; + if (intLine < 0) + return false; // nothing to do + strLine = AutoFormatter.RemoveComment(this.Lines[intLine]); // get new previous line + intColumn = strLine.Length - 1; // place on end of line + } + + while (intColumn >= strLine.Length) + { + intLine++; + if (intLine >= this.Lines.Length) + return false; // nothing to do + strLine = AutoFormatter.RemoveComment(this.Lines[intLine]); // get new previous line + intColumn = 0; // place on begin of line + } + + char chrC = strLine[intColumn]; + + if (chrC == '"') + { + if (intDirection < 0 && intColumn > 0) + { + if (strLine[intColumn - 1] == '\\') + { + intColumn += intDirection; + continue; + } + } + blnWithinString = !blnWithinString; + } + + if (blnWithinString) + { + if (intDirection > 0 && chrC == '\\') + intColumn += intDirection; + continue; + } + + if (chrC == chrOpening) + intNumber++; + else if (chrC == chrClosing) + { + intNumber--; + if (intNumber == 0) + return true; + } + } + } + + private void ResetHighlichting() + { + if (HighLightList.Count == 0) + return; + + BeginUpdate(); + + Point scrollPoint = this.RTBScrollPos; + + int intBackupStart = this.SelectionStart; + int intBackupLength = this.SelectionLength; + foreach (int intIndex in HighLightList) + HighLightCharAt(intIndex, this.BackColor); + HighLightList.Clear(); + this.SelectionStart = intBackupStart; + this.SelectionLength = intBackupLength; + + this.RTBScrollPos = scrollPoint; + + EndUpdate(); + } + + private void BracketHighlichting() + { + if (this.TextLength == 0) + return; + if (this.SelectionLength != 0) + return; + + BeginUpdate(); + + Point scrollPoint = this.RTBScrollPos; + + int intSelectionStart = this.SelectionStart; + + // ResetHighlichting without the overhead + if (HighLightList.Count > 0) + { + foreach (int intI in HighLightList) + HighLightCharAt(intI, this.BackColor); + HighLightList.Clear(); + } + + int intIndex; + int intType; + + const string Uppers = "<({["; + const string Downers = ">)}]"; + + int intLine = this.GetLineFromCharIndex(intSelectionStart); + int intColumn = intSelectionStart - this.GetFirstCharIndexFromLine(intLine); + + string strLine = AutoFormatter.RemoveComment(this.Lines[intLine]); + + if (intColumn <= strLine.Length) + { + intIndex = intColumn - 1; + if (intIndex >= 0) + { + intType = Downers.IndexOf(strLine[intIndex]); + if (intType >= 0) + { + int intL, intC; + if (MatchingBracket(intLine, intIndex, Downers[intType], Uppers[intType], -1, out intL, out intC)) + { + HighLightCharAt(intLine, intIndex, Properties.Settings.Default.BracketHighlight); + HighLightCharAt(intL, intC, Properties.Settings.Default.BracketHighlight); + } + } + } + + intIndex = intColumn; + if (intIndex < strLine.Length) + { + intType = Uppers.IndexOf(strLine[intIndex]); + if (intType >= 0) + { + int intL, intC; + if (MatchingBracket(intLine, intIndex, Uppers[intType], Downers[intType], 1, out intL, out intC)) + { + HighLightCharAt(intLine, intIndex, Properties.Settings.Default.BracketHighlight); + HighLightCharAt(intL, intC, Properties.Settings.Default.BracketHighlight); + } + } + } + } + + this.SelectionStart = intSelectionStart; + this.SelectionLength = 0; + + this.RTBScrollPos = scrollPoint; + + EndUpdate(); + } + + public override string SelectedText + { + get + { + return base.SelectedText; + } + set + { + if (!IsUpdating) + SaveUndo(new UndoElement(this.SelectionStart, this.SelectedText, value.Length, null)); + base.SelectedText = value; + } + } + + private string ColoredText + { + set + { + BeginUpdate(); + int intFirstCharOfStartLine = this.GetFirstCharIndexOfCurrentLine(); + int intBackup = this.SelectionStart; + if (this.SelectedText != value) + { + this.Dirty = true; + string strTmp = value.Replace("\r", ""); + SaveUndo(new UndoElement(this.SelectionStart, this.SelectedText, strTmp.Length, null)); + this.SelectedText = strTmp; + if (this.Lines.Length > 0) + { + int intEndLine = this.GetLineFromCharIndex(intBackup + strTmp.Length); + int intLastCharOfEndLine = this.GetFirstCharIndexFromLine(intEndLine) + this.Lines[intEndLine].Length; + int intLength = intLastCharOfEndLine - intFirstCharOfStartLine; + ColorLine(intFirstCharOfStartLine, intLength); + this.SelectionStart = intBackup + strTmp.Length; + } + } + else + { + this.SelectionLength = 0; + this.SelectionStart += value.Length; + } + EndUpdate(); + } + } + + public void SaveCurrentFile(string strPath) + { + try + { + Encoding enc = null; + if (!Directory.Exists(Path.GetDirectoryName(strPath))) + Directory.CreateDirectory(Path.GetDirectoryName(strPath)); + switch (Properties.Settings.Default.OutputFormat) + { + case "UTF8": + enc = Encoding.UTF8; + break; + case "Unicode": + enc = Encoding.Unicode; + break; + case "BigEndianUnicode": + enc = Encoding.BigEndianUnicode; + break; + default: + enc = Encoding.Default; + break; + } + StreamWriter sw = new StreamWriter(strPath,false, enc); + sw.Write(this.Text); + sw.Close(); + //this.SaveFile(strPath, RichTextBoxStreamType.PlainText); + this.Dirty = false; + } + catch // (Exception exception) + { + MessageBox.Show("Error saving file, check pathname: " + strPath, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + public new void LoadFile(string path) + { + if (path.StartsWith("http://")) + { + System.Net.WebClient webClient = new System.Net.WebClient(); + this.Text = webClient.DownloadString(path); + } + else + { + if (File.Exists(path)) + { + StreamReader sr = new StreamReader(path, Encoding.Default); + this.Text = sr.ReadToEnd(); + sr.Close(); + } + } + // Fresh files can not be dirty + ClearUndoStack(); + } + } +} diff --git a/Editor/SyntaxRichTextBox.resx b/Editor/SyntaxRichTextBox.resx new file mode 100644 index 0000000..dd0ea4d --- /dev/null +++ b/Editor/SyntaxRichTextBox.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/Editor/TooltipWindow.cs b/Editor/TooltipWindow.cs new file mode 100644 index 0000000..8d817bf --- /dev/null +++ b/Editor/TooltipWindow.cs @@ -0,0 +1,162 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing.Drawing2D; + +namespace LSLEditor +{ + public partial class TooltipWindow : Form + { + public string Wild; + public int XOffset = 0; + public override string Text + { + get + { + return base.Text; + } + set + { + base.Text = value; + this.richLabel1.Text = value; + } + } + + public TooltipWindow(Form parent) + { + InitializeComponent(); + + this.Wild = ""; + + this.Owner = parent; + this.richLabel1.BorderStyle = BorderStyle.FixedSingle; + //this.richLabel1.BackColor = Color.LightGoldenrodYellow; + + this.BackColor = Color.LightGoldenrodYellow; + //this.richLabel1.BorderStyle = BorderStyle.None; + + this.richLabel1.Tag = ""; + this.richLabel1.Text = ""; + } + + public void SetPosition(Rectangle rect, SyntaxRichTextBox syntaxRichTextBox) + { + //Rectangle rect = Screen.PrimaryScreen.WorkingArea; + Point p = syntaxRichTextBox.GetPositionFromCharIndex(syntaxRichTextBox.SelectionStart); + + p = new Point(p.X - 20 + this.XOffset + 2 , p.Y + 2 + syntaxRichTextBox.LineHeight); + + Rectangle client = Screen.PrimaryScreen.WorkingArea; // syntaxRichTextBox.ClientRectangle; + if (p.X < client.Left || p.Y < client.Top || p.X > client.Width || p.Y > client.Height) + { + this.Visible = false; + return; + } + + Point screen = syntaxRichTextBox.PointToScreen(p); + + //if ((screen.Y + this.Height) > rect.Height) + // screen = RichTextBox.PointToScreen(new Point(p.X - 20 + this.XOffset, p.Y - this.Height)); + + if (screen.Y > rect.Bottom) + { + this.Visible = false; + return; + //screen.Y = rect.Bottom; + } + + if (screen.X > rect.Right) + { + this.Visible = false; + return; + //screen.X = rect.Right; + } + + if (screen.X < rect.Left) + { + this.Visible = false; + return; + //screen.X = rect.Left; + } + + if ((screen.Y) < rect.Top) + { + this.Visible = false; + return; + //screen.Y = rect.Top; + } + + this.Location = screen; + } + + public void SetPosition(SyntaxRichTextBox syntaxRichTextBox, Point p) + { + Rectangle rect = Screen.PrimaryScreen.WorkingArea; + Point screen = syntaxRichTextBox.PointToScreen(new Point(p.X - 20 , p.Y + syntaxRichTextBox.LineHeight)); + if ((screen.Y + this.Height) > rect.Height) + screen = syntaxRichTextBox.PointToScreen(new Point(p.X - 20, p.Y - this.Height)); + + if ((screen.X + this.Width) > rect.Width) + screen.X = rect.Width - this.Width; + + if (screen.X < rect.Left) + screen.X = rect.Left; + + if (screen.Y < rect.Top) + screen.Y = rect.Top; + + this.Location = screen; + } + + private void richLabel1_Resize(object sender, EventArgs e) + { + this.Size = this.richLabel1.Size; + + } + + } +} \ No newline at end of file diff --git a/Editor/TooltipWindow.designer.cs b/Editor/TooltipWindow.designer.cs new file mode 100644 index 0000000..99cc24a --- /dev/null +++ b/Editor/TooltipWindow.designer.cs @@ -0,0 +1,62 @@ +namespace LSLEditor +{ + partial class TooltipWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.richLabel1 = new LSLEditor.RichLabel(); + this.SuspendLayout(); + // + // richLabel1 + // + this.richLabel1.BackColor = System.Drawing.Color.LightGoldenrodYellow; + this.richLabel1.Location = new System.Drawing.Point(0, 0); + this.richLabel1.Name = "richLabel1"; + this.richLabel1.Size = new System.Drawing.Size(52, 20); + this.richLabel1.TabIndex = 0; + this.richLabel1.Resize += new System.EventHandler(this.richLabel1_Resize); + // + // TooltipWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(105, 42); + this.Controls.Add(this.richLabel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "TooltipWindow"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "GListBoxWindow"; + this.ResumeLayout(false); + + } + + #endregion + + private RichLabel richLabel1; + } +} \ No newline at end of file diff --git a/Editor/TooltipWindow.resx b/Editor/TooltipWindow.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Editor/TooltipWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FindWindow.Designer.cs b/FindWindow.Designer.cs new file mode 100644 index 0000000..4ad8ad3 --- /dev/null +++ b/FindWindow.Designer.cs @@ -0,0 +1,212 @@ +namespace LSLEditor +{ + partial class FindWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.comboBoxFind = new System.Windows.Forms.ComboBox(); + this.FindNext = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.comboBoxReplace = new System.Windows.Forms.ComboBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.checkBoxWholeWord = new System.Windows.Forms.CheckBox(); + this.checkBoxReverse = new System.Windows.Forms.CheckBox(); + this.checkBoxMatchCase = new System.Windows.Forms.CheckBox(); + this.Replace = new System.Windows.Forms.Button(); + this.ReplaceAll = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.comboBoxFind); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(240, 48); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Find what:"; + // + // comboBoxFind + // + this.comboBoxFind.FormattingEnabled = true; + this.comboBoxFind.Location = new System.Drawing.Point(16, 16); + this.comboBoxFind.Name = "comboBoxFind"; + this.comboBoxFind.Size = new System.Drawing.Size(208, 21); + this.comboBoxFind.TabIndex = 1; + this.comboBoxFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBoxFind_KeyDown); + // + // FindNext + // + this.FindNext.Location = new System.Drawing.Point(80, 184); + this.FindNext.Name = "FindNext"; + this.FindNext.Size = new System.Drawing.Size(75, 23); + this.FindNext.TabIndex = 6; + this.FindNext.Text = "Find Next"; + this.FindNext.UseVisualStyleBackColor = true; + this.FindNext.Click += new System.EventHandler(this.FindNext_Click); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.comboBoxReplace); + this.groupBox2.Location = new System.Drawing.Point(8, 56); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(240, 48); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Replace with:"; + // + // comboBoxReplace + // + this.comboBoxReplace.FormattingEnabled = true; + this.comboBoxReplace.Location = new System.Drawing.Point(16, 16); + this.comboBoxReplace.Name = "comboBoxReplace"; + this.comboBoxReplace.Size = new System.Drawing.Size(208, 21); + this.comboBoxReplace.TabIndex = 2; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.checkBoxWholeWord); + this.groupBox3.Controls.Add(this.checkBoxReverse); + this.groupBox3.Controls.Add(this.checkBoxMatchCase); + this.groupBox3.Location = new System.Drawing.Point(8, 112); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(240, 64); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Find options"; + // + // checkBoxWholeWord + // + this.checkBoxWholeWord.AutoSize = true; + this.checkBoxWholeWord.Location = new System.Drawing.Point(112, 24); + this.checkBoxWholeWord.Name = "checkBoxWholeWord"; + this.checkBoxWholeWord.Size = new System.Drawing.Size(83, 17); + this.checkBoxWholeWord.TabIndex = 4; + this.checkBoxWholeWord.Text = "Whole word"; + this.checkBoxWholeWord.UseVisualStyleBackColor = true; + // + // checkBoxReverse + // + this.checkBoxReverse.AutoSize = true; + this.checkBoxReverse.Location = new System.Drawing.Point(16, 40); + this.checkBoxReverse.Name = "checkBoxReverse"; + this.checkBoxReverse.Size = new System.Drawing.Size(66, 17); + this.checkBoxReverse.TabIndex = 5; + this.checkBoxReverse.Text = "Reverse"; + this.checkBoxReverse.UseVisualStyleBackColor = true; + // + // checkBoxMatchCase + // + this.checkBoxMatchCase.AutoSize = true; + this.checkBoxMatchCase.Location = new System.Drawing.Point(16, 24); + this.checkBoxMatchCase.Name = "checkBoxMatchCase"; + this.checkBoxMatchCase.Size = new System.Drawing.Size(82, 17); + this.checkBoxMatchCase.TabIndex = 3; + this.checkBoxMatchCase.Text = "Match case"; + this.checkBoxMatchCase.UseVisualStyleBackColor = true; + // + // Replace + // + this.Replace.Location = new System.Drawing.Point(168, 184); + this.Replace.Name = "Replace"; + this.Replace.Size = new System.Drawing.Size(75, 23); + this.Replace.TabIndex = 7; + this.Replace.Text = "Replace"; + this.Replace.UseVisualStyleBackColor = true; + this.Replace.Click += new System.EventHandler(this.Replace_Click); + // + // ReplaceAll + // + this.ReplaceAll.Location = new System.Drawing.Point(168, 208); + this.ReplaceAll.Name = "ReplaceAll"; + this.ReplaceAll.Size = new System.Drawing.Size(75, 23); + this.ReplaceAll.TabIndex = 8; + this.ReplaceAll.Text = "Replace All"; + this.ReplaceAll.UseVisualStyleBackColor = true; + this.ReplaceAll.Click += new System.EventHandler(this.ReplaceAll_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(24, 216); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 13); + this.label1.TabIndex = 6; + // + // FindWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(256, 238); + this.Controls.Add(this.label1); + this.Controls.Add(this.ReplaceAll); + this.Controls.Add(this.Replace); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.FindNext); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.KeyPreview = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FindWindow"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = " Find"; + this.TopMost = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FindWindow_FormClosing); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FindWindow_KeyDown); + this.groupBox1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ComboBox comboBoxFind; + private System.Windows.Forms.Button FindNext; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.ComboBox comboBoxReplace; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.CheckBox checkBoxMatchCase; + private System.Windows.Forms.Button Replace; + private System.Windows.Forms.Button ReplaceAll; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox checkBoxWholeWord; + private System.Windows.Forms.CheckBox checkBoxReverse; + } +} \ No newline at end of file diff --git a/FindWindow.cs b/FindWindow.cs new file mode 100644 index 0000000..18e8ac3 --- /dev/null +++ b/FindWindow.cs @@ -0,0 +1,315 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; // StringBuilder +using System.Text.RegularExpressions; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class FindWindow : Form + { + private LSLEditorForm lslEditForm; + private int intStart; + private int intEnd; + + private bool m_ReplaceAlso; + + public FindWindow(LSLEditorForm lslEditForm) + { + InitializeComponent(); + this.lslEditForm = lslEditForm; + this.intStart = 0; + this.intEnd = 0; + } + + public bool ReplaceAlso + { + get + { + return m_ReplaceAlso; + } + set + { + m_ReplaceAlso = value; + this.groupBox2.Enabled = m_ReplaceAlso; + this.Replace.Enabled = m_ReplaceAlso; + this.ReplaceAll.Enabled = m_ReplaceAlso; + + if (m_ReplaceAlso) + this.Text = "Find and Replace"; + else + this.Text = "Find"; + } + } + + public string KeyWord + { + set + { + this.label1.Text = ""; // clear out message + if (value != "") + { + this.comboBoxFind.Text = value; + } + else + { + if (this.comboBoxFind.Items.Count > 0) + this.comboBoxFind.SelectedIndex = this.comboBoxFind.Items.Count - 1; + } + } + } + + private bool UpdateComboBox(ComboBox comboBox) + { + string strText = comboBox.Text; + bool Found = false; + + foreach (string strC in comboBox.Items) + { + if (strC == strText) + { + Found = true; + break; + } + } + + if (!Found) + comboBox.Items.Add(strText); + return Found; + } + + public void Find() + { + this.label1.Text = ""; + EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + if (!UpdateComboBox(this.comboBoxFind)) + { + editForm.TextBox.SelectionLength = 0; + editForm.TextBox.SelectionStart = 0; + } + + RichTextBoxFinds options = RichTextBoxFinds.None; + + if (this.checkBoxMatchCase.Checked) options |= RichTextBoxFinds.MatchCase; + if (this.checkBoxReverse.Checked) options |= RichTextBoxFinds.Reverse; + if (this.checkBoxWholeWord.Checked) options |= RichTextBoxFinds.WholeWord; + + if (this.checkBoxReverse.Checked) + { + intStart = 0; // start cant change ;-) + intEnd = editForm.TextBox.SelectionStart; + } + else + { + intStart = editForm.TextBox.SelectionStart + editForm.TextBox.SelectionLength; + if (intStart == editForm.TextBox.Text.Length) + intStart = 0; + intEnd = editForm.TextBox.Text.Length - 1; // length can change!! + } + + string strFind = this.comboBoxFind.Text; + int intIndex = editForm.Find(strFind, intStart, intEnd, options); + if (intIndex < 0) + { + this.label1.Text = "Not found..."; + return; + } + } + + private void FindNext_Click(object sender, EventArgs e) + { + Find(); + this.Focus(); + } + + private void comboBoxFind_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Return) + { + if (this.Replace.Enabled) + { + this.comboBoxReplace.Focus(); + e.SuppressKeyPress = true; + } + else + { + Find(); + e.SuppressKeyPress = true; + } + } + } + + private void Replace_Click(object sender, EventArgs e) + { + EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + UpdateComboBox(this.comboBoxReplace); + + if (editForm.TextBox.SelectionLength > 0) + { + string strReplacement = this.comboBoxReplace.Text; + editForm.TextBox.ReplaceSelectedText(strReplacement); + } + + Find(); + this.Focus(); + } + + // WildCardToRegex not used!! + private string WildCardToRegex(string strWildCard) + { + StringBuilder sb = new StringBuilder(strWildCard.Length + 8); + for (int intI = 0; intI < strWildCard.Length; intI++) + { + char chrC = strWildCard[intI]; + switch (chrC) + { + case '*': + sb.Append(".*"); + break; + case '?': + sb.Append("."); + break; + case '\\': + intI++; + if (intI < strWildCard.Length) + sb.Append(Regex.Escape(strWildCard[intI].ToString())); + break; + default: + sb.Append(Regex.Escape(chrC.ToString())); + break; + } + } + return sb.ToString(); + } + + private void ReplaceAll_Click(object sender, EventArgs e) + { + EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + UpdateComboBox(this.comboBoxReplace); + + string strPattern; + string strFind = Regex.Escape(this.comboBoxFind.Text); + string strReplacement = this.comboBoxReplace.Text; + string strSourceCode = editForm.SourceCode; + + RegexOptions regexOptions = RegexOptions.Compiled; + if (!this.checkBoxMatchCase.Checked) + regexOptions |= RegexOptions.IgnoreCase; + if (this.checkBoxWholeWord.Checked) + strPattern = @"\b" + strFind + @"\b"; + else + strPattern = strFind; + + Regex regex = new Regex(strPattern, regexOptions); + + int intCount = 0; + foreach(Match m in regex.Matches(strSourceCode)) + { + if (m.Value.Length > 0) + intCount++; + } + if (intCount == 0) + { + MessageBox.Show("No matches found"); + } + else + { + if (MessageBox.Show("There are " + intCount + " occurences, replace them all?", "Find and Replace", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) + editForm.SourceCode = regex.Replace(strSourceCode, strReplacement); + } + this.Focus(); + } + + private void FindWindow_FormClosing(object sender, FormClosingEventArgs e) + { + lslEditForm.TopMost = true; // 15 nove 2007 + this.Visible = false; + e.Cancel = true; + lslEditForm.TopMost = false;// 15 nove 2007 + } + + private void FindWindow_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.Escape) + { + this.Visible = false; + e.SuppressKeyPress = true; + e.Handled = true; + } + + if (e.KeyCode == Keys.Return) + { + Find(); + e.SuppressKeyPress = true; + this.Focus(); + } + + if (e.KeyCode == Keys.F3) + { + Find(); + e.SuppressKeyPress = true; + this.Focus(); + } + + + } + + public void FindFocus() + { + this.comboBoxFind.Focus(); + } + + + } +} \ No newline at end of file diff --git a/FindWindow.resx b/FindWindow.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/FindWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..bb942b3 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,1109 @@ +using System; +using System.IO; +using System.Drawing; +using System.Drawing.Imaging; + +using System.Collections; + +using Microsoft.Win32; +using System.Threading; +using System.Reflection; +using System.Globalization; +using System.Windows.Forms; +using System.ComponentModel; +using System.Drawing.Printing; + + +// aximp is oude informatie, maar ik laat het er even instaan +// aximp %WINDIR%\System32\shdocvw.dll /out:"d:\temp\AxInterop.SHDocVw.dll" /keyfile:"D:\Documents and Settings\Administrator\Mijn documenten\Mijn keys\Test.snk" +// copieer de TWEE files AxInterop.SHDocVw.dll en SHDocVw.dll in de bin/Debug directory +// referentie maken naar die twee files + +// +// Pre build command for using a LSLEditor.rc file containing: About.htm HTML "Resource/About.htm" +// +// "$(DevEnvDir)..\..\SDK\v2.0\bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc" +// +// Project properties Application, resource file + +namespace LSLEditor +{ + /// + /// Summary description for Form1. + /// + public class Form1 : System.Windows.Forms.Form + { + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.Panel panel1; + private System.ComponentModel.IContainer components = null; + private Compiler compiler; + private bool FullDebug; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.ContextMenu contextMenu1; + + private System.Windows.Forms.MainMenu mainMenu1; + private System.Windows.Forms.MenuItem menuItem1; + private System.Windows.Forms.MenuItem menuItem2; + private System.Windows.Forms.MenuItem menuItem3; + private System.Windows.Forms.MenuItem menuItem4; + private System.Windows.Forms.MenuItem menuItem5; + private System.Windows.Forms.MenuItem menuItem6; + private System.Windows.Forms.MenuItem menuItem7; + private System.Windows.Forms.MenuItem menuItem8; + private System.Windows.Forms.MenuItem menuItem9; + private System.Windows.Forms.MenuItem menuItem10; + private System.Windows.Forms.MenuItem menuItem11; + private System.Windows.Forms.MenuItem menuItem12; + private System.Windows.Forms.MenuItem menuItem13; + private System.Windows.Forms.MenuItem menuItem14; + private System.Windows.Forms.MenuItem menuItem15; + private System.Windows.Forms.MenuItem menuItem16; + private System.Windows.Forms.MenuItem menuItem17; + private System.Windows.Forms.MenuItem menuItem18; + private System.Windows.Forms.MenuItem menuItem19; + private System.Windows.Forms.MenuItem menuItem20; + private System.Windows.Forms.MenuItem menuItem21; + private System.Windows.Forms.MenuItem menuItem22; + private System.Windows.Forms.MenuItem menuItem23; + private System.Windows.Forms.MenuItem menuItem24; + private System.Windows.Forms.MenuItem menuItem25; + private System.Windows.Forms.MenuItem menuItem26; + private System.Windows.Forms.MenuItem menuItem27; + private System.Windows.Forms.MenuItem menuItem28; + private System.Windows.Forms.MenuItem menuItem29; + private System.Windows.Forms.MenuItem menuItem30; + private System.Windows.Forms.MenuItem menuItem31; + private System.Windows.Forms.MenuItem menuItem32; + private System.Windows.Forms.PageSetupDialog pageSetupDialog1; + private System.Windows.Forms.PrintDialog printDialog1; + private System.Windows.Forms.MenuItem menuItem34; + private System.Windows.Forms.MenuItem menuItem35; + private System.Windows.Forms.MenuItem menuItem36; + private TabPage tabPage1; + private NumberedTextBox.NumberedTextBoxUC numberedTextBoxUC1; + private MenuItem menuItem37; + private MenuItem menuItem38; + private MenuItem menuItem39; + private MenuItem menuItem41; + private MenuItem menuItem40; + private MenuItem menuItem42; + private MenuItem menuItemUploadScript; + private StatusStrip statusStrip1; + private ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.MenuItem menuItem33; + + public Form1(string[] args) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + Start(args); + } + + + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); + this.menuItem1 = new System.Windows.Forms.MenuItem(); + this.menuItem11 = new System.Windows.Forms.MenuItem(); + this.menuItem4 = new System.Windows.Forms.MenuItem(); + this.menuItem41 = new System.Windows.Forms.MenuItem(); + this.menuItem40 = new System.Windows.Forms.MenuItem(); + this.menuItem42 = new System.Windows.Forms.MenuItem(); + this.menuItemUploadScript = new System.Windows.Forms.MenuItem(); + this.menuItem15 = new System.Windows.Forms.MenuItem(); + this.menuItem13 = new System.Windows.Forms.MenuItem(); + this.menuItem5 = new System.Windows.Forms.MenuItem(); + this.menuItem7 = new System.Windows.Forms.MenuItem(); + this.menuItem35 = new System.Windows.Forms.MenuItem(); + this.menuItem34 = new System.Windows.Forms.MenuItem(); + this.menuItem36 = new System.Windows.Forms.MenuItem(); + this.menuItem31 = new System.Windows.Forms.MenuItem(); + this.menuItem32 = new System.Windows.Forms.MenuItem(); + this.menuItem6 = new System.Windows.Forms.MenuItem(); + this.menuItem8 = new System.Windows.Forms.MenuItem(); + this.menuItem24 = new System.Windows.Forms.MenuItem(); + this.menuItem23 = new System.Windows.Forms.MenuItem(); + this.menuItem25 = new System.Windows.Forms.MenuItem(); + this.menuItem22 = new System.Windows.Forms.MenuItem(); + this.menuItem21 = new System.Windows.Forms.MenuItem(); + this.menuItem20 = new System.Windows.Forms.MenuItem(); + this.menuItem26 = new System.Windows.Forms.MenuItem(); + this.menuItem28 = new System.Windows.Forms.MenuItem(); + this.menuItem27 = new System.Windows.Forms.MenuItem(); + this.menuItem37 = new System.Windows.Forms.MenuItem(); + this.menuItem38 = new System.Windows.Forms.MenuItem(); + this.menuItem39 = new System.Windows.Forms.MenuItem(); + this.menuItem9 = new System.Windows.Forms.MenuItem(); + this.menuItem12 = new System.Windows.Forms.MenuItem(); + this.menuItem14 = new System.Windows.Forms.MenuItem(); + this.menuItem33 = new System.Windows.Forms.MenuItem(); + this.menuItem29 = new System.Windows.Forms.MenuItem(); + this.menuItem30 = new System.Windows.Forms.MenuItem(); + this.menuItem2 = new System.Windows.Forms.MenuItem(); + this.menuItem16 = new System.Windows.Forms.MenuItem(); + this.menuItem17 = new System.Windows.Forms.MenuItem(); + this.menuItem18 = new System.Windows.Forms.MenuItem(); + this.menuItem19 = new System.Windows.Forms.MenuItem(); + this.menuItem3 = new System.Windows.Forms.MenuItem(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.panel1 = new System.Windows.Forms.Panel(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.contextMenu1 = new System.Windows.Forms.ContextMenu(); + this.menuItem10 = new System.Windows.Forms.MenuItem(); + this.pageSetupDialog1 = new System.Windows.Forms.PageSetupDialog(); + this.printDialog1 = new System.Windows.Forms.PrintDialog(); + this.numberedTextBoxUC1 = new NumberedTextBox.NumberedTextBoxUC(); + this.panel1.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // mainMenu1 + // + this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem1, + this.menuItem8, + this.menuItem12, + this.menuItem2}); + // + // menuItem1 + // + this.menuItem1.Index = 0; + this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem11, + this.menuItem4, + this.menuItem41, + this.menuItem40, + this.menuItem42, + this.menuItemUploadScript, + this.menuItem15, + this.menuItem13, + this.menuItem5, + this.menuItem7, + this.menuItem35, + this.menuItem34, + this.menuItem36, + this.menuItem31, + this.menuItem32, + this.menuItem6}); + this.menuItem1.Text = "File"; + // + // menuItem11 + // + this.menuItem11.Index = 0; + this.menuItem11.Text = "New"; + this.menuItem11.Click += new System.EventHandler(this.menuItem11_Click); + // + // menuItem4 + // + this.menuItem4.Index = 1; + this.menuItem4.Text = "Open..."; + this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click); + // + // menuItem41 + // + this.menuItem41.Index = 2; + this.menuItem41.Text = "-"; + // + // menuItem40 + // + this.menuItem40.Index = 3; + this.menuItem40.Text = "Import Example..."; + this.menuItem40.Click += new System.EventHandler(this.menuItem40_Click); + // + // menuItem42 + // + this.menuItem42.Index = 4; + this.menuItem42.Text = "-"; + // + // menuItemUploadScript + // + this.menuItemUploadScript.Enabled = false; + this.menuItemUploadScript.Index = 5; + this.menuItemUploadScript.Text = "Upload Your LSL script..."; + this.menuItemUploadScript.Click += new System.EventHandler(this.menuItemUploadScript_Click); + // + // menuItem15 + // + this.menuItem15.Index = 6; + this.menuItem15.Text = "-"; + // + // menuItem13 + // + this.menuItem13.Index = 7; + this.menuItem13.Shortcut = System.Windows.Forms.Shortcut.CtrlS; + this.menuItem13.Text = "Save"; + this.menuItem13.Click += new System.EventHandler(this.menuItem13_Click); + // + // menuItem5 + // + this.menuItem5.Index = 8; + this.menuItem5.Text = "Save..."; + this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click); + // + // menuItem7 + // + this.menuItem7.Index = 9; + this.menuItem7.Text = "-"; + // + // menuItem35 + // + this.menuItem35.Index = 10; + this.menuItem35.Text = "Page Setup..."; + this.menuItem35.Click += new System.EventHandler(this.menuItem35_Click); + // + // menuItem34 + // + this.menuItem34.Index = 11; + this.menuItem34.Shortcut = System.Windows.Forms.Shortcut.CtrlP; + this.menuItem34.Text = "Print"; + this.menuItem34.Click += new System.EventHandler(this.menuItem34_Click); + // + // menuItem36 + // + this.menuItem36.Index = 12; + this.menuItem36.Text = "-"; + // + // menuItem31 + // + this.menuItem31.Index = 13; + this.menuItem31.Text = "Copy to clipboard"; + this.menuItem31.Click += new System.EventHandler(this.menuItem31_Click); + // + // menuItem32 + // + this.menuItem32.Index = 14; + this.menuItem32.Text = "-"; + // + // menuItem6 + // + this.menuItem6.Index = 15; + this.menuItem6.Text = "Exit"; + this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click); + // + // menuItem8 + // + this.menuItem8.Index = 1; + this.menuItem8.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem24, + this.menuItem23, + this.menuItem25, + this.menuItem22, + this.menuItem21, + this.menuItem20, + this.menuItem26, + this.menuItem28, + this.menuItem27, + this.menuItem37, + this.menuItem9}); + this.menuItem8.Text = "Edit"; + // + // menuItem24 + // + this.menuItem24.Index = 0; + this.menuItem24.Shortcut = System.Windows.Forms.Shortcut.CtrlZ; + this.menuItem24.Text = "Undo"; + this.menuItem24.Click += new System.EventHandler(this.menuItem24_Click); + // + // menuItem23 + // + this.menuItem23.Enabled = false; + this.menuItem23.Index = 1; + this.menuItem23.Shortcut = System.Windows.Forms.Shortcut.CtrlY; + this.menuItem23.Text = "Redo"; + this.menuItem23.Click += new System.EventHandler(this.menuItem23_Click); + // + // menuItem25 + // + this.menuItem25.Index = 2; + this.menuItem25.Text = "-"; + // + // menuItem22 + // + this.menuItem22.Index = 3; + this.menuItem22.Shortcut = System.Windows.Forms.Shortcut.CtrlX; + this.menuItem22.Text = "Cut"; + this.menuItem22.Click += new System.EventHandler(this.menuItem22_Click); + // + // menuItem21 + // + this.menuItem21.Index = 4; + this.menuItem21.Shortcut = System.Windows.Forms.Shortcut.CtrlC; + this.menuItem21.Text = "Copy"; + this.menuItem21.Click += new System.EventHandler(this.menuItem21_Click); + // + // menuItem20 + // + this.menuItem20.Index = 5; + this.menuItem20.Shortcut = System.Windows.Forms.Shortcut.CtrlV; + this.menuItem20.Text = "Paste"; + this.menuItem20.Click += new System.EventHandler(this.menuItem20_Click); + // + // menuItem26 + // + this.menuItem26.Index = 6; + this.menuItem26.Shortcut = System.Windows.Forms.Shortcut.Del; + this.menuItem26.Text = "Delete"; + this.menuItem26.Click += new System.EventHandler(this.menuItem26_Click); + // + // menuItem28 + // + this.menuItem28.Index = 7; + this.menuItem28.Shortcut = System.Windows.Forms.Shortcut.CtrlA; + this.menuItem28.Text = "Select All"; + this.menuItem28.Click += new System.EventHandler(this.menuItem28_Click); + // + // menuItem27 + // + this.menuItem27.Index = 8; + this.menuItem27.Text = "-"; + // + // menuItem37 + // + this.menuItem37.Index = 9; + this.menuItem37.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem38, + this.menuItem39}); + this.menuItem37.Text = "Advanced"; + // + // menuItem38 + // + this.menuItem38.Index = 0; + this.menuItem38.Text = "Format Document"; + this.menuItem38.Click += new System.EventHandler(this.menuItem38_Click); + // + // menuItem39 + // + this.menuItem39.Enabled = false; + this.menuItem39.Index = 1; + this.menuItem39.Text = "Format Selection"; + this.menuItem39.Click += new System.EventHandler(this.menuItem39_Click); + // + // menuItem9 + // + this.menuItem9.Enabled = false; + this.menuItem9.Index = 10; + this.menuItem9.Text = "Word wrap"; + this.menuItem9.Click += new System.EventHandler(this.menuItem9_Click); + // + // menuItem12 + // + this.menuItem12.Index = 2; + this.menuItem12.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem14, + this.menuItem33, + this.menuItem29, + this.menuItem30}); + this.menuItem12.Text = "Compiler"; + // + // menuItem14 + // + this.menuItem14.Index = 0; + this.menuItem14.Shortcut = System.Windows.Forms.Shortcut.F5; + this.menuItem14.Text = "Start"; + this.menuItem14.Click += new System.EventHandler(this.menuItem14_Click); + // + // menuItem33 + // + this.menuItem33.Index = 1; + this.menuItem33.Text = "Compiler Window"; + this.menuItem33.Click += new System.EventHandler(this.menuItem33_Click); + // + // menuItem29 + // + this.menuItem29.Index = 2; + this.menuItem29.Text = "-"; + // + // menuItem30 + // + this.menuItem30.Index = 3; + this.menuItem30.Text = "Properties..."; + this.menuItem30.Click += new System.EventHandler(this.menuItem30_Click); + // + // menuItem2 + // + this.menuItem2.Index = 3; + this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem16, + this.menuItem17, + this.menuItem18, + this.menuItem19, + this.menuItem3}); + this.menuItem2.Text = "Help"; + // + // menuItem16 + // + this.menuItem16.Index = 0; + this.menuItem16.Shortcut = System.Windows.Forms.Shortcut.F1; + this.menuItem16.Text = "Index..."; + this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click); + // + // menuItem17 + // + this.menuItem17.Index = 1; + this.menuItem17.Text = "-"; + // + // menuItem18 + // + this.menuItem18.Index = 2; + this.menuItem18.Text = "Check for Updates"; + this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click); + // + // menuItem19 + // + this.menuItem19.Index = 3; + this.menuItem19.Text = "-"; + // + // menuItem3 + // + this.menuItem3.Index = 4; + this.menuItem3.Text = "About..."; + this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); + // + // panel1 + // + this.panel1.Controls.Add(this.tabControl1); + this.panel1.Controls.Add(this.statusStrip1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(592, 353); + this.panel1.TabIndex = 2; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(592, 331); + this.tabControl1.TabIndex = 1; + this.tabControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl1_MouseDown); + // + // tabPage1 + // + this.tabPage1.BackColor = System.Drawing.Color.Transparent; + this.tabPage1.Controls.Add(this.numberedTextBoxUC1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(584, 305); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "New"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 331); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(592, 22); + this.statusStrip1.TabIndex = 2; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(19, 17); + this.toolStripStatusLabel1.Text = "..."; + // + // contextMenu1 + // + this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem10}); + // + // menuItem10 + // + this.menuItem10.Index = 0; + this.menuItem10.Text = "Close"; + this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click); + // + // numberedTextBoxUC1 + // + this.numberedTextBoxUC1.BackColor = System.Drawing.SystemColors.Control; + this.numberedTextBoxUC1.Dock = System.Windows.Forms.DockStyle.Fill; + this.numberedTextBoxUC1.Location = new System.Drawing.Point(3, 3); + this.numberedTextBoxUC1.Name = "numberedTextBoxUC1"; + this.numberedTextBoxUC1.Size = new System.Drawing.Size(578, 299); + this.numberedTextBoxUC1.TabIndex = 1; + // + // Form1 + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(592, 353); + this.Controls.Add(this.panel1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.IsMdiContainer = true; + this.Menu = this.mainMenu1; + this.Name = "Form1"; + this.Text = "LSL-Editor"; + this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing); + this.Load += new System.EventHandler(this.Form1_Load); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.ResumeLayout(false); + + } + #endregion + + private void Start(string[] args) + { + this.FullDebug = true; + + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false); + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US", false); + + string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + this.Text += " " + strVersion; + + // load the keywords and colors, give handle to codecompletion listBox + this.numberedTextBoxUC1.TextBox.Init("ConfLSL.xml"); + + if (args.Length == 0) + { + this.numberedTextBoxUC1.TextBox.GetExampleFile(); + this.saveFileDialog1.FileName = "new.lsl"; + this.menuItem13.Text = "Save new.lsl"; + this.menuItem13.Enabled = false; + } + else + { + this.numberedTextBoxUC1.TextBox.LoadFile(args[0]); + this.tabControl1.TabPages[0].Text = Path.GetFileName(args[0]); + this.menuItem13.Text = "Save " + Path.GetFileName(args[0]); + this.menuItem13.Enabled = true; + this.saveFileDialog1.FileName = args[0]; + } + this.numberedTextBoxUC1.TextBox.ToolTipping = true; + this.numberedTextBoxUC1.TextBox.isDirty = false; + } + + // close application + private void menuItem6_Click(object sender, System.EventArgs e) + { + this.Close(); + } + + // reading file + private void menuItem4_Click(object sender, System.EventArgs e) + { + if (this.numberedTextBoxUC1.TextBox.isDirty) + { + DialogResult dialogResult = MessageBox.Show(this, @"Save """ + this.tabControl1.TabPages[0].Text + @"""?", "cap", MessageBoxButtons.YesNoCancel); + if (dialogResult == DialogResult.Yes) + dialogResult = SaveCurrentFile(); + if (dialogResult == DialogResult.Cancel) + return; + } + this.openFileDialog1.Filter = "Secondlife script files (*.lsl)|*.lsl|All files (*.*)|*.*"; + if (this.openFileDialog1.ShowDialog() == DialogResult.OK) + { + if (File.Exists(this.openFileDialog1.FileName)) + { + this.numberedTextBoxUC1.TextBox.LoadFile(this.openFileDialog1.FileName); + this.numberedTextBoxUC1.TextBox.isDirty = false; + this.saveFileDialog1.FileName = this.openFileDialog1.FileName; + this.tabControl1.TabPages[0].Text = Path.GetFileName(this.openFileDialog1.FileName); + + this.menuItem13.Text = "Save " + Path.GetFileName(this.openFileDialog1.FileName); + this.menuItem13.Enabled = true; + this.saveFileDialog1.FileName = this.openFileDialog1.FileName; + } + } + } + + // save current file + private DialogResult SaveCurrentFile() + { + this.saveFileDialog1.Filter = "Secondlife script files (*.lsl)|*.lsl|All files (*.*)|*.*"; + DialogResult dialogresult = this.saveFileDialog1.ShowDialog(); + if (dialogresult == DialogResult.OK) + { + this.numberedTextBoxUC1.TextBox.SaveFile(this.saveFileDialog1.FileName, RichTextBoxStreamType.PlainText); + this.tabControl1.TabPages[0].Text = Path.GetFileName(this.saveFileDialog1.FileName); + this.menuItem13.Text = "Save " + Path.GetFileName(this.saveFileDialog1.FileName); + this.menuItem13.Enabled = true; + this.numberedTextBoxUC1.TextBox.isDirty = false; + } + return dialogresult; + } + + private void menuItem5_Click(object sender, System.EventArgs e) + { + SaveCurrentFile(); + } + + // about + private void menuItem3_Click(object sender, System.EventArgs e) + { + //About about = new About(this); + //about.ShowDialog(this); + } + + // toggle word wrap + private void menuItem9_Click(object sender, System.EventArgs e) + { + this.menuItem9.Checked = !this.menuItem9.Checked; + this.numberedTextBoxUC1.TextBox.WordWrap = (this.menuItem9.Checked); + } + + private void StartCompiler() + { + compiler = new Compiler(this.FullDebug, "ConfLSL.xml", this.numberedTextBoxUC1.TextBox.Text); + if (compiler.CompilerErrors != null) + { + MessageBox.Show(compiler.CompilerErrors, "compiler errors"); + return; + } + + if (this.menuItem33.Checked) + { + compiler.ShowDialog(this); + } + else + { + TabPage tabPage = null; + for (int intI = 0; intI < this.tabControl1.TabPages.Count; intI++) + { + if (this.tabControl1.TabPages[intI].Text == "Compiler") + { + tabPage = this.tabControl1.TabPages[intI]; + tabPage.Controls.Clear(); + this.tabControl1.SelectedIndex = intI; + break; + } + } + if (tabPage == null) + { + tabPage = new TabPage("Compiler"); + this.tabControl1.TabPages.Add(tabPage); + this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1; + } + tabPage.Controls.Add(compiler.Controls[0]); + } + } + + // compiler + private void menuItem14_Click(object sender, System.EventArgs e) + { + StartCompiler(); + } + + // Empty current script + private void menuItem11_Click(object sender, System.EventArgs e) + { + this.tabControl1.TabPages[0].Text = "New"; + this.saveFileDialog1.FileName = "new.lsl"; + this.menuItem13.Text = "Save new.lsl"; + this.menuItem13.Enabled = false; + this.numberedTextBoxUC1.TextBox.Clear(); + this.numberedTextBoxUC1.TextBox.SelectionStart = 0; + this.numberedTextBoxUC1.TextBox.SelectionLength = 0; + this.numberedTextBoxUC1.TextBox.SelectionColor = Color.Black; + this.numberedTextBoxUC1.TextBox.isDirty = false; + } + + private void Form1_Load(object sender, System.EventArgs e) + { + try + { + RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"software\hwh\lsleditor"); + if (regKey != null) + { + this.Width = (int)regKey.GetValue("Width"); + this.Height = (int)regKey.GetValue("Height"); + this.Left = (int)regKey.GetValue("Left"); + this.Top = (int)regKey.GetValue("Top"); + this.numberedTextBoxUC1.TextBox.WordWrap = (regKey.GetValue("WordWrap").ToString() == "True"); + this.menuItem9.Checked = this.numberedTextBoxUC1.TextBox.WordWrap; + this.menuItem33.Checked = (regKey.GetValue("CompilerInWindow").ToString() == "True"); + regKey.GetValue("Unknown").ToString(); + this.FullDebug = true; + this.menuItemUploadScript.Enabled = true; + } + } + catch + { + } + //this.Activate(); + } + + private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"software\hwh\lsleditor"); + if (regKey != null) + { + regKey.SetValue("Width", this.Width); + regKey.SetValue("Height", this.Height); + regKey.SetValue("Top", this.Top); + regKey.SetValue("Left", this.Left); + regKey.SetValue("WordWrap", this.numberedTextBoxUC1.TextBox.WordWrap); + regKey.SetValue("CompilerInWindow", this.menuItem33.Checked); + regKey.Flush(); + regKey.Close(); + } + if (this.numberedTextBoxUC1.TextBox.isDirty) + { + DialogResult dialogResult = MessageBox.Show(this, @"Save """ + this.tabControl1.TabPages[0].Text + @"""?", "cap", MessageBoxButtons.YesNoCancel); + if (dialogResult == DialogResult.Yes) + dialogResult = SaveCurrentFile(); + e.Cancel = (dialogResult == DialogResult.Cancel); + } + } + + // F1 + private void ShowHelp() + { + string strKeyWord = this.numberedTextBoxUC1.TextBox.GetCurrentKeyWord(false); + + string strUrl = this.numberedTextBoxUC1.TextBox.HelpUrl + "wakka.php?wakka=" + strKeyWord; + + if (strKeyWord == "") + strKeyWord = "Help"; + + ShowWebBrowser(strKeyWord, strUrl); + } + + // show context menu for tab headers + private void tabControl1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + for (int intI = 1; intI < tabControl1.TabCount; intI++) + { + Rectangle rt = tabControl1.GetTabRect(intI); + if (e.X > rt.Left && e.X < rt.Right + && e.Y > rt.Top && e.Y < rt.Bottom) + { + this.contextMenu1.Show(this.tabControl1, new Point(e.X, e.Y)); + } + } + } + } + + // close tab + private void menuItem10_Click(object sender, System.EventArgs e) + { + if (this.tabControl1.SelectedIndex > 0) + this.tabControl1.TabPages.RemoveAt(this.tabControl1.SelectedIndex); + } + + private void menuItem13_Click(object sender, System.EventArgs e) + { + // save as current file + this.numberedTextBoxUC1.TextBox.SaveFile(this.saveFileDialog1.FileName, RichTextBoxStreamType.PlainText); + this.numberedTextBoxUC1.TextBox.isDirty = false; + } + + private void menuItem16_Click(object sender, System.EventArgs e) + { + ShowHelp(); + } + + private void menuItem18_Click(object sender, System.EventArgs e) + { + ShowWebBrowser("Check for Updates", this.numberedTextBoxUC1.TextBox.UpdateUrl); + } + + private void menuItem22_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.Cut(); + } + + private void menuItem21_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.Copy(); + } + + private void menuItem20_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.Paste(); + } + + private void menuItem26_Click(object sender, System.EventArgs e) + { + if (this.numberedTextBoxUC1.TextBox.SelectedText == "") + this.numberedTextBoxUC1.TextBox.SelectionLength = 1; + this.numberedTextBoxUC1.TextBox.SelectedText = ""; + } + + private void menuItem28_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.SelectAll(); + } + + private void menuItem24_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.UndoPlus(); + } + + private void menuItem23_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.Redo(); + } + + private void menuItem30_Click(object sender, System.EventArgs e) + { + SimProperties props = new SimProperties(); + props.Icon = this.Icon; + props.ShowDialog(this); + } + + private void menuItem31_Click(object sender, System.EventArgs e) + { + this.numberedTextBoxUC1.TextBox.ToClipBoard(); + } + + private void menuItem33_Click(object sender, System.EventArgs e) + { + this.menuItem33.Checked = !this.menuItem33.Checked; + } + + private void menuItem35_Click(object sender, System.EventArgs e) + { + PrintDocument docPrn = new PrintDocument(); + docPrn.DocumentName = this.saveFileDialog1.FileName; + this.pageSetupDialog1.Document = docPrn; + this.pageSetupDialog1.ShowDialog(); + } + + private void menuItem34_Click(object sender, System.EventArgs e) + { + this.printDialog1.AllowPrintToFile = true; + PrintDocument docPrn = new PrintDocument(); + docPrn.DocumentName = this.saveFileDialog1.FileName; + this.printDialog1.Document = docPrn; + if (this.printDialog1.ShowDialog() == DialogResult.OK) + { + try + { + docPrn.PrintPage += new PrintPageEventHandler(printDoc_PrintPage); + docPrn.Print(); + } + catch + { + MessageBox.Show("Error While Printing", "Print Error"); + } + } + } + + private void printDoc_PrintPage(Object sender, PrintPageEventArgs e) + { + this.numberedTextBoxUC1.TextBox.Print(0, this.numberedTextBoxUC1.TextBox.Text.Length, e); + } + + private void menuItem38_Click(object sender, EventArgs e) + { + // Format Document + AutoFormatter autoFormatter = new AutoFormatter(); + this.numberedTextBoxUC1.TextBox.Text = + autoFormatter.ApplyFormatting(this.numberedTextBoxUC1.TextBox.Text); + } + + private void menuItem39_Click(object sender, EventArgs e) + { + // Format Selection + AutoFormatter autoFormatter = new AutoFormatter(); + this.numberedTextBoxUC1.TextBox.SelectedText = + autoFormatter.ApplyFormatting(this.numberedTextBoxUC1.TextBox.SelectedText); + } + + private void menuItem40_Click(object sender, EventArgs e) + { + ShowWebBrowser("Import Examples", this.numberedTextBoxUC1.TextBox.ExamplesUrl); + } + + private void ShowWebBrowser(string strTabName, string strUrl) + { + TabPage tabPage = new TabPage(strTabName); + + WebBrowser axWebBrowser1 = new WebBrowser(); + tabPage.Controls.Add(axWebBrowser1); + this.tabControl1.TabPages.Add(tabPage); + this.tabControl1.SelectedIndex = this.tabControl1.TabCount - 1; + + axWebBrowser1.Dock = DockStyle.Fill; + axWebBrowser1.StatusTextChanged += new EventHandler(axWebBrowser1_StatusTextChanged); + axWebBrowser1.Navigating += new WebBrowserNavigatingEventHandler(axWebBrowser1_Navigating); + axWebBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(axWebBrowser1_DocumentCompleted); + axWebBrowser1.Navigate(strUrl); + } + + void axWebBrowser1_StatusTextChanged(object sender, EventArgs e) + { + WebBrowser axWebBrowser1 = sender as WebBrowser; + this.toolStripStatusLabel1.Text = axWebBrowser1.StatusText; + } + + + void axWebBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) + { + string strUrl = e.Url.ToString(); + if (strUrl.EndsWith(".lsl")) + { + e.Cancel = true; + if (MessageBox.Show("Import LSL script?", "Import script", MessageBoxButtons.OKCancel) == DialogResult.Cancel) + return; + + WebBrowser axWebBrowser1 = sender as WebBrowser; + axWebBrowser1.Stop(); + + // download the url + this.numberedTextBoxUC1.TextBox.LoadFile(strUrl); + this.numberedTextBoxUC1.TextBox.isDirty = true; + + // Delete webbrowser? + // axWebBrowser1.Dispose(); + // this.tabControl1.TabPages.RemoveAt(this.tabControl1.TabCount - 1); + + int intI = strUrl.LastIndexOf("/"); + if (intI > 0) + { + string strName = strUrl.Substring(intI + 1); + this.tabControl1.TabPages[0].Text = strName; + this.menuItem13.Text = "Save " + strName; + this.menuItem13.Enabled = false; + this.saveFileDialog1.FileName = strName; + } + + this.tabControl1.SelectedIndex = 0; + } + } + + void axWebBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) + { + WebBrowser axWebBrowser1 = sender as WebBrowser; + if (e.Url.ToString() == this.numberedTextBoxUC1.TextBox.UploadUrl) + { + HtmlElement element = axWebBrowser1.Document.GetElementById("SourceCode"); + if (element != null) + { + //if(element.InnerText.Trim()=="") + element.InnerText = this.numberedTextBoxUC1.TextBox.Text; + + // Makepictures + Size oldSize = this.Size; + this.Size = new Size(640, 480); + + Bitmap bitmap; + ImageManipulation.GetBitmapFromControl helper = new ImageManipulation.GetBitmapFromControl(); + + this.tabControl1.SelectedIndex = 0; + bitmap = helper.GetOctreeQuantizedBitmap(this, false); + bitmap.Save(@"d:\temp\test1.gif", ImageFormat.Gif); + + element = axWebBrowser1.Document.GetElementById("File1"); + if (element != null) + { + element.SetAttribute("value", @"d:\temp\test1.gif"); + element.OuterHtml = @""; + } + + if (this.tabControl1.TabPages[1].Text.Contains("Compiler")) + { + this.tabControl1.SelectedIndex = 1; + bitmap = helper.GetOctreeQuantizedBitmap(this, false); + bitmap.Save(@"d:\temp\test2.gif", ImageFormat.Gif); + + element = axWebBrowser1.Document.GetElementById("File2"); + if (element != null) + element.SetAttribute("value", @"d:\temp\test2.gif"); + } + + this.tabControl1.SelectedIndex = this.tabControl1.TabPages.Count - 1; + this.Size = oldSize; + } + } + } + + private void UploadScript() + { + //ShowWebBrowser("Upload", this.numberedTextBoxUC1.TextBox.UploadUrl); + + ArrayList pictures = new ArrayList(); + Size oldSize = this.Size; + int intSelectedTab = this.tabControl1.SelectedIndex; + this.Size = new Size(640, 480); + + Bitmap bitmap; + ImageManipulation.GetBitmapFromControl helper = new ImageManipulation.GetBitmapFromControl(); + + this.tabControl1.SelectedIndex = 0; + bitmap = helper.GetOctreeQuantizedBitmap(this, false); + string strTempFileName = Path.GetTempFileName() + ".gif"; + bitmap.Save(strTempFileName, ImageFormat.Gif); + pictures.Add(strTempFileName); + + for (int intI = 1; intI < this.tabControl1.TabPages.Count; intI++) + { + if (this.tabControl1.TabPages[intI].Text.Contains("Compiler")) + { + this.tabControl1.SelectedIndex = intI; + bitmap = helper.GetOctreeQuantizedBitmap(this, false); + strTempFileName = Path.GetTempFileName() + ".gif"; + bitmap.Save(strTempFileName, ImageFormat.Gif); + pictures.Add(strTempFileName); + break; + } + } + this.tabControl1.SelectedIndex = intSelectedTab; + this.Size = oldSize; + + UploadExamle u = new UploadExamle( + Path.GetFileName(this.saveFileDialog1.FileName), + this.numberedTextBoxUC1.TextBox.UploadUrl, + this.numberedTextBoxUC1.TextBox.Text, + pictures); + u.ShowDialog(this); + + // cleanup + foreach (string strFileName in pictures) + { + File.Delete(strFileName); + } + } + + private void menuItemUploadScript_Click(object sender, EventArgs e) + { + UploadScript(); + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..23f3132 --- /dev/null +++ b/Form1.resx @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 126, 17 + + + 256, 17 + + + 17, 54 + + + 384, 17 + + + 506, 17 + + + 648, 17 + + + 42 + + + + + AAABAAcAEBAQAAAAAAAoAQAAdgAAABAQAAAAAAAAaAUAAJ4BAAAYGAAAAAAAAMgGAAAGBwAAICAQAAAA + AADoAgAAzg0AACAgAAAAAAAAqAgAALYQAAAwMBAAAAAAAGgGAABeGQAAMDAAAAAAAACoDgAAxh8AACgA + AAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAgAAAAACAAACA + gACAAIAAgICAAMDAwAAA/wAA/wAAAP//AAAAAP8AAP//AAAAAAD///8AERERERERERERERERERERERER + ERERERERERERERERERERAAAAAAABEXF//////wEREX+IiIiPgBF3F/f////wEREX+I//+PARdxf/d3d3 + +AEREX//////AXdxeqqqq7wBEREXd3d3d3ERERERERERERERERERERERERERERERERH//wAA//8AAP// + AAD//xERwAd4iEAHiIjAA4iIIAMREeADd/8gAf//8AH//xABERH4ARf//////////////xERKAAAABAA + AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAALJOHQDfjScAeEQoAN+QLgCGUzkAtHU7ANSU + SQDnoEkA6KNOALF8WQBmZmYAtIprAICJiQC+oYwAlJSQAIuWlwCPlpcAmZydAKOlpAC2r6UAlKKsALay + rAC7tq4AuLaxAM3FugDJzMwAz9DNANDQ0ADO09MAy93hANbh5ADW5OgA1+frAOLp6wDn7O0A2OrvANnq + 7wDo8vUA6/T3APP29wAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoKCgoKCgoKCgoKCgoKCgoKCgoKCgo + KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgKCgoKCgoKCgoKKCgoKCgAAAAAAAAAAAAAAAooKBco + CSMjIyMjIyMjIwAKKCgoKAkgHBkZGRkZGSUNAgooFhEoCR0QKSkpKSchJAUKKCgoKAkjFBspKSkpHiYL + CigTDigJHyMMDAwMDA8iGgUKKCgoKAkjIyMjIyMjIyMFChgVEigJAwEBAQEBCAcGBQQoKCgoKAAAAAAA + AAAAAAAoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo//94iv// + AAD//zMV4AdrbsADAqNAA6OjwAFvkyABAADgAQAAIABnfvAApaQQAKSk+AGYjv//NgD//zEG//9RlCgA + AAAYAAAAMAAAAAEACAAAAAAAoAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwb+/APr5+QDQy8oA0szKAKGQ + iQCikIgA18jBAHdEKgB3Ri4AjlY5AKp0WQB1UkAAoXFZAHRSQQBxU0QAhmdYAK+MegCykYEAopKKALqy + rgDPy8kAe0gtAJFZOwCxeVkAtH5fAJ1uVQCeb1YAdFNBAIZmVQCGZ1YAu5mGALycigC6m4oAwKaXAJOA + dQCmlIoA3dLMALyzrgDAubUAp25MALJ6WQDBl30Awpl/ALOPegC7nIoAupuJAMCnmADCqZoAqJeNANzS + zADCurUArFITAL9oLgCUhHkArJuPAMrGwwChVxsAwp+DAMG3rwDEu7QA3GkAANaofgDTwK8AwLGkAMa4 + qwDebwAA3W8AANxtAADGuKoA0snAANDIwADpiiUA95w3AO+YPADgtogA37WIAN61iADftokA37eKANXL + wADXzcEA0ci8AOWsWwDotGUA6LVlAOu5aADpuGwA67tvAOq7cQDluHMA3bV2ALa2tQChpaQA2NzbANfb + 2gDg//8AkpubAJOZmQCgpaUAnaKiAKGvsACvuLkA3u7wANzs7gDd5eYA3vr/AOL7/wCdqqwAtbu8ALDA + wwDg6uwA2+XnAO7z9ADd8fYAv9HVAMLT1wC/0NQA2uzwANPk6ADk8PMA5e7wANzk5gDP09QA7fHyAN32 + /QDP4ucAz+HmANvt8gDa7PEA2OrvAN/q7QDl8PMA3ff/AN73/wDd9v4A3PX9ANrw9wDc8PYAwNHWANvs + 8QDa6/AA4/P4AODq7QDl7/IA5O7xAN31/QDg9/8A3PL6ANjq8ADb7PIA4fH3AN7m6QDY4OMA2/P9ANry + /ADb8/4A2vL9ANfv+gDa8/8A7vL0AO3x8wD4+PkA////AP39/QDp6ekAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4eHh4eHh4eHh4eHh0Q + NgAAAAAAAAAAAAsgIS4uLi4uLi4uLi0fCg8AAAAAAEAFEj9gfZKSkpKSkpKSkpJqaRc2AAAAAEcEByuI + goCMdoGBgYGBgYGNhTAMAAAAAAAAAClolXCRkI+Pj4+Pj4N5l14WAAAAAEATBRFRiWVte6ChoaGhoXx6 + eIoaIwAAAEYzFSUqa25dAQKjo6Ojo6Nxb5MiDgAAAAAAAAAZZ35hXKWkpKSkpKSimI5fCDYAAEExBgUR + UZRsYmNjY2NjY2NkZoRyGyMAAFA8JwMyKoZ/i3Nzc3Nzc3N1dHeHLxw2AAAAAAAAGJafnJycnJycnJyb + nZ6amQk2AEU3JAUFLFNWVVRUVFRUVFVZV1hbWjk2AFI7JhQ4ADU9REJDQ0NDQ0NKSEkNKDQ2AAAAAAAA + AAA6Pk9NTU1NTU1MTE5LS0sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA////Kv///w7///8o////KP///yjwAB8o8AAPToAAB12AAAdD8AAHIIAA + Az2AAAM9+AABPYAAAT2AAABV/AAAXYAAAF2CAABd/wABVf///1X///9V////Vf///1X///9dKAAAACAA + AABAAAAAAQAEAAAAAACAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAICAAAAAAIAAAICAAIAA + gACAgIAAwMDAAAD/AAD/AAAA//8AAAAA/wAA//8AAAAAAP///wARERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAAAAAAAAAAAAAER + EREREXiIiIiIiIiIiIiAERERABF3////////////8BEREX9xF/////////////cBEREXcReP//////// + ///4AREREREXf/iIiIiIiIiP/wEREQABEX/4f4//////j/9wERF/9xF4+H+I//////j/gBERF3cRd/iH + 9//////4//ARERERERf/h/f/////+P/3ARFwAAEXj4d3d3d3d3eP+AERf//3F3+IiIiIiIiIiP8wERd3 + dxF/////////////cBEREREReP///////////4ARcAAAEXi7u7u7u7u7u7uyAX///3EXqqqqqqqqq6us + ygEXd3dxF6qqqqqqqqqqqqoBERERERF3d3d3d3d3d3d3ERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + EREREREREREREf//////////////////////////////////////////8AAAf/AAAD8wAAA/GAAAH5gA + AB/4AAAfHAAADwwAAA+MAAAP/gAABwYAAAcCAAADgwAAA/8AAAMDAAABAYAAAYGAAAH/wAAD//////// + ////////////////////////KAAAACAAAABAAAAAAQAIAAAAAACABAAAAAAAAAAAAAAAAAAAAAAAAJ44 + AACmQAAAsUsAANNtAADZcgAAmDcGAH4wCQB/MQoAlDoMAHAvDwCDNg8AcDEQAJ5CEwDBZRMAoEQVANN0 + FQCWQRYAl0IXAI9CHAChTCEAznQiANF4JgDzoScAXzsoAGpBKwCdUy4AnlMuAJ5VLwCiWDMAplw3AN+N + OwCjXjwArG5PALF0VQBeXl4As3tfALCIYwBmZmYAhHNoAG5ycgBwd3cAc3h3AHV5eAB2enkAeXt6AHl8 + egB6fHoAe317AH1+ewB+f3wAvJiEALmghgCKiooAkJCMAI6RkAD/zJkApaShAKWloQCmpaEAxLKlAKqq + qgChsLEAysG5AMC+uwDCwLwAury9AMXFwgDGxsMAvsLEANnQxQDNy8cA087JANbQyQDP0M0A4NfNAOnc + 0ADs4NEAv9DUANLa2wDO4OQA0uToAOjo6ADg6OoA6urqANnp7QDY6u8A2ervANvr8ADv8/QA6fP2APj4 + +AD7+/sA/f39AAAAAAA0b/8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABdXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dJSUlJSUlJSUl + JSUlJSUlJSUlJSUlXV1dXV1dXV1dXR8SCgcGBgYGBgYGBgYGBgYGBgYGByUmXV1dXV1dXV1dCDtGRkZG + RkZGRkZGRkZGRkZGRkY+BSVdXV1dXUI2XV0gM1VVVVVVVVVVVVVVVVVVVVVVVVUTJV1dXV1dQEA/XV0M + VVVVVVVVVVVVVVVVVVVVVVVVVTILJV1dXV1dXV1dXQ5JVV9fX19fX19fX19fX19fX19VTgUlXV1dXV1d + XV1dICRVVE1NTU1NTU1NTU1NTU1NX1ZVEyVdXV1dNS4qXV1dDFVVPShfPFFfX19fX19fX01YX1UyCyVd + XV1FRT8/XV0OSVU9KF84PF9fX19fX19fUk1fVU4FJV1dXV1dXV1dXSAkVU89KFsiU1pfX19fX19cTV9X + VRMlXV1dXV1dXV1dXQxVVT0oXzRTU19fX19fX19NX1lVMgslXV05MC0qJ11dDklVPSgoKCgoKCgoKCgo + KChNX1VOBSVdXUtLSENEP10gJFVQPT09PT09PT09PT09PT1NVVUTFyVdXV1dXV1dXV0MVVVVVVVVVVVV + VVVVVVVVVVVVVTIJJV1dXV1dXV1dXQ5JVVVVVVVVVVVVVVVVVVVVVVVVTgUlXToxLywrKV1dIw0WFhYW + FhYWFhYWFhYWFhYWFhYWARglTExKR0NBP11dAAQEBAQEBAQEBAQEBAQ3DzcPXg8DASVdXV1dXV1dXV0d + AhQVHh4eHh4eHh4eHh4eHh4eHgMFXV1dXV1dXV1dXV0hHBsaGRkZGRkZGRkZGRkZGRkQEV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1d//////////////////////////////////////gAAD/wAAAf8AAAHzAAAB8YAAAP+AAAD/gA + AA8cAAAHDAAAB/wAAAf+AAADBgAAAwIAAAH/AAAB/wAAAQMAAAABgAAA/4AAAf/AAAP///////////// + //////////////////8oAAAAMAAAAGAAAAABAAQAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AACAAAAAgIAAAAAAgAAAgIAAgACAAICAgADAwMAAAP8AAP8AAAD//wAAAAD/AAD//wAAAAAA////ABER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAAAAAAAAAAAAA + AAAAAAABERERERERERd3d3d3d3d3d3d3d3d3d3cgERERERERERd///////////////////ggERERERAB + ERc///////////////////8wEREREX/wERF4//////////////////9yARERERd3ERF3//////////// + //////+CARERERERERFz///////////////////zAREREREREREXj//////////////////3IBERERER + EREXf/iIiIiIiIiIiIiIj//4IBERERAAAREXP/+If/h/////////j///MBEREX//8BEReP+IeP9///// + ////iP//cgERERd3dxERd//4d/94////////+P//ggERERERERERc//4h4+H////////+P//8wERERER + ERERF4/4h3/3////////+I//9yARERERERERF3//h3j4f///////+I//+CARERAAAAERFz//iHd3d3d3 + d3d3d4j//zAREX////AREXj/iIiIiIiIiIiIiIj//3IBERd3d3cREXf//////////////////4IBERER + EREREXP///////////////////MBEREREREREReP//////////////////cgERERERERERd///////// + //////////ggERAAAAABERd6qqqqqqqqqqqqqqqqqqowEX/////wERF6qqqqqqqqqqqqq7q7rMMyARd3 + d3d3ERF6qqqqqqqqqqqqqrqrp8cyAREREREREREXu7u7u7u7u7u7u7u7u7uyARERERERERERd3d3d3d3 + d3d3d3d3d3d3ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + EREREREREREREf///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// + /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP4AAAAB/wAA/gAAAAD/ + AAD+AAAAAP8AAJ4AAAAA/wAADwAAAAB/AACPAAAAAH8AAP8AAAAAfwAA/4AAAAA/AAD/gAAAAD8AAIeA + AAAAPwAAA8AAAAAfAACDwAAAAB8AAP/AAAAAHwAA/+AAAAAPAAD/4AAAAA8AAIHgAAAADwAAAPAAAAAH + AACA8AAAAAcAAP/wAAAABwAA//gAAAADAAD/+AAAAAMAAIB4AAAAAwAAADwAAAABAACAPAAAAAEAAP/+ + AAAAAQAA//8AAAADAAD///////8AAP///////wAA////////AAD///////8AAP///////wAA//////// + AAD///////8AAP///////wAA////////AAD///////8AACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAA + AAAAAAAAAAAAAAAAAACQMAAAmTMAAKE7AACtRwAAu1UAAMNdAADMZgAA020AAN13AAD2kAAAoz0BAIYv + BACbNwQAzGkGAKNEDQBwMRAAnkITAHQ1FAAVFRUAaTIVAKBEFQDTdBUA4oMVAJhDGACgSh4Ao0sfAKFM + IQCaSyMAp08jAJ1NJQClUCUAXzsoAFw9LABhQS8AvHYxANB9MQDeijcAODg4AG5LOADaiTkAvHM9AOGQ + PwB5U0AA3I5AAKxqSQBNTU0AnWhNALN/YwBmZmYAtYRqAO+sagD1s2oAcXFxAHB3dwC4jncAdXp6APa7 + fwD6v38Ae4SEALyYhAB7aoYAh5KSAJOcnACXpaUAmaioAJqmqQCqqqoAra2rAJ+srACvr6wAq66uALSy + rgC3tbAAvLixAL24sQDBu7MAw720AMrCtwDLwrcApra4ANXJuwDXyrwArLy9ANnLvQDczr4A4NDAAOTT + wQDq18QA69jEAPLcxwD13sgAtMXJAM/QzQDGzc4AuszRALvN0gC/0NQAwtPWAMbV2QDJ19sA0trbANvb + 2wDJ2t4Ay9zgANfc4ADa3eEA3uHjAPjw4wDf4uQA2OLlAPjy5QDk5uYA3uLnAOXm5wDS5OgA3OXoAOzr + 6ADr6+kA7uzpAPn06QDq6uoA8u/rAPr16wDW6OwA9vLsAOPr7QD59O0A2OrvANnq7wDo7u8A2+vwAOvt + 8ADt7/AA3ezxAODu8gDv8fIA7vDzAPLz8wD19PMA5fH0APf29AD69/UA6fP2APz69gDt9fcA9/f3APX3 + +ADy+PkA+fz8AAAAAAA0b/8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZUwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMJWVlZWVlZWVlZWVlZWV + lQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQERMJWVlZWVlZWVlZWVlZWVlQEvNjY2NjY2NjY2 + NjY2NjY2NjY2NjY2NjY2NjY2NiwBITCVlZWVlZWVlZWVlZWVlQExf39/f39/f39/f39/f39/f39/f39/ + f39/f39/f2QBEzCVlZWVlZWVlTAwlZWVlRcQf39/f39/f39/f39/f39/f39/f39/f39/f39/f38aGDCV + lZWVlZWVa1RJMJWVlZUBXH9/f39/f39/f39/f39/f39/f39/f39/f39/f387ASAwlZWVlZWVlXZscJWV + lZUAMX9/f39/f39/f39/f39/f39/f39/f39/f39/f39kAQ8wlZWVlZWVlZWVlZWVlZUXEH9/f39/f39/ + f39/f39/f39/f39/f39/f39/f39/GgswlZWVlZWVlZWVlZWVlZWVAVx/f5eXl5eXl5eXl5eXl5eXl5eX + l5eXl5eXhX9/OwEfMJWVlZWVlZWVlZWVlZWVADF/f3I/T15eXl5eXl5eXl5eXl5eXl5eXl+XkH9/ZAEP + MJWVlZWVlTAwMDCVlZWVFxB/f38/QDVzc3Nzc3Nzc3Nzc3Nzc3NzbV6Bl39/fxoLMJWVlZWVblhRTEcw + lZWVlQFcf39hPzVGl5cSl5eXl5eXl5eXl5eXl2Bjl4Z/fzsBHzCVlZWVlXx0b2lwlZWVlQAxf397Pz41 + eJclZZeXl5eXl5eXl5eXl21el5N/f2QBDzCVlZWVlZWVlZWVlZWVlRcQf39/Uj81RpdCNJeXl5eXl5eX + l5eXl5JefZeAf38aGTCVlZWVlZWVlZWVlZWVlZUBXH9/Zj81N5eRLZeXl5eXl5eXl5eXl5dgYpeLf387 + AR8wlZWVlZWVlZWVlZWVlZUBMX9/fz89NUaXQkKXl5eXl5eXl5eXl5dBXpeUf39kAQ8wlZWVlTAwMDAw + MJWVlZUdEH9/f1I/NTU1NTU1NTU1NTU1NTU1NTU6W12Xgn9/GhkwlZWVd1lWU05KRTCVlZWVAVx/f2c/ + Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/P0SXjn9/OwEfMJWVlX55dXFqaHCVlZWVATF/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/ZAEPMJWVlZWVlZWVlZWVlZWVHRB/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + fxoZMJWVlZWVlZWVlZWVlZWVlQFcf39/f39/f39/f39/f39/f39/f39/f39/f39/fzsBHzCVlZWVlZWV + lZWVlZWVlQExf39/f39/f39/f39/f39/f39/f39/f39/f39/f2QBDzCVlTAwMDAwMDAwlZWVlR0CCQkJ + CQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkDHjCVelpXVVBNS0hDMJWVlZUBBwgICAgICAgICAgICAgI + CAgICAg5OQgzORaWliIEASYwlY+NjIqJh4SDiJWVlZUUDg0GBgYGBgYGBgYGBgYGBgYGBgYyOBUpOCku + ljwFASowlZWVlZWVlZWVlZWVlZWVAQojKyQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCcoATCVlZWVlZWV + lZWVlZWVlZWVlRwBAQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBG5WVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV////////AAD///////8AAP// + /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA//////// + AAD///////8AAP8AAAAA/wAA/gAAAAD/AAD+AAAAAH8AAP4AAAAAfwAAngAAAAB/AAAPAAAAAD8AAI8A + AAAAPwAA/wAAAAA/AAD/gAAAAB8AAP+AAAAAHwAAh4AAAAAfAAADwAAAAA8AAIPAAAAADwAA/8AAAAAP + AAD/4AAAAAcAAP/gAAAABwAAgeAAAAAHAAAA8AAAAAMAAIDwAAAAAwAA//AAAAADAAD/+AAAAAEAAP/4 + AAAAAQAAgHgAAAABAAAAPAAAAAAAAIA8AAAAAAAA//4AAAABAAD//wAAAAMAAP///////wAA//////// + AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// + /////wAA + + + \ No newline at end of file diff --git a/GotoWindow.Designer.cs b/GotoWindow.Designer.cs new file mode 100644 index 0000000..a159024 --- /dev/null +++ b/GotoWindow.Designer.cs @@ -0,0 +1,104 @@ +namespace LSLEditor +{ + partial class GotoWindow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(42, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Line nr:"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(16, 32); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(224, 20); + this.textBox1.TabIndex = 1; + this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(168, 56); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Cancel"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(80, 56); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 3; + this.button2.Text = "Ok"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // GotoForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(254, 90); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GotoForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Go To Line"; + this.TopMost = true; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + + } +} \ No newline at end of file diff --git a/GotoWindow.cs b/GotoWindow.cs new file mode 100644 index 0000000..6f347ee --- /dev/null +++ b/GotoWindow.cs @@ -0,0 +1,98 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class GotoWindow : Form + { + private LSLEditorForm lslEditForm; + public GotoWindow(LSLEditorForm lslEditForm) + { + InitializeComponent(); + this.Icon = lslEditForm.Icon; + this.lslEditForm = lslEditForm; + + EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; + this.label1.Text = "Line number (1-"+editForm.TextBox.Lines.Length+")"; + } + + private void button1_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void Goto() + { + EditForm editForm = this.lslEditForm.ActiveMdiForm as EditForm; + if (editForm == null) + return; + try + { + int intLine = Convert.ToInt32(this.textBox1.Text); + editForm.TextBox.Goto(intLine); + this.Close(); + } + catch + { + } + } + + private void button2_Click(object sender, EventArgs e) + { + Goto(); + } + + private void textBox1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Return) + { + Goto(); + e.SuppressKeyPress = true; + } + + } + } +} \ No newline at end of file diff --git a/GotoWindow.resx b/GotoWindow.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/GotoWindow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Helpers/AutoFormatter.cs b/Helpers/AutoFormatter.cs new file mode 100644 index 0000000..133fe49 --- /dev/null +++ b/Helpers/AutoFormatter.cs @@ -0,0 +1,373 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Text; + +using System.Collections.Generic; + +namespace LSLEditor +{ + class AutoFormatter + { + public static string GetTab() + { + if (Properties.Settings.Default.SL4SpacesIndent) + return " "; + else + return "\t"; + } + + private static int CountParenthesis(string strLine) + { + int intParenthesis=0; + bool blnWithinString = false; + for (int intI = 0; intI < strLine.Length; intI++) + { + if (strLine[intI] == '"') + blnWithinString = !blnWithinString; + if (blnWithinString) + { + if (strLine[intI] == '\\') + intI++; + continue; + } + if (strLine[intI] == '/') + { + if(intI<(strLine.Length-1)) + if (strLine[intI + 1] == '/') + break; + } + if (strLine[intI] == '{') + intParenthesis++; + if (strLine[intI] == '}') + intParenthesis--; + } + return intParenthesis; + } + + private static int GetTabCountFromWhiteSpace(string strWhiteSpace) + { + int intSpaces = 0; + for (int intI = 0; intI < strWhiteSpace.Length; intI++) + { + if(strWhiteSpace[intI]==' ') + intSpaces++; + if (strWhiteSpace[intI] == '\t') + intSpaces = (int)(6 * (intSpaces / 6)) + 6 - (intSpaces % 6); + } + if (Properties.Settings.Default.SL4SpacesIndent) + return intSpaces / 4; + else + return intSpaces / 6; + } + + public static string GetWhiteSpaceFromLine(string strLine) + { + StringBuilder sb = new StringBuilder(); + for (int intI = 0; intI < strLine.Length; intI++) + { + if (strLine[intI] > ' ') + break; + sb.Append(strLine[intI]); + } + return sb.ToString(); + } + + private static int GetTabCountFromLine(string strLine, out int intOnce) + { + StringBuilder sb = new StringBuilder(); + int intCountParenthesis = CountParenthesis(strLine); + if(intCountParenthesis<0) + intCountParenthesis = 0; + for (int intI = 0; intI < strLine.Length; intI++) + { + if (strLine[intI] > ' ') + break; + sb.Append(strLine[intI]); + } + + intOnce = 0; + + strLine = TrimCommentTrim(strLine); + + int intLength = strLine.Length; + if (intLength > 0) + { + char chrLastChar = strLine[intLength - 1]; + if (strLine[0] == '{' || chrLastChar == ';' || chrLastChar == '{' || chrLastChar == '}') + intOnce = 0; + else + intOnce = 1; + // this only valid for typing + if (intCountParenthesis == 0 && chrLastChar == '{') + intCountParenthesis++; + } + + return GetTabCountFromWhiteSpace(sb.ToString()) + intCountParenthesis + intOnce; + } + + public static string RemoveComment(string strLine) + { + bool blnWithinString = false; + for (int intI = 0; intI < (strLine.Length - 1); intI++) + { + char chrC = strLine[intI]; + if (chrC == '"') + blnWithinString = !blnWithinString; + if (blnWithinString) + { + if (chrC == '\\') + intI++; + continue; + } + if (chrC != '/') + continue; + if (strLine[intI + 1] == '/') + { + strLine = strLine.Substring(0, intI); + break; + } + } + return strLine; + } + + public static string RemoveCommentsFromLines(string strLines) + { + StringBuilder sb = new StringBuilder(); + StringReader sr = new StringReader(strLines); + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + sb.AppendLine(RemoveComment(strLine)); + } + return sb.ToString(); + } + + private static string TrimCommentTrim(string strLine) + { + return RemoveComment(strLine).Trim(); + } + + public static string GetNewWhiteSpace(string[] lines, int intIndex) + { + int intTab = 0; + int intOnce = 0; + string strLine = ""; + StringBuilder sb = new StringBuilder(); + + while (intIndex>=0 && intIndex 0) + { + intTab = GetTabCountFromLine(strLine, out intOnce); + break; + } + intIndex--; + } + + if (TrimCommentTrim(strLine) != "{") + { + intIndex--; + while (intIndex >= 0 && intIndex < lines.Length) + { + strLine = lines[intIndex]; + if (TrimCommentTrim(strLine).Length > 0) + { + GetTabCountFromLine(strLine, out intOnce); + break; + } + intIndex--; + } + } + + for (int intI = 0; intI < (intTab - intOnce); intI++) + sb.Append(AutoFormatter.GetTab()); + + return sb.ToString(); + } + + public static string ApplyFormatting(int intTab, string strInput) + { + StringBuilder sb = new StringBuilder(); + StringReader sr = new StringReader(strInput); + + Stack stack = new Stack(); + stack.Push(intTab); + + int intTemp = 0; + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + + // trim whitespace, this is a clean line + strLine = strLine.Trim(); + + // empty lines do not contain tabs + if (strLine.Length == 0) + { + sb.Append('\n'); + continue; + } + + // print current line, on current indent level + int intCorrection = 0; + if (strLine[0] == '{' || strLine[0] == '}') + intCorrection--; + for (int intI = 0; intI < (intTab + intTemp + intCorrection); intI++) + sb.Append(GetTab()); + sb.Append(strLine); + sb.Append('\n'); + + + // calculate next indent level + strLine = TrimCommentTrim(strLine); + + int intParenthesis = CountParenthesis(strLine); + + if (intParenthesis > 0) + { + for (int intP = 0; intP < intParenthesis; intP++) + { + stack.Push(intTab); + if (strLine != "{") + intTab++; + } + intTab += intTemp; + intTemp = 0; + } + else if (intParenthesis < 0) + { + if (stack.Count > 0) + intTab = stack.Pop(); + intTemp = 0; + } + else + { + if (strLine.Length > 0) + { + char chrFirstChar = strLine[0]; + char chrLastChar = strLine[strLine.Length - 1]; + intTemp++; + + if (chrFirstChar == '|' || chrLastChar == '|') + intTemp = 1; + if (chrFirstChar == '+' || chrLastChar == '+') + intTemp = 1; + if (chrFirstChar == '-' || chrLastChar == '-') + intTemp = 1; + if (chrLastChar == ',' || chrLastChar == ',') + intTemp = 1; + if (chrLastChar == ';' || chrLastChar == '}') + intTemp = 0; + } + } + } + + if (!strInput.EndsWith("\n")) + return sb.ToString().TrimEnd(new char[] { '\n' }); + else + return sb.ToString(); + } + + public static string MultiLineTab(bool blnAdd, string strText) + { + string strPrefix = GetTab(); + StringBuilder sb = new StringBuilder(); + StringReader sr = new StringReader(strText); + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + if (blnAdd) + { + sb.Append(strPrefix); + } + else + { + if (strLine.StartsWith(strPrefix)) + strLine = strLine.Substring(strPrefix.Length); + } + sb.Append(strLine); + sb.Append('\n'); + } + return sb.ToString(); + } + + + public static string MultiLineComment(bool blnAdd, int intTab, string strText) + { + string strPrefix = "//"; + StringBuilder sb = new StringBuilder(); + StringReader sr = new StringReader(strText); + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + + if (blnAdd) + { + sb.Append(strPrefix); + } + else + { + strLine = strLine.Trim(); + if (strLine.StartsWith(strPrefix)) + strLine = strLine.Substring(strPrefix.Length); + } + sb.Append(strLine); + sb.Append('\n'); + } + return ApplyFormatting(intTab,sb.ToString()); + } + + } +} diff --git a/Helpers/CodeCompletion.cs b/Helpers/CodeCompletion.cs new file mode 100644 index 0000000..658a7ec --- /dev/null +++ b/Helpers/CodeCompletion.cs @@ -0,0 +1,105 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System.Drawing; +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace LSLEditor.Helpers +{ + class CodeCompletion + { + Regex regex; + + public CodeCompletion() + { + this.regex = new Regex( + @" +\b(?integer|float|string|vector|rotation|state|key|list)\s +(?> + \s* (?[\w]*) \s* + (?>\= \s* + (?: + (?> + [^(),;]+ + | \( (?) + | \) (?<-nr>) + )* + (?(nr)(?!)) + ) + \s*)? [,;)] +)* +" + , + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled); + } + + public void CodeCompletionUserVar(string strKeyWord, string strTextIn, int intStart, List list) + { + if (intStart == 0) + return; + string strText = strTextIn.Substring(0, intStart); + string strLowerCaseKeyWord = strKeyWord.ToLower(); + foreach (Match m in regex.Matches(strText)) + { + if (m.Groups.Count == 4) + { + string strType = m.Groups[1].ToString(); + foreach (Capture cap in m.Groups[2].Captures) + { + string strName = cap.ToString(); + if (strName.ToLower().StartsWith(strLowerCaseKeyWord)) + { + KeyWordInfo ki = new KeyWordInfo(KeyWordTypeEnum.Vars, strName, Color.Red); + if (!list.Contains(ki)) + list.Add(ki); + } + if (strType == "list" || strType == "vector" || strType == "rotation") + break; + } + } + } + } + } +} diff --git a/Helpers/CompilerHelper.cs b/Helpers/CompilerHelper.cs new file mode 100644 index 0000000..687d5f8 --- /dev/null +++ b/Helpers/CompilerHelper.cs @@ -0,0 +1,145 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Reflection; +using System.Windows.Forms; +using System.CodeDom.Compiler; +using Microsoft.CSharp; + +namespace LSLEditor.Helpers +{ + class CompilerHelper + { + private static int FindDefaultLineNumber(string strCode) + { + StringReader sr = new StringReader(strCode); + int intI = 0; + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + if (strLine.StartsWith("class State_default")) + return intI; + intI++; + } + return intI; + } + + public static Assembly CompileCSharp(EditForm editForm, string CSharpCode) + { + // Code compiler and provider + CodeDomProvider cc = new CSharpCodeProvider(); + + // Compiler parameters + CompilerParameters cp = new CompilerParameters(); + + // Sept 15, 2007 -> 3, 30 oct 2007 -> 4 + if(!Properties.Settings.Default.SkipWarnings) + cp.WarningLevel = 4; + + // Add common assemblies + cp.ReferencedAssemblies.Add("System.dll"); + cp.ReferencedAssemblies.Add("System.Windows.Forms.dll"); + + // LSLEditor.exe contains all base SecondLife class stuff + cp.ReferencedAssemblies.Add(Assembly.GetExecutingAssembly().Location); + + // Compiling to memory + cp.GenerateInMemory = true; + + // Does this work? + cp.IncludeDebugInformation = true; + + // Wrap strCSharpCode into my namespace + string strRunTime = "namespace LSLEditor\n{\n"; + strRunTime += CSharpCode; + strRunTime += "\n}\n"; + + int intDefaultLineNumber = FindDefaultLineNumber(strRunTime); + + // Here we go + CompilerResults cr = cc.CompileAssemblyFromSource(cp, strRunTime); + + // get the listview to store some errors + ListView ListViewErrors = editForm.parent.SyntaxErrors.ListView; + + // Console.WriteLine(cr.Errors.HasWarnings.ToString()); + // Check for compilation errors... + if (ListViewErrors != null && (cr.Errors.HasErrors || cr.Errors.HasWarnings)) + { + int intNr = 1; + foreach (CompilerError err in cr.Errors) + { + int intLine = err.Line; + if (intLine < intDefaultLineNumber) + intLine -= 4; + else + intLine -= 5; + string strError = OopsFormatter.ApplyFormatting(err.ErrorText); + int intImageIndex = 0; + if (err.IsWarning) + intImageIndex = 1; + ListViewItem lvi = new ListViewItem(new string[] { + "", // 0 + intNr.ToString(), // 1 + strError, // 2 + editForm.ScriptName, // 3 + intLine.ToString(), // 4 + err.Column.ToString(), // 5 + editForm.ProjectName , // 6 + editForm.FullPathName, // 7 + editForm.guid.ToString(),// 8 + editForm.IsScript.ToString()// 9 + } , intImageIndex); + ListViewErrors.Items.Add(lvi); + intNr++; + } + return null; + } + return cr.CompiledAssembly; + } + } +} diff --git a/Helpers/FileAssociator.cs b/Helpers/FileAssociator.cs new file mode 100644 index 0000000..4fc493c --- /dev/null +++ b/Helpers/FileAssociator.cs @@ -0,0 +1,115 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using Microsoft.Win32; + + +namespace LSLEditor.Helpers +{ + class FileAssociator + { + // Associate file extension with progID, description, icon and application + public static bool Associate(string strExtension, string strFileNameType, string strDescription, string strApplication,int intIconNr) + { + try + { + Registry.ClassesRoot.CreateSubKey(strExtension).SetValue("", strFileNameType); + if (strFileNameType != null && strFileNameType.Length > 0) + { + using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(strFileNameType)) + { + if (strDescription != null) + key.SetValue("", strDescription); + if (strApplication != null) + { + key.CreateSubKey("DefaultIcon").SetValue("", strApplication + "," + intIconNr); + key.CreateSubKey(@"Shell\Open\Command").SetValue("", "\"" + strApplication + "\" \"%1\""); + } + } + } + return true; + } + catch + { + return false; + } + } + + public static bool DeAssociate(string strExtension, string strFileNameType) + { + try + { + Registry.ClassesRoot.DeleteSubKey(strExtension); + Registry.ClassesRoot.DeleteSubKeyTree(strFileNameType); + return true; + } + catch + { + return false; + } + } + + // Return true if extension already associated in registry + public static bool IsAssociated(string strExtension) + { + try + { + return (Registry.ClassesRoot.OpenSubKey(strExtension, false) != null); + } + catch + { + return false; + } + } + + private void Test() + { + if (!IsAssociated(".lsl")) + Associate(".lsl", "LSLEditorScript", "SecondLife lsl File for LSLEditor", System.Reflection.Assembly.GetExecutingAssembly().Location, 0); + DeAssociate(".lsl", "LSLEditorScript"); + } + + } +} diff --git a/Helpers/GetTemplate.cs b/Helpers/GetTemplate.cs new file mode 100644 index 0000000..fb54fc0 --- /dev/null +++ b/Helpers/GetTemplate.cs @@ -0,0 +1,71 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Reflection; +using System.IO; + +namespace LSLEditor.Helpers +{ + class GetTemplate + { + public static string Source() + { + try + { + string strTemplate = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.ExampleTemplate); + if (File.Exists(strTemplate)) + { + StreamReader sr = new StreamReader(strTemplate); + string strCode = sr.ReadToEnd(); + sr.Close(); + return strCode; + } + } + catch + { + } + return Properties.Settings.Default.Example; + } + } +} diff --git a/Helpers/GroupboxEvent.cs b/Helpers/GroupboxEvent.cs new file mode 100644 index 0000000..9e69adc --- /dev/null +++ b/Helpers/GroupboxEvent.cs @@ -0,0 +1,190 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace LSLEditor +{ + /// + /// Summary description for GroupboxTextbox. + /// + public class GroupboxEvent : System.Windows.Forms.GroupBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + public GroupboxEvent(Point pt,string strName,string strArgs,System.EventHandler eventHandler) + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + this.Location = pt; + + string[] args = strArgs.Trim().Split(new char[] {','}); + int intX=5; + int intY=5; + + if(args.Length>0) + intY += 5; + for(int intArgumentNumber=0;intArgumentNumber["+strArgumentType+"]["+strArgumentName+"]"); + strArgumentValue = "unknown"; + break; + } + + GroupBox groupbox = new GroupBox(); + groupbox.Name = strName+"_"+intArgumentNumber; + groupbox.Text = strArgumentName; + groupbox.Location = new Point(5,intY); + groupbox.Width = this.Width - 10; + + Control control = null; + if (strName == "listen" && intArgumentNumber==0) + { + ComboBox comboBox = new ComboBox(); + comboBox.Text = ""; + control = comboBox; + } + else + { + TextBox textBox = new TextBox(); + textBox.Text = strArgumentValue; + control = textBox; + } + control.Name = "textBox_" + strName + "_" + intArgumentNumber; + control.Location = new Point(5, 15); + groupbox.Controls.Add(control); + groupbox.Height = 20 + control.Height; + this.Controls.Add(groupbox); + intY += groupbox.Height; + } + else + { + if(strArgs!="") + MessageBox.Show("Argument must be 'type name' ["+strArgs+"]"); + } + } + + intY += 5; + + Button button = new Button(); + button.Text = strName; + button.Width = 130; + button.Location = new Point(intX,intY); + button.Click += eventHandler; + this.Controls.Add(button); + this.Height = intY + button.Height + 5; + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // GroupboxTextbox + // + this.Name = "GroupboxTextbox"; + this.Size = new System.Drawing.Size(152, 96); + + } + #endregion + } +} diff --git a/Helpers/GroupboxEvent.resx b/Helpers/GroupboxEvent.resx new file mode 100644 index 0000000..b26f549 --- /dev/null +++ b/Helpers/GroupboxEvent.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + False + + + True + + + True + + + 80 + + + (Default) + + + False + + + Private + + + GroupboxTextbox + + + 8, 8 + + \ No newline at end of file diff --git a/Helpers/HTTPRequest.cs b/Helpers/HTTPRequest.cs new file mode 100644 index 0000000..9550f7a --- /dev/null +++ b/Helpers/HTTPRequest.cs @@ -0,0 +1,204 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Net; +using System.Text; + +namespace LSLEditor +{ + class HTTPRequest + { + private class UserState + { + public SecondLife secondlife; + public SecondLife.key httpkey; + public UserState(SecondLife.key httpkey, SecondLife secondlife) + { + this.secondlife = secondlife; + this.httpkey = httpkey; + } + } + + public static void Request(WebProxy proxy, SecondLife secondlife, string strUrl, SecondLife.list parameters, string postData, SecondLife.key key) + { + string strMethod = "GET"; + string strContentType = "text/plain;charset=utf-8"; + + for (int intI = 0; intI < parameters.Count; intI += 2) + { + int intKey; + if (!int.TryParse(parameters[intI].ToString(), out intKey)) + continue; + switch (intKey) + { + case 0: + // get, post, put, delete + strMethod = parameters[intI + 1].ToString().ToUpper(); + break; + case 1: + strContentType = parameters[intI + 1].ToString(); + break; + case 2: + // HTTP_BODY_MAXLENGTH + break; + case 3: + // HTTP_VERIFY_CERT + break; + default: + break; + } + } + + WebClient wc = new WebClient(); + + wc.Headers.Add("Content-Type", strContentType); + wc.Headers.Add("Accept", "text/*"); + wc.Headers.Add("Accept-Charset", "utf-8;q=1.0, *;q=0.5"); + wc.Headers.Add("Accept-Encoding", "deflate, gzip"); + wc.Headers.Add("User-Agent", "Second Life LSL/1.19.0(12345) (http://secondlife.com)"); + + System.Drawing.Point point = Properties.Settings.Default.RegionCorner; + SecondLife.vector RegionCorner = new SecondLife.vector(point.X, point.Y, 0); + + SecondLife.vector pos = secondlife.GetLocalPos(); + + wc.Headers.Add("X-SecondLife-Shard", Properties.Settings.Default.XSecondLifeShard); + wc.Headers.Add("X-SecondLife-Object-Name", secondlife.host.GetObjectName()); + wc.Headers.Add("X-SecondLife-Object-Key", secondlife.host.GetKey().ToString()); + wc.Headers.Add("X-SecondLife-Region", string.Format("{0} ({1}, {2})", Properties.Settings.Default.RegionName, (int)RegionCorner.x, (int)RegionCorner.y)); + wc.Headers.Add("X-SecondLife-Local-Position", string.Format("({0}, {1}, {2})", pos.x, pos.y, pos.z)); + wc.Headers.Add("X-SecondLife-Local-Rotation", "(0.000000, 0.000000, 0.000000, 1.000000)"); + wc.Headers.Add("X-SecondLife-Local-Velocity", "(0.000000, 0.000000, 0.000000)"); + wc.Headers.Add("X-SecondLife-Owner-Name", Properties.Settings.Default.AvatarName); + wc.Headers.Add("X-SecondLife-Owner-Key", Properties.Settings.Default.AvatarKey); + wc.Headers.Add("X-Forwarded-For", "127.0.0.1"); + + if (proxy != null) + wc.Proxy = proxy; + + Uri uri = new Uri(strUrl); + + // Basic Authentication scheme, added 28 mrt 2008 + if (uri.UserInfo != "") + { + string[] UserInfo = uri.UserInfo.Split(':'); + if (UserInfo.Length == 2) + { + CredentialCache mycache = new CredentialCache(); + mycache.Add(uri, "Basic", + new NetworkCredential(UserInfo[0], UserInfo[1])); + wc.Credentials = mycache; + } + } + + + UserState userState = new UserState(key, secondlife); + + if (strMethod == "POST" || strMethod == "PUT") + { + wc.UploadDataCompleted += new UploadDataCompletedEventHandler(wc_UploadDataCompleted); + wc.UploadDataAsync(uri, strMethod, Encoding.UTF8.GetBytes(postData), userState); + } + else + { + wc.DownloadDataCompleted += new DownloadDataCompletedEventHandler(wc_DownloadDataCompleted); + wc.DownloadDataAsync(uri, userState); + } + } + + private static void wc_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e) + { + int intStatusCode = 200; + UserState userState = (UserState)e.UserState; + string strResult = ""; + + if (e.Error != null) + { + WebException webException = e.Error as WebException; + HttpWebResponse webResponse = webException.Response as HttpWebResponse; + if (webResponse == null) + { + intStatusCode = 0; + strResult = webException.Message; + } + else + { + intStatusCode = (int)webResponse.StatusCode; + System.IO.StreamReader sr = new System.IO.StreamReader(webResponse.GetResponseStream()); + strResult = sr.ReadToEnd(); + } + } + else + { + if (e.Result != null) + strResult = Encoding.ASCII.GetString(e.Result); + } + userState.secondlife.host.ExecuteSecondLife("http_response", userState.httpkey, (SecondLife.integer)intStatusCode, new SecondLife.list(), (SecondLife.String)strResult); + } + + private static void wc_UploadDataCompleted(object sender, UploadDataCompletedEventArgs e) + { + int intStatusCode = 200; + UserState userState = (UserState)e.UserState; + string strResult = ""; + + if (e.Error != null) + { + WebException webException = e.Error as WebException; + HttpWebResponse webResponse = webException.Response as HttpWebResponse; + intStatusCode = (int)webResponse.StatusCode; + System.IO.StreamReader sr = new System.IO.StreamReader(webResponse.GetResponseStream()); + strResult = sr.ReadToEnd(); + } + else + { + if (e.Result != null) + strResult = Encoding.ASCII.GetString(e.Result); + } + userState.secondlife.host.ExecuteSecondLife("http_response", userState.httpkey, (SecondLife.integer)intStatusCode, new SecondLife.list(), (SecondLife.String)strResult); + } + + } +} + diff --git a/Helpers/LSL2CSharp.cs b/Helpers/LSL2CSharp.cs new file mode 100644 index 0000000..3b142be --- /dev/null +++ b/Helpers/LSL2CSharp.cs @@ -0,0 +1,642 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Xml; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + class LSL2CSharp + { + public List States; + private XmlDocument xml; + + public LSL2CSharp(XmlDocument xml) + { + this.xml = xml; + this.States = new List(); + } + + private string CorrectGlobalEvaluator(Match m) + { + string strPrefix = m.Groups["prefix"].Value; + string strPublic = m.Groups["public"].Value; + string strPostfix = m.Groups["postfix"].Value; + if (strPublic.EndsWith(";")) + return strPrefix + "public static " + strPublic + strPostfix; + // has to be static, + // because the vars must keep their values between state changes + + // 22 june 2007, added + Regex regex = new Regex(@"\w*", RegexOptions.IgnorePatternWhitespace ); + int intCount=0; + for (Match pm = regex.Match(strPublic); pm.Success; pm = pm.NextMatch()) + { + if (pm.Value.Length > 0) + intCount++; + if (intCount > 1) + break; + } + if(intCount==1) + return strPrefix + "public void " + strPublic + strPostfix; + else + return strPrefix + "public " + strPublic + strPostfix; + } + + private string CorrectGlobal(string strC) + { + Regex regex = new Regex( + @"(?\s*) +(?: + (?[^{};]*;) + +| + +(?[^{;(]*) + (? + \( [^{]* \) \s* + \{ + (?> + [^{}]+ + | \{ (?) + | \} (?<-number>) + )* + (?(number)(?!)) +\} +) +)", + RegexOptions.IgnorePatternWhitespace); + return regex.Replace(strC, new MatchEvaluator(CorrectGlobalEvaluator)); + } + + private string RemoveComments(string strC) + { + if (Properties.Settings.Default.CommentCStyle) + { + int intI = strC.IndexOf("/*"); + while (intI > 0) + { + int intJ = strC.IndexOf("*" + "/", intI); + if (intJ < 0) + break; + strC = strC.Remove(intI, intJ - intI + 2); + intI = strC.IndexOf("/*"); + } + } + return AutoFormatter.RemoveCommentsFromLines(strC); + } + + private string CorrectStates(string strC,string strGlobalClass) + { + Regex regex; + + // Default state + regex = new Regex(@"^\s*(default)(\W)", + RegexOptions.Multiline + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled); + strC = regex.Replace(strC, @"class State_$1 : " + strGlobalClass + "$2"); + + // Other states + regex = new Regex( + @"^state\s+([^\s]*)(\s*\{)", + RegexOptions.Multiline + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + Match m = regex.Match(strC); + while (m.Success) + { + string strStateName = m.Groups[1].ToString(); + this.States.Add(strStateName); + m = m.NextMatch(); + } + strC = regex.Replace(strC, "class State_$1 : " + strGlobalClass + "$2"); + + string strGlobal = ""; + + if (Properties.Settings.Default.StatesInGlobalFunctions) + { + // do nothing! + } + else + { + int intDefault = strC.IndexOf("class State_default"); + if (intDefault >= 0) + { + strGlobal = strC.Substring(0, intDefault); + strC = strC.Substring(intDefault); + } + } + + // State change, excluding global functions + regex = new Regex( + @"(\s+)state\s+(\w*)(\s*;)", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + return strGlobal + regex.Replace(strC, @"$1state(""$2"")$3"); + } + + private string PreCorrectReservedWords(string strC) + { + #region All PreCorrect reserved C# words + Regex regex = new Regex(@"(\b)(public +| class +| override +| namespace +| void +| SecondLife +| GlobalClass +| static +| goto +| String +| Float + +)(\b)", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + return regex.Replace(strC, "$1_$2$3"); + } + + private string CorrectReservedWords(string strC) + { + #region All reserved C# words + Regex regex = new Regex(@"(\b)(new +| abstract +| as +| base +| bool +| break +| byte +| case +| catch +| char +| checked +| const +| continue +| decimal +| delegate +| double +| enum +| event +| explicit +| extern +| false +| finally +| fixed +| foreach +| implicit +| in +| int +| interface +| internal +| is +| lock +| long +| new +| null +| object +| operator +| out +| params +| private +| protected +| readonly +| ref +| sbyte +| sealed +| short +| sizeof +| stackalloc +| struct +| switch +| this +| throw +| true +| try +| typeof +| uint +| ulong +| unchecked +| unsafe +| ushort +| using +| virtual + +)(\b)", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + return regex.Replace(strC, "$1_$2$3"); + } + + private string CorrectEvent(string strC, string strName) + { + Regex regex = new Regex( + @"([^\w_])" + strName + @"(\s*)\(", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + return regex.Replace(strC, "$1public override void " + strName + "$2("); + } + + private string CorrectEvents(string strC) + { + XmlNode words = xml.SelectSingleNode("//Words[@name='Appendix B. Events']"); + foreach (XmlNode xmlNode in words.SelectNodes(".//Word")) + { + string strName = xmlNode.Attributes["name"].InnerText; + strC = CorrectEvent(strC, strName); + } + return strC; + } + + // old vector parser + // <([^<>,;]*),([^<>,;]*),([^<>,;]*)> + private string CorrectVector(string strC) + { + Regex regex = new Regex(@" +< + (? + (?> + [^=(),>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +, + (? + (?> + [^=(),>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +, + (? + (?> + [^=()>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +> +", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + return regex.Replace(strC, "new vector(${vector_x},${vector_y},${vector_z})"); + } + + // old rotation + // <([^<>,;]*),([^<>,;]*),([^<>,;]*),([^<>,;]*)> + private string CorrectRotation(string strC) + { + Regex regex = new Regex(@" +< + (? + (?> + [^=(),>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +, + (? + (?> + [^=(),>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +, + (? + (?> + [^=(),>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +, + (? + (?> + [^=()>]+ + | \( (?) + | \) (?<-nr>) + | , + )* + (?(nr)(?!)) + ) +> +", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + return regex.Replace(strC, "new rotation(${rotation_x},${rotation_y},${rotation_z},${rotation_s})"); + } + + private string CorrectQuaternion(string strC) + { + Regex regex = new Regex( + @"(\b)quaternion(\b)", + RegexOptions.Compiled + | RegexOptions.IgnorePatternWhitespace + ); + return regex.Replace(strC, "$1rotation$2"); + } + + private string CorrectListsEvaluator(Match m) + { + string strValue = m.Value; + return "new list(new object[] {" + CorrectLists(strValue.Substring(1, strValue.Length - 2)) + "})"; + } + + private string CorrectLists(string strC) + { + Regex regex = new Regex( + @" +\[ + (?> + [^\[\]]+ + | \[ (?) + | \] (?<-number>) + )* + (?(number)(?!)) +\] +", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled); + return regex.Replace(strC, new MatchEvaluator(CorrectListsEvaluator)); + } + + // changed 16 aug 2007 + private string CorrectJump(string strC) + { + // jump -> goto + Regex regex = new Regex( + @"(\b)jump(\s+)([^;]*;)", + RegexOptions.Compiled + | RegexOptions.IgnorePatternWhitespace + ); + strC = regex.Replace(strC, "$1goto$2_$3"); + + // @label; -> label:; + regex = new Regex( + @"@\s*([a-z0-9_]+)\s*;", + RegexOptions.Compiled + | RegexOptions.IgnoreCase + | RegexOptions.IgnorePatternWhitespace + ); + return regex.Replace(strC, "_$1:;"); + } + + + private string RemoveQuotedStrings(string strC, out List h) + { + h = new List(); + StringBuilder sb = new StringBuilder(); + StringBuilder QuotedString = null; + for (int intI = 0; intI < strC.Length; intI++) + { + char chrC = strC[intI]; + if (chrC == '"') + { + if (QuotedString != null) + { + // end of a quoted string + sb.Append('"'); + sb.Append(h.Count.ToString()); + sb.Append('"'); + h.Add(QuotedString.ToString()); + QuotedString = null; + continue; + } + else + { + if (chrC == '"') + { + // start of a new quoted string + QuotedString = new StringBuilder(); + continue; + } + // it was just a newline char, and not in a string + } + } + + if (QuotedString == null) + sb.Append(chrC); + else + { + if (chrC == '\n') + { + QuotedString.Append('\\'); + chrC = 'n'; + } + if (chrC != '\\') + { + QuotedString.Append(chrC); + } + else // it is a backslash + { + intI++; + chrC = strC[intI]; + if (chrC == 't') // tabs are 4 spaces in SL world!! + { + QuotedString.Append(" "); + } + else // nope, it is no tab, just output it all + { + QuotedString.Append('\\'); + QuotedString.Append(chrC); + } + } + } + } + return sb.ToString(); + } + + private string InsertQuotedStrings(string strC, List h) + { + StringBuilder sb = new StringBuilder(); + StringBuilder QuotedString = null; + for (int intI = 0; intI < strC.Length; intI++) + { + char chrC = strC[intI]; + if (chrC == '"') + { + if (QuotedString == null) + { + QuotedString = new StringBuilder(); + } + else + { + sb.Append('"'); + int intNumber; + // State("default") is not a number, result of 'CorrectStates' + if (int.TryParse(QuotedString.ToString(), out intNumber)) + sb.Append(h[intNumber]); + else + sb.Append(QuotedString.ToString()); + sb.Append('"'); + QuotedString = null; + } + continue; + } + + if (QuotedString == null) + sb.Append(chrC); + else + QuotedString.Append(chrC); + } + return sb.ToString(); + } + + private string MakeGlobalAndLocal(string strC) + { + Regex regexDefault = new Regex(@"^\s*(default)\W", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Multiline + | RegexOptions.Compiled); + + Match matchDefault = regexDefault.Match(strC); + + string strGlobal; + int intDefaultIndex; + if (matchDefault.Groups.Count == 2) + { + States.Add("default"); + intDefaultIndex = matchDefault.Groups[1].Index; + strGlobal = CorrectGlobal(strC.Substring(0, intDefaultIndex)); + } + else + { + intDefaultIndex = 0; + strGlobal = ""; + } + return "class GlobalClass : SecondLife\n{\n" + strGlobal + "}\n" + strC.Substring(intDefaultIndex); + } + + private string Capitalize(string strC, string strName) + { + Regex regex = new Regex(@"(\W)"+strName+@"(\W)", + RegexOptions.IgnorePatternWhitespace + | RegexOptions.Multiline + | RegexOptions.Compiled); + string strCap = strName[0].ToString().ToUpper() + strName.Substring(1); + return regex.Replace(strC, "$1"+strCap+"$2"); + } + + private string RemoveSingleQuotes(string strC) + { + if (Properties.Settings.Default.SingleQuote) + return strC.Replace("'", ""); + else + return strC; + } + + /// + /// This Class translates LSL script into CSharp code + /// + /// LSL scripting code + /// CSHarp code + public string Parse(string strLSLCode) + { + List quotedStrings; + + string strGlobalClass = "GlobalClass"; + + string strC = strLSLCode; + + strC = RemoveComments(strC); + + strC = RemoveQuotedStrings(strC, out quotedStrings); + + strC = RemoveSingleQuotes(strC); + + strC = PreCorrectReservedWords(strC); // Experimental + + strC = MakeGlobalAndLocal(strC); + + strC = CorrectJump(strC); + strC = CorrectEvents(strC); + + strC = Capitalize(strC, "float"); + strC = Capitalize(strC, "string"); // llList2string is also translated + + strC = CorrectStates(strC, strGlobalClass); + + strC = CorrectReservedWords(strC); // Experimental + + strC = CorrectRotation(strC); + strC = CorrectQuaternion(strC); + strC = CorrectVector(strC); + strC = CorrectLists(strC); + + strC = InsertQuotedStrings(strC, quotedStrings); + + return strC; + } + } + + +} diff --git a/Helpers/Measure.cs b/Helpers/Measure.cs new file mode 100644 index 0000000..d292556 --- /dev/null +++ b/Helpers/Measure.cs @@ -0,0 +1,70 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; + +namespace LSLEditor.Helpers +{ + class Measure + { + public static RectangleF MeasureDisplayString(System.Windows.Forms.Control control, string text, Font font) + { + Graphics graphics = control.CreateGraphics(); + RectangleF rect = MeasureDisplayString(graphics, text, font); + graphics.Dispose(); + return rect; + } + + public static RectangleF MeasureDisplayString(Graphics graphics, string text, Font font) + { + StringFormat format = new StringFormat(); + RectangleF rect = new RectangleF(0, 0, 4096, 4096); + CharacterRange[] ranges = { new CharacterRange(0, text.Length) }; + Region[] regions = new Region[1]; + format.SetMeasurableCharacterRanges(ranges); + regions = graphics.MeasureCharacterRanges(text, font, rect, format); + return regions[0].GetBounds(graphics); + } + } +} diff --git a/Helpers/OopsFormatter.cs b/Helpers/OopsFormatter.cs new file mode 100644 index 0000000..b6bc088 --- /dev/null +++ b/Helpers/OopsFormatter.cs @@ -0,0 +1,66 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Text; + +namespace LSLEditor +{ + class OopsFormatter + { + public static string ApplyFormatting(string strInput) + { + strInput = strInput.Replace("SecondLifeHost.", ""); + strInput = strInput.Replace("GlobalClass.", ""); + strInput = strInput.Replace("State_", ""); + strInput = strInput.Replace("LSLEditor.", ""); + strInput = strInput.Replace("SecondLife.", ""); + strInput = strInput.Replace("String", "string"); + strInput = strInput.Replace("Float", "float"); + strInput = strInput.Replace(Properties.Settings.Default.OopsRemove, ""); + + return strInput; + } + } +} diff --git a/Helpers/PrinterHelper.cs b/Helpers/PrinterHelper.cs new file mode 100644 index 0000000..86f2b0a --- /dev/null +++ b/Helpers/PrinterHelper.cs @@ -0,0 +1,703 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Printing; +using System.Globalization; +using System.Windows.Forms; + +namespace LSLEditor.Helpers +{ + /// + /// Data Grid View Printer. Print functions for a datagridview, since MS + /// didn't see fit to do it. + /// + class PrinterHelper + { + //--------------------------------------------------------------------- + // global variables + //--------------------------------------------------------------------- + #region global variables + + // the data grid view we're printing + EditForm editForm = null; + int intCharFrom; + int intCharTo; + int intCharPrint; + + // print document + PrintDocument printDoc = null; + + // print status items + int fromPage = 0; + int toPage = -1; + + // page formatting options + int pageHeight = 0; + int pageWidth = 0; + int printWidth = 0; + int CurrentPage = 0; + PrintRange printRange; + + // calculated values + private float footerHeight = 0; + private float pagenumberHeight = 0; + #endregion + + //--------------------------------------------------------------------- + // properties - settable by user + //--------------------------------------------------------------------- + #region properties + + // Title + #region title properties + + /// + /// Title for this report. Default is empty. + /// + private String title; + public String Title + { + get { return title; } + set { title = value; printDoc.DocumentName = title; } + } + + /// + /// Font for the title. Default is Tahoma, 18pt. + /// + private Font titlefont; + public Font TitleFont + { + get { return titlefont; } + set { titlefont = value; } + } + + /// + /// Foreground color for the title. Default is Black + /// + private Color titlecolor; + public Color TitleColor + { + get { return titlecolor; } + set { titlecolor = value; } + } + + /// + /// Allow the user to override the title string alignment. Default value is + /// Alignment - Near; + /// + private StringAlignment titlealignment; + public StringAlignment TitleAlignment + { + get { return titlealignment; } + set { titlealignment = value; } + } + + /// + /// Allow the user to override the title string format flags. Default values + /// are: FormatFlags - NoWrap, LineLimit, NoClip + /// + private StringFormatFlags titleformatflags; + public StringFormatFlags TitleFormatFlags + { + get { return titleformatflags; } + set { titleformatflags = value; } + } + #endregion + + // SubTitle + #region subtitle properties + + /// + /// SubTitle for this report. Default is empty. + /// + private String subtitle; + public String SubTitle + { + get { return subtitle; } + set { subtitle = value; } + } + + /// + /// Font for the subtitle. Default is Tahoma, 12pt. + /// + private Font subtitlefont; + public Font SubTitleFont + { + get { return subtitlefont; } + set { subtitlefont = value; } + } + + /// + /// Foreground color for the subtitle. Default is Black + /// + private Color subtitlecolor; + public Color SubTitleColor + { + get { return subtitlecolor; } + set { subtitlecolor = value; } + } + + /// + /// Allow the user to override the subtitle string alignment. Default value is + /// Alignment - Near; + /// + private StringAlignment subtitlealignment; + public StringAlignment SubTitleAlignment + { + get { return subtitlealignment; } + set { subtitlealignment = value; } + } + + /// + /// Allow the user to override the subtitle string format flags. Default values + /// are: FormatFlags - NoWrap, LineLimit, NoClip + /// + private StringFormatFlags subtitleformatflags; + public StringFormatFlags SubTitleFormatFlags + { + get { return subtitleformatflags; } + set { subtitleformatflags = value; } + } + #endregion + + // Footer + #region footer properties + + /// + /// footer for this report. Default is empty. + /// + private String footer; + public String Footer + { + get { return footer; } + set { footer = value; } + } + + /// + /// Font for the footer. Default is Tahoma, 10pt. + /// + private Font footerfont; + public Font FooterFont + { + get { return footerfont; } + set { footerfont = value; } + } + + /// + /// Foreground color for the footer. Default is Black + /// + private Color footercolor; + public Color FooterColor + { + get { return footercolor; } + set { footercolor = value; } + } + + /// + /// Allow the user to override the footer string alignment. Default value is + /// Alignment - Center; + /// + private StringAlignment footeralignment; + public StringAlignment FooterAlignment + { + get { return footeralignment; } + set { footeralignment = value; } + } + + /// + /// Allow the user to override the footer string format flags. Default values + /// are: FormatFlags - NoWrap, LineLimit, NoClip + /// + private StringFormatFlags footerformatflags; + public StringFormatFlags FooterFormatFlags + { + get { return footerformatflags; } + set { footerformatflags = value; } + } + + private float footerspacing; + public float FooterSpacing + { + get { return footerspacing; } + set { footerspacing = value; } + } + #endregion + + // Page Numbering + #region page number properties + + /// + /// Include page number in the printout. Default is true. + /// + private bool pageno = true; + public bool PageNumbers + { + get { return pageno; } + set { pageno = value; } + } + + /// + /// Font for the page number, Default is Tahoma, 8pt. + /// + private Font pagenofont; + public Font PageNumberFont + { + get { return pagenofont; } + set { pagenofont = value; } + } + + /// + /// Text color (foreground) for the page number. Default is Black + /// + private Color pagenocolor; + public Color PageNumberColor + { + get { return pagenocolor; } + set { pagenocolor = value; } + } + + /// + /// Allow the user to override the page number string alignment. Default value is + /// Alignment - Near; + /// + private StringAlignment pagenumberalignment; + public StringAlignment PaageNumberAlignment + { + get { return pagenumberalignment; } + set { pagenumberalignment = value; } + } + + /// + /// Allow the user to override the pagenumber string format flags. Default values + /// are: FormatFlags - NoWrap, LineLimit, NoClip + /// + private StringFormatFlags pagenumberformatflags; + public StringFormatFlags PageNumberFormatFlags + { + get { return pagenumberformatflags; } + set { pagenumberformatflags = value; } + } + + /// + /// Allow the user to select whether to have the page number at the top or bottom + /// of the page. Default is false: page numbers on the bottom of the page + /// + private bool pagenumberontop = false; + public bool PageNumberInHeader + { + get { return pagenumberontop; } + set { pagenumberontop = value; } + } + + /// + /// Should the page number be printed on a separate line, or printed on the + /// same line as the header / footer? Default is false; + /// + private bool pagenumberonseparateline = false; + public bool PaageNumberOnSeparateLine + { + get { return pagenumberonseparateline; } + set { pagenumberonseparateline = value; } + } + + + #endregion + + // Page Level Properties + #region page level properties + + /// + /// Page margins override. Default is (60, 60, 60, 60) + /// + private Margins printmargins; + public Margins PrintMargins + { + get { return printmargins; } + set { printmargins = value; } + } + + #endregion + + #endregion + + /// + /// Constructor for PrinterHelper + /// + public PrinterHelper(PageSetupDialog pageSetupDialog) + { + // create print document + printDoc = new PrintDocument(); + printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage); + + if (pageSetupDialog.PrinterSettings != null) + printDoc.PrinterSettings = pageSetupDialog.PrinterSettings; + + if (pageSetupDialog.PageSettings != null) + printDoc.DefaultPageSettings = pageSetupDialog.PageSettings; + else + printDoc.DefaultPageSettings.Margins = new Margins(60, 80, 40, 40); + + printmargins = printDoc.DefaultPageSettings.Margins; + + // set default fonts + pagenofont = new Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point); + pagenocolor = Color.Black; + titlefont = new Font("Tahoma", 8, FontStyle.Bold, GraphicsUnit.Point); + titlecolor = Color.Black; + subtitlefont = new Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point); + subtitlecolor = Color.Black; + footerfont = new Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point); + footercolor = Color.Black; + + // set default string formats + titlealignment = StringAlignment.Near; + titleformatflags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip; + + subtitlealignment = StringAlignment.Near; + subtitleformatflags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip; + + footeralignment = StringAlignment.Near; + footerformatflags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip; + + pagenumberalignment = StringAlignment.Center; + pagenumberformatflags = StringFormatFlags.NoWrap | StringFormatFlags.LineLimit | StringFormatFlags.NoClip; + } + + /// + /// Start the printing process, print to a printer. + /// + /// The EditForm to print + /// NOTE: Any changes to this method also need to be done in PrintPreviewEditForm + public void PrintEditForm(EditForm editForm) + { + // save the datagridview we're printing + this.editForm = editForm; + this.intCharFrom = 0; + this.intCharPrint = 0; + this.intCharTo = editForm.TextBox.Text.Length; + + // create new print dialog + PrintDialog pd = new PrintDialog(); + pd.Document = printDoc; + //printDoc.DefaultPageSettings.Margins = printmargins; + pd.AllowSelection = true; + pd.AllowSomePages = false; + pd.AllowCurrentPage = false; + pd.AllowPrintToFile = false; + + // show print dialog + if (DialogResult.OK == pd.ShowDialog()) + { + SetupPrint(pd); + printDoc.Print(); + } + } + + /// + /// Start the printing process, print to a print preview dialog + /// + /// The EditForm to print + /// NOTE: Any changes to this method also need to be done in PrintDataGridView + public void PrintPreviewEditForm(EditForm editForm) + { + // save the datagridview we're printing + this.editForm = editForm; + this.intCharFrom = 0; + this.intCharTo = editForm.TextBox.Text.Length; + + // create new print dialog and set options + PrintDialog pd = new PrintDialog(); + pd.Document = printDoc; + //printDoc.DefaultPageSettings.Margins = printmargins; + pd.AllowSelection = true; + pd.AllowSomePages = false; + pd.AllowCurrentPage = false; + pd.AllowPrintToFile = false; + + // show print dialog + if (DialogResult.OK == pd.ShowDialog()) + { + SetupPrint(pd); + PrintPreviewDialog ppdialog = new PrintPreviewDialog(); + ppdialog.Document = printDoc; + ppdialog.ShowDialog(); + } + } + + /// + /// Set up the print job. Save information from print dialog + /// and print document for easy access. Also sets up the rows + /// and columns that will be printed. + /// + /// The print dialog the user just filled out + void SetupPrint(PrintDialog pd) + { + //----------------------------------------------------------------- + // save data from print dialog and document + //----------------------------------------------------------------- + + // check to see if we're doing landscape printing + if (printDoc.DefaultPageSettings.Landscape) + { + // landscape: switch width and height + pageHeight = printDoc.DefaultPageSettings.PaperSize.Width; + pageWidth = printDoc.DefaultPageSettings.PaperSize.Height; + } + else + { + // portrait: keep width and height as expected + pageHeight = printDoc.DefaultPageSettings.PaperSize.Height; + pageWidth = printDoc.DefaultPageSettings.PaperSize.Width; + } + + // save printer margins and calc print width + printmargins = printDoc.DefaultPageSettings.Margins; + printWidth = pageWidth - printmargins.Left - printmargins.Right; + + // save print range + printRange = pd.PrinterSettings.PrintRange; + + // pages to print handles "some pages" option + if (PrintRange.SomePages == printRange) + { + // set limits to only print some pages + fromPage = pd.PrinterSettings.FromPage; + toPage = pd.PrinterSettings.ToPage; + } + else + { + // set extremes so that we'll print all pages + fromPage = 0; + toPage = 2147483647; + } + + //----------------------------------------------------------------- + // set up the pages to print + //----------------------------------------------------------------- + + // pages (handles "selection" and "current page" options + if (PrintRange.Selection == printRange) + { + intCharPrint = this.editForm.TextBox.SelectionStart; + intCharFrom = intCharPrint; + intCharTo = intCharFrom + this.editForm.TextBox.SelectionLength; + } + else if (PrintRange.CurrentPage == printRange) + { + } + // this is the default for print all + else + { + intCharPrint = 0; + intCharFrom = intCharPrint; + intCharTo = this.editForm.TextBox.Text.Length; + } + } + + /// + /// Centralize the string format settings. Does the work of checking for user + /// overrides, and if they're not present, setting the cell alignment to match + /// (somewhat) the source control's string alignment. + /// + /// String alignment + /// String format flags + /// DataGridView style to apply (if available) + /// True if user overrode alignment or flags + /// + private static StringFormat managestringformat(StringAlignment alignment, StringFormatFlags flags) + { + // start with the provided + StringFormat format = new StringFormat(); + format.Trimming = StringTrimming.Word; + format.Alignment = alignment; + format.FormatFlags = flags; + + return format; + } + + /// + /// PrintPage event handler. This routine prints one page. It will + /// skip non-printable pages if the user selected the "some pages" option + /// on the print dialog. + /// + /// default object from windows + /// Event info from Windows about the printing + private void printDoc_PrintPage(object sender, PrintPageEventArgs e) + { + // adjust printing region, make space for headers and footers + Rectangle rect = new Rectangle( + e.MarginBounds.Left, + e.MarginBounds.Top + e.MarginBounds.Top, + e.MarginBounds.Width, + e.MarginBounds.Height - e.MarginBounds.Top - e.MarginBounds.Top); + PrintPageEventArgs ee = new PrintPageEventArgs(e.Graphics, rect, e.PageBounds, e.PageSettings); + // Print the content of RichTextBox. Store the last character printed. + intCharFrom = editForm.TextBox.Print(intCharFrom, intCharTo, ee); + + // increment page number & check page range + CurrentPage++; + + //----------------------------------------------------------------- + // print headers + //----------------------------------------------------------------- + + // reset printpos as it may have changed during the 'skip pages' routine just above. + float printpos = printmargins.Top; + + // print page number if user selected it + if (pagenumberontop) + { + // if we have a page number to print + if (pageno) + { + // ... then print it + printsection(e.Graphics, ref printpos, "Page " + CurrentPage.ToString(CultureInfo.CurrentCulture), + pagenofont, pagenocolor, pagenumberalignment, pagenumberformatflags); + + // if the page number is not on a separate line, don't "use up" it's vertical space + if (!pagenumberonseparateline) + printpos -= pagenumberHeight; + } + } + + // print title if provided + if (!String.IsNullOrEmpty(title)) + printsection(e.Graphics, ref printpos, title, titlefont, + titlecolor, titlealignment, titleformatflags); + + // print subtitle if provided + if (!String.IsNullOrEmpty(subtitle)) + printsection(e.Graphics, ref printpos, subtitle, subtitlefont, + subtitlecolor, subtitlealignment, subtitleformatflags); + + //----------------------------------------------------------------- + // print footer + //----------------------------------------------------------------- + printfooter(e.Graphics, ref printpos); + + // Check for more pages + if (intCharFrom < intCharTo) + e.HasMorePages = true; + else + { + intCharFrom = intCharPrint; // reset + CurrentPage = 0; + e.HasMorePages = false; + } + + } + + /// + /// Print a header or footer section. Used for page numbers and titles + /// + /// Graphic context to print in + /// Track vertical space used; 'y' location + /// String to print + /// Font to use for printing + /// Color to print in + /// Alignment - print to left, center or right + /// String format flags + /// True if the user overrode the alignment or flags + private void printsection(Graphics g, ref float pos, string text, + Font font, Color color, StringAlignment alignment, StringFormatFlags flags) + { + // string formatting setup + StringFormat printformat = managestringformat(alignment, flags); + + // measure string + SizeF printsize = g.MeasureString(text, font, printWidth, printformat); + + // build area to print within + RectangleF printarea = new RectangleF((float)printmargins.Left, pos, (float)printWidth, + printsize.Height); + + // do the actual print + g.DrawString(text, font, new SolidBrush(color), printarea, printformat); + + // track "used" vertical space + pos += printsize.Height; + } + + /// + /// Print the footer. This handles the footer spacing, and printing the page number + /// at the bottom of the page (if the page number is not in the header). + /// + /// Graphic context to print in + /// Track vertical space used; 'y' location + private void printfooter(Graphics g, ref float pos) + { + // print last footer. Note: need to force printpos to the bottom of the page + // as we may have run out of data anywhere on the page + pos = pageHeight - footerHeight - printmargins.Top - printmargins.Bottom; + + // add spacing + pos += footerspacing; + + // print the footer + printsection(g, ref pos, footer, footerfont, + footercolor, footeralignment, footerformatflags); + + // print the page number if it's on the bottom. + if (!pagenumberontop) + { + if (pageno) + { + pagenumberHeight = g.MeasureString("M", pagenofont).Height; + // if the pageno is not on a separate line, push the print location up by its height. + if (!pagenumberonseparateline) + pos = pos - pagenumberHeight; + + // print the page number + printsection(g, ref pos, "Page " + CurrentPage.ToString(CultureInfo.CurrentCulture), + pagenofont, pagenocolor, pagenumberalignment, pagenumberformatflags); + + } + } + } + } +} diff --git a/Helpers/SendMyKeys.cs b/Helpers/SendMyKeys.cs new file mode 100644 index 0000000..b2e7e4f --- /dev/null +++ b/Helpers/SendMyKeys.cs @@ -0,0 +1,273 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using System.Threading; +using System.Diagnostics; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +using System.Windows.Forms; + +namespace NativeHelper +{ + public class NativeWIN32 + { + public const ushort KEYEVENTF_KEYUP = 0x0002; + + public struct KEYBDINPUT + { + public ushort wVk; + public ushort wScan; + public uint dwFlags; + public long time; + public uint dwExtraInfo; + } + + [StructLayout(LayoutKind.Explicit, Size = 28)] + public struct INPUT + { + [FieldOffset(0)] + public uint type; + [FieldOffset(4)] + public KEYBDINPUT ki; + } + + [DllImport("user32.dll")] + public static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize); + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetForegroundWindow(IntPtr hWnd); + } + + public class SendMyKeys + { + public static void PasteTextToApp(string strText,string strAppName, string strTitle) + { + foreach (Process p in Process.GetProcessesByName(strAppName)) + { + if(strTitle!=null) + if (p.MainWindowTitle.IndexOf(strTitle) < 0) + continue; + NativeWIN32.SetForegroundWindow(p.MainWindowHandle); + Thread.Sleep(5000); + SendMyKeys.SendString(strText); + return; + } + } + + public static void ClipBoardToApp(string strAppName, string strTitle) + { + foreach (Process p in Process.GetProcessesByName(strAppName)) + { + if (strTitle != null) + if (p.MainWindowTitle.IndexOf(strTitle) < 0) + continue; + NativeWIN32.SetForegroundWindow(p.MainWindowHandle); + Thread.Sleep(1000); + SendMyKeys.SendChar((ushort)Keys.V,false,true); + return; + } + } + + public static void SendChar(ushort wVk, bool ShiftKey, bool ControlKey) + { + uint uintReturn; + + NativeWIN32.INPUT structInput = new NativeWIN32.INPUT(); + structInput.type = (uint)1; + structInput.ki.wScan = 0; + structInput.ki.time = 0; + structInput.ki.dwFlags = 0; + structInput.ki.dwExtraInfo = 0; + + if (ControlKey) + { + structInput.ki.wVk = (ushort)Keys.ControlKey; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + } + + if (ShiftKey) + { + structInput.ki.wVk = (ushort)Keys.ShiftKey; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + } + + structInput.ki.wVk = wVk; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + + structInput.ki.dwFlags = NativeWIN32.KEYEVENTF_KEYUP; + structInput.ki.wVk = wVk; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + + if (ShiftKey) + { + structInput.ki.dwFlags = NativeWIN32.KEYEVENTF_KEYUP; + structInput.ki.wVk = (ushort)Keys.ShiftKey; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + } + + if (ControlKey) + { + structInput.ki.dwFlags = NativeWIN32.KEYEVENTF_KEYUP; + structInput.ki.wVk = (ushort)Keys.ControlKey; + uintReturn = NativeWIN32.SendInput((uint)1, ref structInput, Marshal.SizeOf(structInput)); + } + } + + public static void SendString(string s) + { + ushort wVk; + bool ShiftKey; + foreach (Char c in s.ToCharArray()) + { + if (Char.IsUpper(c)) + ShiftKey = true; + else + ShiftKey = false; + + wVk = (ushort)Char.ToUpper(c); + + string special = ")!@#$%^&*("; + + int intDigit = special.IndexOf(c); + if (intDigit >= 0) + { + ShiftKey = true; + wVk = (ushort)('0' + intDigit); + } + else + { + switch (c) + { + case ':': + ShiftKey = true; + wVk = (ushort)Keys.Oem1; + break; + case ';': + wVk = (ushort)Keys.Oem1; + break; + case '-': + wVk = (ushort)Keys.OemMinus; + break; + case '_': + ShiftKey = true; + wVk = (ushort)Keys.OemMinus; + break; + case '+': + ShiftKey = true; + wVk = (ushort)Keys.Oemplus; + break; + case '=': + wVk = (ushort)Keys.Oemplus; + break; + case '/': + wVk = (ushort)Keys.Oem2; + break; + case '?': + ShiftKey = true; + wVk = (ushort)Keys.OemQuestion; + break; + case '.': + wVk = (ushort)Keys.OemPeriod; + break; + case '>': + ShiftKey = true; + wVk = (ushort)Keys.OemPeriod; + break; + case ',': + wVk = (ushort)Keys.Oemcomma; + break; + case '<': + ShiftKey = true; + wVk = (ushort)Keys.Oemcomma; + break; + case '`': + wVk = (ushort)Keys.Oemtilde; + break; + case '~': + ShiftKey = true; + wVk = (ushort)Keys.Oemtilde; + break; + case '|': + ShiftKey = true; + wVk = (ushort)Keys.Oem5; + break; + case '\\': + wVk = (ushort)Keys.Oem5; + break; + case '[': + wVk = (ushort)Keys.OemOpenBrackets; + break; + case '{': + ShiftKey = true; + wVk = (ushort)Keys.OemOpenBrackets; + break; + case ']': + wVk = (ushort)Keys.Oem6; + break; + case '}': + ShiftKey = true; + wVk = (ushort)Keys.Oem6; + break; + case '\'': + wVk = (ushort)Keys.Oem7; + break; + case '"': + ShiftKey = true; + wVk = (ushort)Keys.Oem7; + break; + default: + break; + } + } + + SendChar(wVk, ShiftKey, false); + + } + } + } + +} diff --git a/Helpers/Settings.cs b/Helpers/Settings.cs new file mode 100644 index 0000000..f083f7e --- /dev/null +++ b/Helpers/Settings.cs @@ -0,0 +1,71 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +namespace LSLEditor.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + internal sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + } +} diff --git a/Helpers/SmtpClient.cs b/Helpers/SmtpClient.cs new file mode 100644 index 0000000..b5dffbf --- /dev/null +++ b/Helpers/SmtpClient.cs @@ -0,0 +1,355 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Net.Sockets; +using System.Collections; + +namespace LSLEditor +{ + public class MailAttachment + { + public string Filename; + public MailAttachment(string strAttachmentFile) + { + this.Filename = strAttachmentFile; + } + } + + public class MailMessage + { + public string Body; + public string From; + public string To; + public string Cc; + public string Bcc; + public string Subject; + public Hashtable Headers; + public ArrayList Attachments; + + public MailMessage() + { + this.Headers = new Hashtable(); + this.Attachments = new ArrayList(); + } + } + + /// + /// provides methods to send email via smtp direct to mail server + /// http://www.ietf.org/rfc/rfc0821.txt + /// + public class SmtpClient + { + /// + /// Get / Set the name of the SMTP mail server + /// + public string SmtpServer; + private enum SMTPResponse: int + { + CONNECT_SUCCESS = 220, + GENERIC_SUCCESS = 250, + DATA_SUCCESS = 354, + QUIT_SUCCESS = 221, + + AUTH_SUCCESS = 334, + AUTH_GRANTED = 235 + } + + public string Send(MailMessage message) + { + string strResponse; + byte[] data; + IPHostEntry IPhst; + try + { + IPhst = Dns.GetHostEntry(SmtpServer); + } + catch (Exception exception) + { + return "Email:Error on "+exception.Message; + } + IPEndPoint endPt = new IPEndPoint(IPhst.AddressList[0], 25); + Socket s= new Socket(endPt.AddressFamily, SocketType.Stream,ProtocolType.Tcp); + s.Connect(endPt); + + if(!Check_Response(s, SMTPResponse.CONNECT_SUCCESS, out strResponse)) + { + s.Close(); + return "Email:Error on connection (" + strResponse + ")"; + } + + Senddata(s, string.Format("HELO {0}\r\n", Dns.GetHostName() )); + if (!Check_Response(s, SMTPResponse.GENERIC_SUCCESS, out strResponse)) + { + s.Close(); + return "Email:Error on HELO (" + strResponse + ")"; + } + + // SMTP Authentication + if (Properties.Settings.Default.SmtpUserid != "") + { + if (Properties.Settings.Default.SmtpAuth == "PLAIN") + { + Senddata(s, "AUTH PLAIN\r\n"); + if (!Check_Response(s, SMTPResponse.AUTH_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: Error on AUTH PLAIN (" + strResponse + ")"; + } + data = Encoding.ASCII.GetBytes(string.Format("\0{0}\0{1}", + Properties.Settings.Default.SmtpUserid, + Properties.Settings.Default.SmtpPassword)); + Senddata(s, string.Format("{0}\r\n",Convert.ToBase64String(data))); + if (!Check_Response(s, SMTPResponse.AUTH_GRANTED, out strResponse)) + { + s.Close(); + return "Email: AUTH PLAIN not granted (" + strResponse + ")"; + } + } + if (Properties.Settings.Default.SmtpAuth == "LOGIN") + { + Senddata(s, "AUTH LOGIN\r\n"); + if (!Check_Response(s, SMTPResponse.AUTH_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: Error on AUTH LOGIN (" + strResponse + ")"; + } + data = Encoding.ASCII.GetBytes(Properties.Settings.Default.SmtpUserid); + Senddata(s, string.Format("{0}\r\n", Convert.ToBase64String(data))); + if (!Check_Response(s, SMTPResponse.AUTH_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: AUTH LOGIN userid error (" + strResponse + ")"; + } + data = Encoding.ASCII.GetBytes(Properties.Settings.Default.SmtpPassword); + Senddata(s, string.Format("{0}\r\n", Convert.ToBase64String(data))); + if (!Check_Response(s, SMTPResponse.AUTH_GRANTED, out strResponse)) + { + s.Close(); + return "Email: AUTH LOGIN not granted (" + strResponse + ")"; + } + } + if (Properties.Settings.Default.SmtpAuth == "CRAM-MD5") + { + s.Close(); + return "Email: LSLEditor Not Implemented CRAM-MD5"; + + } + if (Properties.Settings.Default.SmtpAuth == "DIGEST-MD5") + { + s.Close(); + return "Email: LSLEditor Not Implemented DIGEST-MD5"; + } + if (Properties.Settings.Default.SmtpAuth == "EXTERNAL") + { + s.Close(); + return "Email: LSLEditor Not Implemented EXTERNAL"; + } + if (Properties.Settings.Default.SmtpAuth == "ANONYMOUS") + { + s.Close(); + return "Email: LSLEditor Not Implemented ANONYMOUS"; + } + } + + Senddata(s, string.Format("MAIL From: {0}\r\n", message.From )); + if (!Check_Response(s, SMTPResponse.GENERIC_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: Error on MAIL From (" + strResponse + ")"; + } + + string _To = message.To; + string[] Tos= _To.Split(new char[] {';'}); + foreach (string To in Tos) + { + Senddata(s, string.Format("RCPT TO: {0}\r\n", To)); + if (!Check_Response(s, SMTPResponse.GENERIC_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: Error on RCPT TO (" + strResponse + ")"; + } + } + + if(message.Cc!=null) + { + Tos= message.Cc.Split(new char[] {';'}); + foreach (string To in Tos) + { + Senddata(s, string.Format("RCPT TO: {0}\r\n", To)); + if (!Check_Response(s, SMTPResponse.GENERIC_SUCCESS, out strResponse)) + { + s.Close(); + return "Email: Error on (CC) RCPT TO (" + strResponse + ")"; + } + } + } + + StringBuilder Header=new StringBuilder(); + Header.Append("From: " + message.From + "\r\n"); + Tos= message.To.Split(new char[] {';'}); + Header.Append("To: "); + for( int i=0; i< Tos.Length; i++) + { + Header.Append( i > 0 ? "," : "" ); + Header.Append(Tos[i]); + } + Header.Append("\r\n"); + if(message.Cc!=null) + { + Tos= message.Cc.Split(new char[] {';'}); + Header.Append("Cc: "); + for( int i=0; i< Tos.Length; i++) + { + Header.Append( i > 0 ? "," : "" ); + Header.Append(Tos[i]); + } + Header.Append("\r\n"); + } + Header.Append("Date: " + DateTime.Now.ToString("R" ) + "\r\n"); + Header.Append("Subject: " + message.Subject+ "\r\n"); + Header.Append("X-Mailer: SMTPClient v2.36 (LSL-Editor)\r\n" ); + // escape . on newline + + string MsgBody = message.Body.Replace("\n.","\n.."); + if(!MsgBody.EndsWith("\r\n")) + MsgBody+="\r\n"; + if(message.Attachments.Count>0) + { + Header.Append( "MIME-Version: 1.0\r\n" ); + Header.Append( "Content-Type: multipart/mixed; boundary=unique-boundary-1\r\n" ); + Header.Append("\r\n"); + Header.Append( "This is a multi-part message in MIME format.\r\n" ); + StringBuilder sb = new StringBuilder(); + sb.Append("--unique-boundary-1\r\n"); + sb.Append("Content-Type: text/plain\r\n"); + sb.Append("Content-Transfer-Encoding: 7Bit\r\n"); + sb.Append("\r\n"); + sb.Append(MsgBody + "\r\n"); + sb.Append("\r\n"); + + foreach(object o in message.Attachments) + { + MailAttachment a = o as MailAttachment; + byte[] binaryData; + if(a!=null) + { + FileInfo f = new FileInfo(a.Filename); + sb.Append("--unique-boundary-1\r\n"); + sb.Append("Content-Type: application/octet-stream; file=" + f.Name + "\r\n"); + sb.Append("Content-Transfer-Encoding: base64\r\n"); + sb.Append("Content-Disposition: attachment; filename=" + f.Name + "\r\n"); + sb.Append("\r\n"); + FileStream fs = f.OpenRead(); + binaryData = new Byte[fs.Length]; + long bytesRead = fs.Read(binaryData, 0, (int)fs.Length); + fs.Close(); + string base64String = System.Convert.ToBase64String(binaryData, 0,binaryData.Length); + + for(int i=0; i< base64String.Length ; ) + { + int nextchunk=100; + if(base64String.Length - (i + nextchunk ) <0) + nextchunk = base64String.Length -i; + sb.Append(base64String.Substring(i, nextchunk)); + sb.Append("\r\n"); + i+=nextchunk; + + } + sb.Append("\r\n"); + } + } + MsgBody=sb.ToString(); + } + + Senddata(s, ("DATA\r\n")); + if (!Check_Response(s, SMTPResponse.DATA_SUCCESS, out strResponse)) + { + s.Close(); + return "Email:Error on DATA (" + strResponse + ")"; + } + Header.Append( "\r\n" ); + Header.Append( MsgBody); + Header.Append("\r\n.\r\n"); + Senddata(s, Header.ToString()); + if (!Check_Response(s, SMTPResponse.GENERIC_SUCCESS, out strResponse)) + { + s.Close(); + return "Email:Error on message body (" + strResponse + ")"; + } + + Senddata(s, "QUIT\r\n"); + if (!Check_Response(s, SMTPResponse.QUIT_SUCCESS, out strResponse)) + { + s.Close(); + return "Email:Error on QUIT (" + strResponse + ")"; + } + s.Close(); + return "Email: Succes :-)"; + } + private void Senddata(Socket s, string msg) + { + byte[] _msg = Encoding.ASCII.GetBytes(msg); + s.Send(_msg , 0, _msg .Length, SocketFlags.None); + } + private bool Check_Response(Socket s, SMTPResponse response_expected, out string sResponse) + { + byte[] bytes = new byte[1024]; + while (s.Available==0) + { + System.Threading.Thread.Sleep(100); + } + + int intCount = s.Receive(bytes, 0, s.Available, SocketFlags.None); + sResponse = Encoding.ASCII.GetString(bytes,0,intCount); + int response = Convert.ToInt32(sResponse.Substring(0,3)); + if(response != (int)response_expected) + return false; + return true; + } + } +} + diff --git a/Helpers/TabControlExtended.Designer.cs b/Helpers/TabControlExtended.Designer.cs new file mode 100644 index 0000000..cae4121 --- /dev/null +++ b/Helpers/TabControlExtended.Designer.cs @@ -0,0 +1,28 @@ +namespace System.Windows.Forms +{ + partial class TabControlExtended + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Helpers/TabControlExtended.cs b/Helpers/TabControlExtended.cs new file mode 100644 index 0000000..c5fb659 --- /dev/null +++ b/Helpers/TabControlExtended.cs @@ -0,0 +1,249 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.ComponentModel; +using System.Windows.Forms; +using System.Windows.Forms.VisualStyles; + +namespace System.Windows.Forms +{ + public partial class TabControlExtended : System.Windows.Forms.TabControl + { + private int HoverIndex; + private bool Extended; + + public event EventHandler OnTabClose; + + public TabControlExtended() + { + InitializeComponent(); + } + + public TabControlExtended(IContainer container) + { + InitializeComponent(); + + container.Add(this); + } + + public void SetDrawMode() + { + try + { + HoverIndex = 0; + VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.Tab.Pane.Normal); + this.DrawMode = TabDrawMode.OwnerDrawFixed; + this.SetStyle(ControlStyles.UserPaint, true); + this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.DoubleBuffer, true); + this.SetStyle(ControlStyles.ResizeRedraw, true); + this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); + this.Extended = true; + } + catch + { + this.Extended = false; + this.DrawMode = TabDrawMode.Normal; + } + } + +/* +protected override bool ProcessMnemonic(char charCode) +{ + foreach (TabPage p in this.TabPages) + { + if (Control.IsMnemonic(charCode, p.Text)) + { + this.SelectedTab = p; + this.Focus(); + return true; + } + } + return false; +} +*/ + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + if (!this.Extended) + return; + MyPaint(e); + } + + protected override void OnSelectedIndexChanged(EventArgs e) + { + this.HoverIndex = -1; + base.OnSelectedIndexChanged(e); + } + + private void MyPaint(PaintEventArgs e) + { + if (!this.Visible) + return; + + Graphics g = e.Graphics; + + Rectangle displayRectangle = this.DisplayRectangle; + + Size borderSize = SystemInformation.Border3DSize; + displayRectangle.Inflate(borderSize.Width << 1, borderSize.Height << 1); + + VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.Tab.Pane.Normal); + + render.DrawBackground(g, displayRectangle); + + for (int intI = 0; intI < this.TabCount; intI++) + if (intI != this.SelectedIndex) + DrawTab(g, intI); + if (this.SelectedIndex >= 0) + DrawTab(g, this.SelectedIndex); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + if (!Extended) + return; + + Point p = e.Location; + for (int intI = 0; intI < this.TabCount; intI++) + { + Rectangle rectangle = GetTabRect(intI); + if (rectangle.Contains(p)) + { + HoverIndex = intI; + this.Invalidate(); + } + } + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + if (!Extended) + return; + + HoverIndex = this.SelectedIndex; + this.Invalidate(); + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + if (!Extended) + return; + + Point p = e.Location; + Rectangle rectangle = this.GetTabRect(this.SelectedIndex); + if (rectangle.Contains(p)) + { + Rectangle closeImage = new Rectangle(rectangle.Right - 15 - 5, 5, 15, 15); + if (closeImage.Contains(p)) + { + if (OnTabClose != null) + OnTabClose(this.SelectedIndex, new EventArgs()); + else + this.TabPages.RemoveAt(this.SelectedIndex); + } + } + } + + private void DrawTab(Graphics g, int intIndex) + { + Font font; + Bitmap bitmap; + + Rectangle recBounds = this.GetTabRect(intIndex); + RectangleF tabTextArea = (RectangleF)this.GetTabRect(intIndex); + + TabPage tabPage = this.TabPages[intIndex]; + + Size borderSize = SystemInformation.Border3DSize; + + VisualStyleRenderer render; + if (this.SelectedIndex == intIndex) + { + font = new Font(this.Font, FontStyle.Bold); + Point p = this.PointToClient(Control.MousePosition); + Rectangle closeImage = new Rectangle(recBounds.Right - 15 - 5, 5, 15, 15); + if (closeImage.Contains(p)) + bitmap = new Bitmap(Type.GetType("LSLEditor.LSLEditorForm"), "Images.Close-Active.gif"); + else + bitmap = new Bitmap(Type.GetType("LSLEditor.LSLEditorForm"), "Images.Close-Inactive.gif"); + recBounds.X -= borderSize.Width; + recBounds.Y -= borderSize.Height; + recBounds.Width += borderSize.Width << 1; + recBounds.Height += borderSize.Height; + render = new VisualStyleRenderer(VisualStyleElement.Tab.TabItem.Pressed); + Rectangle clipper = new Rectangle(recBounds.X, recBounds.Y, recBounds.Width, recBounds.Height - 1); + render.DrawBackground(g, recBounds, clipper); + } + else + { + font = new Font(this.Font, FontStyle.Regular); + if (this.HoverIndex == intIndex) + { + render = new VisualStyleRenderer(VisualStyleElement.Tab.TopTabItem.Hot); + bitmap = new Bitmap(Type.GetType("LSLEditor.LSLEditorForm"), "Images.Close-Active.gif"); + } + else + { + render = new VisualStyleRenderer(VisualStyleElement.Tab.TabItem.Normal); + bitmap = new Bitmap(Type.GetType("LSLEditor.LSLEditorForm"), "Images.Close-Disabled.gif"); + } + recBounds.Height -= borderSize.Height; + render.DrawBackground(g, recBounds); + } + + SolidBrush br = new SolidBrush(tabPage.ForeColor); + //Console.WriteLine("["+tabPage.Text+"]"); + g.DrawString(tabPage.Text, font, br, tabTextArea.Left + 2, tabTextArea.Top + 3); + font.Dispose(); + g.DrawImage(bitmap, new Point((int)tabTextArea.Right - bitmap.Width - 5, 5)); + } + + } +} diff --git a/Helpers/TaskQueue.cs b/Helpers/TaskQueue.cs new file mode 100644 index 0000000..cf4b94e --- /dev/null +++ b/Helpers/TaskQueue.cs @@ -0,0 +1,263 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Reflection; +using System.Collections; +using System.Diagnostics; +using System.Threading; + +// http://www.codeproject.com/csharp/messageloop.asp + +namespace LSLEditor.Helpers +{ + /// + /// Represents an object that performs a certain action asynchronously, by using an internal buffer queue + /// and one internal thread. + /// + public class TaskQueue : IDisposable + { + #region Member Variables + + /// Reference to the thread used to empty the queue + private Thread WorkerThread; + /// Internal queue that serves as buffer for required actions + private Queue Tasks; + /// Used to signal the thread when a new object is added to the queue + private AutoResetEvent SignalNewTask; + /// Flag that notifies that the object should be disposed + private bool stop; + #endregion Member Variables + + #region Constructor + + /// Creates a new buffered object + public TaskQueue() + { + WorkerThread = null; + + // Make sure the queue is synchronized. This is required because items are added to the queue + // from a different thread than the thread that empties the queue + Tasks = Queue.Synchronized(new Queue()); + + SignalNewTask = new AutoResetEvent(false); + + stop = false; + } + #endregion Ctor + + #region Public Methods + + public void Start() + { + Stop(); + + stop = false; + Tasks.Clear(); + + WorkerThread = new Thread(new ThreadStart(Worker)); + WorkerThread.IsBackground = true; + WorkerThread.Start(); + } + + public void Stop() + { + if(WorkerThread!=null) + { + WorkerThread.Abort(); + if (!WorkerThread.Join(2000)) + { + // problems + System.Windows.Forms.MessageBox.Show("TaskQueue thread not Aborted", "Oops..."); + } + WorkerThread = null; + } + } + + public void Invoke(object ActiveObject,string MethodName, params object[] args) + { + if (ActiveObject == null) + return; + try + { + // Add the object to the internal buffer + Tasks.Enqueue(new Task(ActiveObject, MethodName, args)); + + // Signal the internal thread that there is some new object in the buffer + SignalNewTask.Set(); + } + catch (Exception e) + { + Trace.WriteLine(string.Format("I An exception occurred in TaskQueue.Invoke: {0}", e.Message)); + // Since the exception was not actually handled and only logged - propagate it + throw; + } + } + #endregion Public Methods + + #region Private Methods + + /// Method executed by the internal thread to empty the queue + private void Worker() + { + Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US", false); + Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US", false); + + while (!stop) + { + try + { + // Note: this code is safe (i.e. performing the .Count and .Dequeue not inside a lock) + // because there is only one thread emptying the queue. + // Even if .Count returns 0, and before Dequeue is called a new object is added to the Queue + // then still the system will behave nicely: the next if statement will return false and + // since this is run in an endless loop, in the next iteration we will have .Count > 0. + if (Tasks.Count > 0) + { + (Tasks.Dequeue() as Task).Execute(); + } + + // Wait until new objects are received or Dispose was called + if (Tasks.Count == 0) + { + SignalNewTask.WaitOne(); + } + } + catch (ThreadAbortException) + { + Trace.WriteLine("TaskQueue.Worker: ThreadAbortException, no problem"); + } + catch (Exception e) + { + Trace.WriteLine(string.Format("TaskQueue.Worker: {0}", e.Message)); + // Since the exception was not actually handled and only logged - propagate it + throw; + } + } + } + + #endregion Private Methods + + #region IDisposable Members and Dispose Pattern + + private bool disposed = false; + + ~TaskQueue() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!this.disposed) + { + if (disposing) + { + try + { + stop = true; + SignalNewTask.Set(); + } + catch (Exception e) + { + Trace.WriteLine(string.Format("An exception occurred in MessageLoop.AddToBuffer: {0}", e.Message)); + // Since the exception was not actually handled and only logged - propagate it + throw; + } + } + this.disposed = true; + } + } + #endregion IDisposable Members and Dispose Pattern + + #region Task + /// The tasks being saved in the queue + private class Task + { + private object ActiveObject; + private object[] args; + public string MethodName; + public Task(object ActiveObject, string MethodName, params object[] args) + { + this.ActiveObject = ActiveObject; + this.MethodName = MethodName; + this.args = args; + } + + public void Execute() + { + try + { + MethodInfo mi = ActiveObject.GetType().GetMethod(MethodName, + BindingFlags.Public | + BindingFlags.Instance | + //BindingFlags.DeclaredOnly | + BindingFlags.NonPublic + ); + mi.Invoke(ActiveObject, args); + } + catch (ThreadAbortException) + { + Trace.WriteLine("TaskQueue.Task.Execute: ThreadAbortException, no problem"); + } + catch (Exception exception) + { + Exception innerException = exception.InnerException; + if (innerException == null) + innerException = exception; + string strMessage = OopsFormatter.ApplyFormatting(innerException.Message); + string strStackTrace = OopsFormatter.ApplyFormatting(innerException.StackTrace); + + System.Windows.Forms.MessageBox.Show(strMessage + "\r\n" + strStackTrace, "Oops..."); + } + } + } + #endregion Task + } +} diff --git a/Helpers/WebRequestClass.cs b/Helpers/WebRequestClass.cs new file mode 100644 index 0000000..c4cff82 --- /dev/null +++ b/Helpers/WebRequestClass.cs @@ -0,0 +1,251 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; + +namespace LSLEditor +{ + public class RequestState + { + // This class stores the state of the request. + public SecondLife secondlife; + public SecondLife.key httpkey; + public byte[] postData; + const int BUFFER_SIZE = 1024; + public StringBuilder requestData; + public byte[] bufferRead; + public WebRequest request; + public WebResponse response; + public Stream responseStream; + public RequestState() + { + bufferRead = new byte[BUFFER_SIZE]; + requestData = new StringBuilder(""); + request = null; + responseStream = null; + postData = null; + } + } + + class WebRequestClass + { + public static ManualResetEvent allDone= new ManualResetEvent(false); + const int BUFFER_SIZE = 1024; + public WebRequestClass(WebProxy proxy, SecondLife secondlife, string strUrl, SecondLife.list parameters, string postData, SecondLife.key key) + { + try + { + // Create a new webrequest to the mentioned URL. + WebRequest myWebRequest = WebRequest.Create(strUrl); + + myWebRequest.Headers.Add("Cache-Control", "max-age=259200"); + //myWebRequest.Headers.Add("Connection", "keep-alive"); + myWebRequest.Headers.Add("Pragma", "no-cache"); + //myWebRequest.Headers.Add("Via", "1.1 sim3560.agni.lindenlab.com:3128 (squid/2.6.STABLE12)"); + //myWebRequest.Headers.Add("Content-Length", "3"); + //myWebRequest.Headers.Add("Content-Type", "text/plain;charset=utf-8"); + //myWebRequest.Headers.Add("Accept", "text/*"); + myWebRequest.Headers.Add("Accept-Charset", "utf-8;q=1.0, *;q=0.5"); + myWebRequest.Headers.Add("Accept-Encoding", "deflate, gzip"); + //myWebRequest.Headers.Add("Host", "www.lsleditor.org"); + //myWebRequest.Headers.Add("User-Agent", "LSLEditor 2.24 (http://www.lsleditor.org)"); + myWebRequest.Headers.Add("X-SecondLife-Shard", "Production"); + + SecondLife.vector RegionCorner = secondlife.llGetRegionCorner(); + SecondLife.vector pos = secondlife.llGetPos(); + + myWebRequest.Headers.Add("X-SecondLife-Object-Name", secondlife.host.GetObjectName()); + myWebRequest.Headers.Add("X-SecondLife-Object-Key", secondlife.host.GetKey().ToString()); + myWebRequest.Headers.Add("X-SecondLife-Region", Properties.Settings.Default.RegionName + " (" + (int)RegionCorner.x + ", " + (int)RegionCorner.y + ")"); + myWebRequest.Headers.Add("X-SecondLife-Local-Position", "("+pos.x+", "+pos.y+", "+pos.z+")"); + myWebRequest.Headers.Add("X-SecondLife-Local-Rotation", "(0.000000, 0.000000, 0.000000, 1.000000)"); + myWebRequest.Headers.Add("X-SecondLife-Local-Velocity", "(0.000000, 0.000000, 0.000000)"); + myWebRequest.Headers.Add("X-SecondLife-Owner-Name", Properties.Settings.Default.AvatarName); + myWebRequest.Headers.Add("X-SecondLife-Owner-Key", Properties.Settings.Default.AvatarKey); + myWebRequest.Headers.Add("X-Forwarded-For", "127.0.0.1"); + + // Setting up paramters + for (int intI = 0; intI < parameters.Count; intI += 2) + { + switch (int.Parse(parameters[intI].ToString())) + { + case 0: + myWebRequest.Method = parameters[intI + 1].ToString(); + break; + case 1: + myWebRequest.ContentType = parameters[intI + 1].ToString(); + break; + case 2: + // HTTP_BODY_MAXLENGTH + break; + default: + break; + } + } + + if (proxy != null) + myWebRequest.Proxy = proxy; + + // Create a new instance of the RequestState. + RequestState myRequestState = new RequestState(); + + myRequestState.secondlife = secondlife; + myRequestState.httpkey = key; + myRequestState.postData = Encoding.UTF8.GetBytes(postData); + + // 19 sep 2007 + myWebRequest.ContentLength = myRequestState.postData.Length; + + // The 'WebRequest' object is associated to the 'RequestState' object. + myRequestState.request = myWebRequest; + + // Start the Asynchronous call for response. + IAsyncResult asyncResult; + if (myWebRequest.Method == "POST" || myWebRequest.Method == "PUT") + asyncResult = (IAsyncResult)myWebRequest.BeginGetRequestStream(new AsyncCallback(RespCallback), myRequestState); + else + asyncResult = (IAsyncResult)myWebRequest.BeginGetResponse(new AsyncCallback(RespCallback), myRequestState); + } + catch (WebException e) + { + secondlife.host.VerboseMessage(e.Message); + secondlife.host.VerboseMessage(e.Status.ToString()); + } + catch (Exception e) + { + Console.WriteLine("Exception raised!"); + Console.WriteLine("Source : " + e.Source); + Console.WriteLine("Message : " + e.Message); + secondlife.host.VerboseMessage(e.Message); + } + } + + private static void RespCallback(IAsyncResult asynchronousResult) + { + RequestState myRequestState=(RequestState) asynchronousResult.AsyncState; + try + { + // Set the State of request to asynchronous. + WebRequest request = myRequestState.request; + + if (request.Method == "POST" || request.Method == "PUT") // TODO check if this post works!!!! + { + // End the operation. + Stream postStream = request.EndGetRequestStream(asynchronousResult); + // Write to the request stream. + postStream.Write(myRequestState.postData, 0, myRequestState.postData.Length); + postStream.Close(); + + myRequestState.response = (HttpWebResponse)request.GetResponse(); + } + else + { + // End the Asynchronous response. + myRequestState.response = request.EndGetResponse(asynchronousResult); + } + + // Read the response into a 'Stream' object. + Stream responseStream = myRequestState.response.GetResponseStream(); + myRequestState.responseStream = responseStream; + // Begin the reading of the response + IAsyncResult asynchronousResultRead = responseStream.BeginRead(myRequestState.bufferRead, 0, BUFFER_SIZE, new AsyncCallback(ReadCallBack), myRequestState); + } + catch (WebException e) + { + myRequestState.secondlife.host.VerboseMessage(e.Message); + myRequestState.secondlife.host.VerboseMessage(e.Status.ToString()); + } + catch (Exception e) + { + Console.WriteLine("Exception raised!"); + Console.WriteLine("Source : " + e.Source); + Console.WriteLine("Message : " + e.Message); + myRequestState.secondlife.host.VerboseMessage(e.Message); + } + } + + private static void ReadCallBack(IAsyncResult asyncResult) + { + RequestState myRequestState = (RequestState)asyncResult.AsyncState; + try + { + // Result state is set to AsyncState. + Stream responseStream = myRequestState.responseStream; + int read = responseStream.EndRead( asyncResult ); + // Read the contents of the HTML page and then print to the console. + if (read > 0) + { + myRequestState.requestData.Append(Encoding.ASCII.GetString(myRequestState.bufferRead, 0, read)); + IAsyncResult asynchronousResult = responseStream.BeginRead( myRequestState.bufferRead, 0, BUFFER_SIZE, new AsyncCallback(ReadCallBack), myRequestState); + } + else + { + responseStream.Close(); + if(myRequestState.requestData.Length>1) + { + myRequestState.secondlife.host.ExecuteSecondLife("http_response",myRequestState.httpkey, (SecondLife.integer)200, new SecondLife.list(), (SecondLife.String)myRequestState.requestData.ToString()); + } + } + } + catch(WebException e) + { + myRequestState.secondlife.host.VerboseMessage(e.Message); + myRequestState.secondlife.host.VerboseMessage(e.Status.ToString()); + } + catch(Exception e) + { + Console.WriteLine("Exception raised!"); + Console.WriteLine("Source : {0}" , e.Source); + Console.WriteLine("Message : {0}" , e.Message); + myRequestState.secondlife.host.VerboseMessage(e.Message); + } + + } + } +} + diff --git a/Helpers/XMLRPC.cs b/Helpers/XMLRPC.cs new file mode 100644 index 0000000..45e8994 --- /dev/null +++ b/Helpers/XMLRPC.cs @@ -0,0 +1,322 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Xml; +using System.Net; +using System.Threading; + +namespace LSLEditor.Helpers +{ + class XmlRpcRequestEventArgs : EventArgs + { + public SecondLife.key channel; + public SecondLife.key message_id; + public SecondLife.String sData; + public SecondLife.integer iData; + public SecondLife.String sender; + } + + class XMLRPC + { + private HttpListener listener; + private Thread thread; + private bool blnRunning; + private WebRequest request; + + public SecondLife.key guid; + public HttpListenerContext context; + public delegate void RequestEventHandler(object sender, XmlRpcRequestEventArgs e); + public event RequestEventHandler OnReply; + public event RequestEventHandler OnRequest; + + public string Prefix; + public XMLRPC() + { + this.guid = SecondLife.NULL_KEY; + } + + public SecondLife.key OpenChannel(int intChannel) + { + if (!HttpListener.IsSupported) + return this.guid; + + // Yes, it works + this.guid = new SecondLife.key(Guid.NewGuid()); + + + // Create a listener. + listener = new HttpListener(); + + // Add the prefix. + int intPort = 50888 + intChannel; + Prefix = "http://localhost:" + intPort + "/"; + listener.Prefixes.Add(Prefix); + + listener.Start(); + + blnRunning = true; + thread = new Thread(new ThreadStart(Worker)); + thread.Name = "Worker"; + thread.Start(); + + return this.guid; + } + + private XmlRpcRequestEventArgs DecodeRequest(System.IO.Stream stream) + { + XmlRpcRequestEventArgs e = new XmlRpcRequestEventArgs(); + e.sender = ""; + e.message_id = SecondLife.NULL_KEY; + /* + + + llRemoteData + + + + + + Channel + 4a250e12-c02e-94fb-6d2f-13529cbaad63 + + + IntValue + 0 + + + StringValue + test + + + + + + +*/ + XmlDocument xml = new XmlDocument(); + xml.Load(stream); + + XmlNode methodCall = xml.SelectSingleNode("/methodCall"); + + if (methodCall == null) + return e; + + XmlNode methodName = methodCall.SelectSingleNode("./methodName"); + if (methodName == null) + return e; + + if (methodName.InnerText != "llRemoteData") + return e; + + foreach (XmlNode xmlMember in methodCall.SelectNodes("./params/param/value/struct/member")) + { + string strName = xmlMember.SelectSingleNode("./name").InnerText; + string strValue = xmlMember.SelectSingleNode("./value").InnerText; + switch (strName) + { + case "Channel": + e.channel = new SecondLife.key(strValue); + break; + case "StringValue": + e.sData = strValue; + break; + case "IntValue": + int iData; + int.TryParse(strValue, out iData); + e.iData = iData; + break; + default: + break; + } + } + return e; + } + + private void Worker() + { + XmlRpcRequestEventArgs e; + while (blnRunning) + { + // Note: The GetContext method blocks while waiting for a request. + try + { + context = listener.GetContext(); + e = DecodeRequest(context.Request.InputStream); + + if (OnRequest != null) + OnRequest(this, e); + } + catch (HttpListenerException) + { + } + catch (ThreadAbortException) + { + } + catch (Exception exception) + { + System.Windows.Forms.MessageBox.Show("RPC Error:" + exception.Message, "Oops..."); + } + } + } + + public void RemoteDataReply(SecondLife.key channel, SecondLife.key message_id, string sData, int iData) + { + // Obtain a response object. + HttpListenerResponse response = context.Response; + + // Construct a response. + string responseString = string.Format(@" + + + + + + + Channel + {0} + + + StringValue + {1} + + + IntValue + {2} + + + + + + ", channel.ToString(),sData,iData); + byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); + + // Get a response stream and write the response to it. + response.ContentLength64 = buffer.Length; + response.ContentType = "text/xml"; + System.IO.Stream output = response.OutputStream; + output.Write(buffer, 0, buffer.Length); + + // You must close the output stream. + output.Close(); + } + + public void CloseChannel() + { + blnRunning = false; + if(listener!=null) + listener.Stop(); + if (thread != null) + { + thread.Abort(); + bool succes = thread.Join(1000); + } + thread = null; + listener = null; + } + + public SecondLife.key SendRemoteData(SecondLife.key channel, string dest, int iData, string sData) + { + this.guid = new SecondLife.key(Guid.NewGuid()); + + // Construct a request. + string requestString = string.Format(@" + + llRemoteData + + + + + + Channel + {0} + + + IntValue + {1} + + + StringValue + {2} + + + + + + ", channel.ToString(), iData, sData); + + request = WebRequest.Create(dest); + + byte[] buffer = System.Text.Encoding.UTF8.GetBytes(requestString); + + // Get a response stream and write the response to it. + request.ContentLength = buffer.Length; + request.ContentType = "text/xml"; + System.IO.Stream requestStream = request.GetRequestStream(); + requestStream.Write(buffer, 0, buffer.Length); + + // You must close the request stream. + requestStream.Close(); + + thread = new Thread(new ThreadStart(WaitOnResponse)); + thread.Name = "WaitOnResponse"; + thread.Start(); + + return this.guid; + } + + private void WaitOnResponse() + { + Thread.Sleep(100); + WebResponse response = request.GetResponse(); + + XmlRpcRequestEventArgs e = DecodeRequest(response.GetResponseStream()); + + // yes!! + e.message_id = this.guid; + + if (OnReply != null) + OnReply(this, e); + } + } +} diff --git a/Icons/ADDITEM.GIF b/Icons/ADDITEM.GIF new file mode 100644 index 0000000..2d903e2 Binary files /dev/null and b/Icons/ADDITEM.GIF differ diff --git a/Icons/COPY.GIF b/Icons/COPY.GIF new file mode 100644 index 0000000..0963682 Binary files /dev/null and b/Icons/COPY.GIF differ diff --git a/Icons/CUT.GIF b/Icons/CUT.GIF new file mode 100644 index 0000000..5fe9903 Binary files /dev/null and b/Icons/CUT.GIF differ diff --git a/Icons/DEINDENT.GIF b/Icons/DEINDENT.GIF new file mode 100644 index 0000000..4bfaca9 Binary files /dev/null and b/Icons/DEINDENT.GIF differ diff --git a/Icons/DELETE.GIF b/Icons/DELETE.GIF new file mode 100644 index 0000000..efc5541 Binary files /dev/null and b/Icons/DELETE.GIF differ diff --git a/Icons/END.GIF b/Icons/END.GIF new file mode 100644 index 0000000..fb71f90 Binary files /dev/null and b/Icons/END.GIF differ diff --git a/Icons/FIND.GIF b/Icons/FIND.GIF new file mode 100644 index 0000000..b47c9e6 Binary files /dev/null and b/Icons/FIND.GIF differ diff --git a/Icons/ININDENT.GIF b/Icons/ININDENT.GIF new file mode 100644 index 0000000..92e539f Binary files /dev/null and b/Icons/ININDENT.GIF differ diff --git a/Icons/NEWDOC.GIF b/Icons/NEWDOC.GIF new file mode 100644 index 0000000..0d3c482 Binary files /dev/null and b/Icons/NEWDOC.GIF differ diff --git a/Icons/NEWPROJ.GIF b/Icons/NEWPROJ.GIF new file mode 100644 index 0000000..de889d6 Binary files /dev/null and b/Icons/NEWPROJ.GIF differ diff --git a/Icons/OPEN.GIF b/Icons/OPEN.GIF new file mode 100644 index 0000000..e323d2b Binary files /dev/null and b/Icons/OPEN.GIF differ diff --git a/Icons/PASTE.GIF b/Icons/PASTE.GIF new file mode 100644 index 0000000..dfbfba5 Binary files /dev/null and b/Icons/PASTE.GIF differ diff --git a/Icons/PRINT.GIF b/Icons/PRINT.GIF new file mode 100644 index 0000000..b1c0d60 Binary files /dev/null and b/Icons/PRINT.GIF differ diff --git a/Icons/PROJECT.GIF b/Icons/PROJECT.GIF new file mode 100644 index 0000000..0bce76a Binary files /dev/null and b/Icons/PROJECT.GIF differ diff --git a/Icons/PROPS.GIF b/Icons/PROPS.GIF new file mode 100644 index 0000000..0590464 Binary files /dev/null and b/Icons/PROPS.GIF differ diff --git a/Icons/REDO.GIF b/Icons/REDO.GIF new file mode 100644 index 0000000..180655a Binary files /dev/null and b/Icons/REDO.GIF differ diff --git a/Icons/SAVE.GIF b/Icons/SAVE.GIF new file mode 100644 index 0000000..8a351ea Binary files /dev/null and b/Icons/SAVE.GIF differ diff --git a/Icons/SAVEALL.GIF b/Icons/SAVEALL.GIF new file mode 100644 index 0000000..99448a6 Binary files /dev/null and b/Icons/SAVEALL.GIF differ diff --git a/Icons/SAVEAS.GIF b/Icons/SAVEAS.GIF new file mode 100644 index 0000000..99448a6 Binary files /dev/null and b/Icons/SAVEAS.GIF differ diff --git a/Icons/START.GIF b/Icons/START.GIF new file mode 100644 index 0000000..eb2e792 Binary files /dev/null and b/Icons/START.GIF differ diff --git a/Icons/UNDO.GIF b/Icons/UNDO.GIF new file mode 100644 index 0000000..3613279 Binary files /dev/null and b/Icons/UNDO.GIF differ diff --git a/Images/Class.gif b/Images/Class.gif new file mode 100644 index 0000000..d55a72d Binary files /dev/null and b/Images/Class.gif differ diff --git a/Images/Close-Active.gif b/Images/Close-Active.gif new file mode 100644 index 0000000..aaf4949 Binary files /dev/null and b/Images/Close-Active.gif differ diff --git a/Images/Close-Disabled.gif b/Images/Close-Disabled.gif new file mode 100644 index 0000000..fbbe6b3 Binary files /dev/null and b/Images/Close-Disabled.gif differ diff --git a/Images/Close-Inactive.gif b/Images/Close-Inactive.gif new file mode 100644 index 0000000..7028d74 Binary files /dev/null and b/Images/Close-Inactive.gif differ diff --git a/Images/Constants.gif b/Images/Constants.gif new file mode 100644 index 0000000..63724c2 Binary files /dev/null and b/Images/Constants.gif differ diff --git a/Images/Enum.gif b/Images/Enum.gif new file mode 100644 index 0000000..619865f Binary files /dev/null and b/Images/Enum.gif differ diff --git a/Images/Events.gif b/Images/Events.gif new file mode 100644 index 0000000..99cd7cb Binary files /dev/null and b/Images/Events.gif differ diff --git a/Images/Functions.gif b/Images/Functions.gif new file mode 100644 index 0000000..8fde0c3 Binary files /dev/null and b/Images/Functions.gif differ diff --git a/Images/Namespace.gif b/Images/Namespace.gif new file mode 100644 index 0000000..bac956e Binary files /dev/null and b/Images/Namespace.gif differ diff --git a/Images/Properties.gif b/Images/Properties.gif new file mode 100644 index 0000000..dd4b641 Binary files /dev/null and b/Images/Properties.gif differ diff --git a/Images/SealedClass.gif b/Images/SealedClass.gif new file mode 100644 index 0000000..66f3e3b Binary files /dev/null and b/Images/SealedClass.gif differ diff --git a/Images/Thumbs.db b/Images/Thumbs.db new file mode 100644 index 0000000..2e049c9 Binary files /dev/null and b/Images/Thumbs.db differ diff --git a/Images/Unknown.gif b/Images/Unknown.gif new file mode 100644 index 0000000..d90ab95 Binary files /dev/null and b/Images/Unknown.gif differ diff --git a/Images/Vars.gif b/Images/Vars.gif new file mode 100644 index 0000000..619865f Binary files /dev/null and b/Images/Vars.gif differ diff --git a/Images/logo.gif b/Images/logo.gif new file mode 100644 index 0000000..e50bedf Binary files /dev/null and b/Images/logo.gif differ diff --git a/ImagesSolutionExplorer/Animation.gif b/ImagesSolutionExplorer/Animation.gif new file mode 100644 index 0000000..0fd284f Binary files /dev/null and b/ImagesSolutionExplorer/Animation.gif differ diff --git a/ImagesSolutionExplorer/Animations.gif b/ImagesSolutionExplorer/Animations.gif new file mode 100644 index 0000000..69794ab Binary files /dev/null and b/ImagesSolutionExplorer/Animations.gif differ diff --git a/ImagesSolutionExplorer/Body Parts.gif b/ImagesSolutionExplorer/Body Parts.gif new file mode 100644 index 0000000..df1dc73 Binary files /dev/null and b/ImagesSolutionExplorer/Body Parts.gif differ diff --git a/ImagesSolutionExplorer/Calling Cards.gif b/ImagesSolutionExplorer/Calling Cards.gif new file mode 100644 index 0000000..3c751c7 Binary files /dev/null and b/ImagesSolutionExplorer/Calling Cards.gif differ diff --git a/ImagesSolutionExplorer/Clothes.gif b/ImagesSolutionExplorer/Clothes.gif new file mode 100644 index 0000000..9099f1c Binary files /dev/null and b/ImagesSolutionExplorer/Clothes.gif differ diff --git a/ImagesSolutionExplorer/Eyes.gif b/ImagesSolutionExplorer/Eyes.gif new file mode 100644 index 0000000..151e101 Binary files /dev/null and b/ImagesSolutionExplorer/Eyes.gif differ diff --git a/ImagesSolutionExplorer/Folder.gif b/ImagesSolutionExplorer/Folder.gif new file mode 100644 index 0000000..18c83dd Binary files /dev/null and b/ImagesSolutionExplorer/Folder.gif differ diff --git a/ImagesSolutionExplorer/Gesture.gif b/ImagesSolutionExplorer/Gesture.gif new file mode 100644 index 0000000..7314a39 Binary files /dev/null and b/ImagesSolutionExplorer/Gesture.gif differ diff --git a/ImagesSolutionExplorer/Gestures.gif b/ImagesSolutionExplorer/Gestures.gif new file mode 100644 index 0000000..36ba7d9 Binary files /dev/null and b/ImagesSolutionExplorer/Gestures.gif differ diff --git a/ImagesSolutionExplorer/Gloves.gif b/ImagesSolutionExplorer/Gloves.gif new file mode 100644 index 0000000..63d1999 Binary files /dev/null and b/ImagesSolutionExplorer/Gloves.gif differ diff --git a/ImagesSolutionExplorer/Hair.gif b/ImagesSolutionExplorer/Hair.gif new file mode 100644 index 0000000..8cb1fde Binary files /dev/null and b/ImagesSolutionExplorer/Hair.gif differ diff --git a/ImagesSolutionExplorer/Inventory.gif b/ImagesSolutionExplorer/Inventory.gif new file mode 100644 index 0000000..18c83dd Binary files /dev/null and b/ImagesSolutionExplorer/Inventory.gif differ diff --git a/ImagesSolutionExplorer/Jacket.gif b/ImagesSolutionExplorer/Jacket.gif new file mode 100644 index 0000000..ddaf8ee Binary files /dev/null and b/ImagesSolutionExplorer/Jacket.gif differ diff --git a/ImagesSolutionExplorer/Landmark.gif b/ImagesSolutionExplorer/Landmark.gif new file mode 100644 index 0000000..b6d62ee Binary files /dev/null and b/ImagesSolutionExplorer/Landmark.gif differ diff --git a/ImagesSolutionExplorer/Landmarks.gif b/ImagesSolutionExplorer/Landmarks.gif new file mode 100644 index 0000000..069677f Binary files /dev/null and b/ImagesSolutionExplorer/Landmarks.gif differ diff --git a/ImagesSolutionExplorer/Lost And Found.gif b/ImagesSolutionExplorer/Lost And Found.gif new file mode 100644 index 0000000..1ba8dc7 Binary files /dev/null and b/ImagesSolutionExplorer/Lost And Found.gif differ diff --git a/ImagesSolutionExplorer/Notecard.gif b/ImagesSolutionExplorer/Notecard.gif new file mode 100644 index 0000000..f411fcd Binary files /dev/null and b/ImagesSolutionExplorer/Notecard.gif differ diff --git a/ImagesSolutionExplorer/Notecards.gif b/ImagesSolutionExplorer/Notecards.gif new file mode 100644 index 0000000..3bc9e19 Binary files /dev/null and b/ImagesSolutionExplorer/Notecards.gif differ diff --git a/ImagesSolutionExplorer/Object.gif b/ImagesSolutionExplorer/Object.gif new file mode 100644 index 0000000..d26b4ad Binary files /dev/null and b/ImagesSolutionExplorer/Object.gif differ diff --git a/ImagesSolutionExplorer/Objects.gif b/ImagesSolutionExplorer/Objects.gif new file mode 100644 index 0000000..09882c8 Binary files /dev/null and b/ImagesSolutionExplorer/Objects.gif differ diff --git a/ImagesSolutionExplorer/Pants.gif b/ImagesSolutionExplorer/Pants.gif new file mode 100644 index 0000000..e01e42f Binary files /dev/null and b/ImagesSolutionExplorer/Pants.gif differ diff --git a/ImagesSolutionExplorer/Photo Album.gif b/ImagesSolutionExplorer/Photo Album.gif new file mode 100644 index 0000000..8fb54ff Binary files /dev/null and b/ImagesSolutionExplorer/Photo Album.gif differ diff --git a/ImagesSolutionExplorer/Prim.gif b/ImagesSolutionExplorer/Prim.gif new file mode 100644 index 0000000..d26b4ad Binary files /dev/null and b/ImagesSolutionExplorer/Prim.gif differ diff --git a/ImagesSolutionExplorer/Project.gif b/ImagesSolutionExplorer/Project.gif new file mode 100644 index 0000000..fe252af Binary files /dev/null and b/ImagesSolutionExplorer/Project.gif differ diff --git a/ImagesSolutionExplorer/Script.gif b/ImagesSolutionExplorer/Script.gif new file mode 100644 index 0000000..90f2467 Binary files /dev/null and b/ImagesSolutionExplorer/Script.gif differ diff --git a/ImagesSolutionExplorer/Scripts.gif b/ImagesSolutionExplorer/Scripts.gif new file mode 100644 index 0000000..e0a61f1 Binary files /dev/null and b/ImagesSolutionExplorer/Scripts.gif differ diff --git a/ImagesSolutionExplorer/Shape.gif b/ImagesSolutionExplorer/Shape.gif new file mode 100644 index 0000000..8b4c113 Binary files /dev/null and b/ImagesSolutionExplorer/Shape.gif differ diff --git a/ImagesSolutionExplorer/Shirt.gif b/ImagesSolutionExplorer/Shirt.gif new file mode 100644 index 0000000..7c6e6d4 Binary files /dev/null and b/ImagesSolutionExplorer/Shirt.gif differ diff --git a/ImagesSolutionExplorer/Shoes.gif b/ImagesSolutionExplorer/Shoes.gif new file mode 100644 index 0000000..a74ee6e Binary files /dev/null and b/ImagesSolutionExplorer/Shoes.gif differ diff --git a/ImagesSolutionExplorer/Skin.gif b/ImagesSolutionExplorer/Skin.gif new file mode 100644 index 0000000..ba2b0c6 Binary files /dev/null and b/ImagesSolutionExplorer/Skin.gif differ diff --git a/ImagesSolutionExplorer/Skirt.gif b/ImagesSolutionExplorer/Skirt.gif new file mode 100644 index 0000000..a785d00 Binary files /dev/null and b/ImagesSolutionExplorer/Skirt.gif differ diff --git a/ImagesSolutionExplorer/Snapshot.gif b/ImagesSolutionExplorer/Snapshot.gif new file mode 100644 index 0000000..6f51085 Binary files /dev/null and b/ImagesSolutionExplorer/Snapshot.gif differ diff --git a/ImagesSolutionExplorer/Socks.gif b/ImagesSolutionExplorer/Socks.gif new file mode 100644 index 0000000..caed41f Binary files /dev/null and b/ImagesSolutionExplorer/Socks.gif differ diff --git a/ImagesSolutionExplorer/Solution.gif b/ImagesSolutionExplorer/Solution.gif new file mode 100644 index 0000000..f230f5b Binary files /dev/null and b/ImagesSolutionExplorer/Solution.gif differ diff --git a/ImagesSolutionExplorer/Sound.gif b/ImagesSolutionExplorer/Sound.gif new file mode 100644 index 0000000..71f8f41 Binary files /dev/null and b/ImagesSolutionExplorer/Sound.gif differ diff --git a/ImagesSolutionExplorer/Sounds.gif b/ImagesSolutionExplorer/Sounds.gif new file mode 100644 index 0000000..841c56a Binary files /dev/null and b/ImagesSolutionExplorer/Sounds.gif differ diff --git a/ImagesSolutionExplorer/Texture.gif b/ImagesSolutionExplorer/Texture.gif new file mode 100644 index 0000000..a1185f7 Binary files /dev/null and b/ImagesSolutionExplorer/Texture.gif differ diff --git a/ImagesSolutionExplorer/Textures.gif b/ImagesSolutionExplorer/Textures.gif new file mode 100644 index 0000000..11bee71 Binary files /dev/null and b/ImagesSolutionExplorer/Textures.gif differ diff --git a/ImagesSolutionExplorer/Trash.gif b/ImagesSolutionExplorer/Trash.gif new file mode 100644 index 0000000..e2f1f93 Binary files /dev/null and b/ImagesSolutionExplorer/Trash.gif differ diff --git a/ImagesSolutionExplorer/Underpants.gif b/ImagesSolutionExplorer/Underpants.gif new file mode 100644 index 0000000..0d8d876 Binary files /dev/null and b/ImagesSolutionExplorer/Underpants.gif differ diff --git a/ImagesSolutionExplorer/Undershirt.gif b/ImagesSolutionExplorer/Undershirt.gif new file mode 100644 index 0000000..4505002 Binary files /dev/null and b/ImagesSolutionExplorer/Undershirt.gif differ diff --git a/ImagesSolutionExplorer/Unknown.gif b/ImagesSolutionExplorer/Unknown.gif new file mode 100644 index 0000000..8412424 Binary files /dev/null and b/ImagesSolutionExplorer/Unknown.gif differ diff --git a/ImagesSolutionExplorer/question.gif b/ImagesSolutionExplorer/question.gif new file mode 100644 index 0000000..8412424 Binary files /dev/null and b/ImagesSolutionExplorer/question.gif differ diff --git a/LSLEditor.RES b/LSLEditor.RES new file mode 100644 index 0000000..2dd6e4e Binary files /dev/null and b/LSLEditor.RES differ diff --git a/LSLEditor.aps b/LSLEditor.aps new file mode 100644 index 0000000..dddb8bd Binary files /dev/null and b/LSLEditor.aps differ diff --git a/LSLEditor.rc b/LSLEditor.rc new file mode 100644 index 0000000..75927b8 --- /dev/null +++ b/LSLEditor.rc @@ -0,0 +1,5 @@ +thanks.gif GIF "Resource/thanks.gif" +About.htm HTML "Resource/About.htm" +ReleaseNotes.htm HTML "Resource/ReleaseNotes.htm" +IDR_MAINFRAME ICON DISCARDABLE "Resource/App.ico" + diff --git a/LSLEditorForm.Designer.cs b/LSLEditorForm.Designer.cs new file mode 100644 index 0000000..8266777 --- /dev/null +++ b/LSLEditorForm.Designer.cs @@ -0,0 +1,1222 @@ +namespace LSLEditor +{ + partial class LSLEditorForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LSLEditorForm)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.notecardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openProjectSolutionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); + this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newProjectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator19 = new System.Windows.Forms.ToolStripSeparator(); + this.existingProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addToolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); + this.closeFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeSolutiontoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator(); + this.importExampleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.pageSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printPreviewtoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.copyToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.recentFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.recentProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator21 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); + this.FindtoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.findNextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); + this.advancedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.formatDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.formatSelectedTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.commentInToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.uncommentingSelectedTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.solutionExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addNewObjecttoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addNewFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.buildToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.startToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.stopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator(); + this.syntaxCheckerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.horizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.verticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cascadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); + this.ArangeIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.browserInWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.WikiSepBrowserstoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); + this.tabbedViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeActiveWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpKeywordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.ReleaseNotesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); + this.makeBugReporttoolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.closeTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.panel2 = new System.Windows.Forms.Panel(); + this.tabControlExtended2 = new System.Windows.Forms.TabControlExtended(this.components); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.solutionExplorer1 = new LSLEditor.Solution.SolutionExplorer(); + this.splitter2 = new System.Windows.Forms.Splitter(); + this.panel1 = new System.Windows.Forms.Panel(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.pageSetupDialog1 = new System.Windows.Forms.PageSetupDialog(); + this.tabControlExtended1 = new System.Windows.Forms.TabControlExtended(this.components); + this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); + this.menuStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.tabControlExtended2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem, + this.toolStripMenuItem2, + this.projectToolStripMenuItem, + this.buildToolStripMenuItem, + this.toolStripMenuItem3, + this.viewToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(742, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.toolStripSeparator5, + this.addToolStripMenuItem, + this.addToolStripSeparator, + this.closeFileToolStripMenuItem, + this.closeSolutiontoolStripMenuItem, + this.toolStripSeparator20, + this.importExampleToolStripMenuItem, + this.toolStripSeparator4, + this.saveToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.SaveAllToolStripMenuItem, + this.toolStripSeparator3, + this.pageSettingsToolStripMenuItem, + this.printPreviewtoolStripMenuItem, + this.printToolStripMenuItem, + this.toolStripSeparator2, + this.copyToClipboardToolStripMenuItem, + this.toolStripSeparator1, + this.recentFileToolStripMenuItem, + this.recentProjectToolStripMenuItem, + this.toolStripSeparator21, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "File"; + this.fileToolStripMenuItem.Click += new System.EventHandler(this.fileToolStripMenuItem_Click); + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newProjectToolStripMenuItem, + this.newFileToolStripMenuItem, + this.notecardToolStripMenuItem}); + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.newToolStripMenuItem.Text = "New"; + // + // newProjectToolStripMenuItem + // + this.newProjectToolStripMenuItem.Name = "newProjectToolStripMenuItem"; + this.newProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.N))); + this.newProjectToolStripMenuItem.Size = new System.Drawing.Size(204, 22); + this.newProjectToolStripMenuItem.Text = "Solution..."; + this.newProjectToolStripMenuItem.Click += new System.EventHandler(this.newProjectToolStripMenuItem_Click); + // + // newFileToolStripMenuItem + // + this.newFileToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.NEWDOC; + this.newFileToolStripMenuItem.Name = "newFileToolStripMenuItem"; + this.newFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.newFileToolStripMenuItem.Size = new System.Drawing.Size(204, 22); + this.newFileToolStripMenuItem.Text = "Script"; + this.newFileToolStripMenuItem.Click += new System.EventHandler(this.newFileToolStripMenuItem_Click); + // + // notecardToolStripMenuItem + // + this.notecardToolStripMenuItem.Name = "notecardToolStripMenuItem"; + this.notecardToolStripMenuItem.Size = new System.Drawing.Size(204, 22); + this.notecardToolStripMenuItem.Text = "Notecard"; + this.notecardToolStripMenuItem.Click += new System.EventHandler(this.notecardToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + this.openToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openProjectSolutionToolStripMenuItem, + this.openFileToolStripMenuItem}); + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.openToolStripMenuItem.Text = "Open"; + // + // openProjectSolutionToolStripMenuItem + // + this.openProjectSolutionToolStripMenuItem.Name = "openProjectSolutionToolStripMenuItem"; + this.openProjectSolutionToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.O))); + this.openProjectSolutionToolStripMenuItem.Size = new System.Drawing.Size(243, 22); + this.openProjectSolutionToolStripMenuItem.Text = "Project/Solution..."; + this.openProjectSolutionToolStripMenuItem.Click += new System.EventHandler(this.openProjectSolutionToolStripMenuItem_Click); + // + // openFileToolStripMenuItem + // + this.openFileToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.OPEN; + this.openFileToolStripMenuItem.Name = "openFileToolStripMenuItem"; + this.openFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openFileToolStripMenuItem.Size = new System.Drawing.Size(243, 22); + this.openFileToolStripMenuItem.Text = "File..."; + this.openFileToolStripMenuItem.Click += new System.EventHandler(this.openFileToolStripMenuItem_Click); + // + // toolStripSeparator5 + // + this.toolStripSeparator5.Name = "toolStripSeparator5"; + this.toolStripSeparator5.Size = new System.Drawing.Size(188, 6); + // + // addToolStripMenuItem + // + this.addToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newProjectToolStripMenuItem1, + this.toolStripSeparator19, + this.existingProjectToolStripMenuItem}); + this.addToolStripMenuItem.Name = "addToolStripMenuItem"; + this.addToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.addToolStripMenuItem.Text = "Add"; + this.addToolStripMenuItem.Visible = false; + // + // newProjectToolStripMenuItem1 + // + this.newProjectToolStripMenuItem1.Name = "newProjectToolStripMenuItem1"; + this.newProjectToolStripMenuItem1.Size = new System.Drawing.Size(171, 22); + this.newProjectToolStripMenuItem1.Text = "New project..."; + this.newProjectToolStripMenuItem1.Click += new System.EventHandler(this.newProjectToolStripMenuItem1_Click); + // + // toolStripSeparator19 + // + this.toolStripSeparator19.Name = "toolStripSeparator19"; + this.toolStripSeparator19.Size = new System.Drawing.Size(168, 6); + // + // existingProjectToolStripMenuItem + // + this.existingProjectToolStripMenuItem.Name = "existingProjectToolStripMenuItem"; + this.existingProjectToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.existingProjectToolStripMenuItem.Text = "Existing project..."; + this.existingProjectToolStripMenuItem.Click += new System.EventHandler(this.existingProjectToolStripMenuItem_Click); + // + // addToolStripSeparator + // + this.addToolStripSeparator.Name = "addToolStripSeparator"; + this.addToolStripSeparator.Size = new System.Drawing.Size(188, 6); + this.addToolStripSeparator.Visible = false; + // + // closeFileToolStripMenuItem + // + this.closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem"; + this.closeFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W))); + this.closeFileToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.closeFileToolStripMenuItem.Text = "Close"; + this.closeFileToolStripMenuItem.Click += new System.EventHandler(this.closeFileToolStripMenuItem_Click); + // + // closeSolutiontoolStripMenuItem + // + this.closeSolutiontoolStripMenuItem.Enabled = false; + this.closeSolutiontoolStripMenuItem.Name = "closeSolutiontoolStripMenuItem"; + this.closeSolutiontoolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.closeSolutiontoolStripMenuItem.Text = "Close Solution"; + this.closeSolutiontoolStripMenuItem.Click += new System.EventHandler(this.closeSolutiontoolStripMenuItem_Click); + // + // toolStripSeparator20 + // + this.toolStripSeparator20.Name = "toolStripSeparator20"; + this.toolStripSeparator20.Size = new System.Drawing.Size(188, 6); + // + // importExampleToolStripMenuItem + // + this.importExampleToolStripMenuItem.Name = "importExampleToolStripMenuItem"; + this.importExampleToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.importExampleToolStripMenuItem.Text = "Import Example..."; + this.importExampleToolStripMenuItem.Click += new System.EventHandler(this.importExampleToolStripMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(188, 6); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.SAVE; + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.saveToolStripMenuItem.Text = "Save"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.saveAsToolStripMenuItem.Text = "Save As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + // + // SaveAllToolStripMenuItem + // + this.SaveAllToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.SAVEAS; + this.SaveAllToolStripMenuItem.Name = "SaveAllToolStripMenuItem"; + this.SaveAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.S))); + this.SaveAllToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.SaveAllToolStripMenuItem.Text = "Save All"; + this.SaveAllToolStripMenuItem.Click += new System.EventHandler(this.SaveAllToolStripMenuItem_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(188, 6); + // + // pageSettingsToolStripMenuItem + // + this.pageSettingsToolStripMenuItem.Name = "pageSettingsToolStripMenuItem"; + this.pageSettingsToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.pageSettingsToolStripMenuItem.Text = "Page settings..."; + this.pageSettingsToolStripMenuItem.Click += new System.EventHandler(this.pageSettingsToolStripMenuItem_Click); + // + // printPreviewtoolStripMenuItem + // + this.printPreviewtoolStripMenuItem.Name = "printPreviewtoolStripMenuItem"; + this.printPreviewtoolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.printPreviewtoolStripMenuItem.Text = "Print Preview..."; + this.printPreviewtoolStripMenuItem.Click += new System.EventHandler(this.printPreviewtoolStripMenuItem_Click); + // + // printToolStripMenuItem + // + this.printToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.PRINT; + this.printToolStripMenuItem.Name = "printToolStripMenuItem"; + this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.printToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.printToolStripMenuItem.Text = "Print..."; + this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(188, 6); + // + // copyToClipboardToolStripMenuItem + // + this.copyToClipboardToolStripMenuItem.Name = "copyToClipboardToolStripMenuItem"; + this.copyToClipboardToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.copyToClipboardToolStripMenuItem.Text = "Copy to clipboard"; + this.copyToClipboardToolStripMenuItem.Click += new System.EventHandler(this.copyToClipboardToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(188, 6); + // + // recentFileToolStripMenuItem + // + this.recentFileToolStripMenuItem.Name = "recentFileToolStripMenuItem"; + this.recentFileToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.recentFileToolStripMenuItem.Text = "Recent Files"; + this.recentFileToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.recentFileToolStripMenuItem_DropDownItemClicked); + // + // recentProjectToolStripMenuItem + // + this.recentProjectToolStripMenuItem.Name = "recentProjectToolStripMenuItem"; + this.recentProjectToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.recentProjectToolStripMenuItem.Text = "Recent Solutions"; + this.recentProjectToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.recentProjectToolStripMenuItem_DropDownItemClicked); + // + // toolStripSeparator21 + // + this.toolStripSeparator21.Name = "toolStripSeparator21"; + this.toolStripSeparator21.Size = new System.Drawing.Size(188, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(191, 22); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.undoToolStripMenuItem, + this.redoToolStripMenuItem, + this.toolStripSeparator6, + this.cutToolStripMenuItem, + this.copyToolStripMenuItem, + this.pasteToolStripMenuItem, + this.deleteToolStripMenuItem, + this.toolStripSeparator13, + this.selectAllToolStripMenuItem, + this.toolStripMenuItem8, + this.toolStripSeparator7, + this.FindtoolStripMenuItem, + this.toolStripMenuItem1, + this.toolStripSeparator14, + this.advancedToolStripMenuItem}); + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.editToolStripMenuItem.Text = "Edit"; + // + // undoToolStripMenuItem + // + this.undoToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.UNDO; + this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; + this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.undoToolStripMenuItem.Text = "Undo"; + this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click); + // + // redoToolStripMenuItem + // + this.redoToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.REDO; + this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; + this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); + this.redoToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.redoToolStripMenuItem.Text = "Redo"; + this.redoToolStripMenuItem.Click += new System.EventHandler(this.redoToolStripMenuItem_Click); + // + // toolStripSeparator6 + // + this.toolStripSeparator6.Name = "toolStripSeparator6"; + this.toolStripSeparator6.Size = new System.Drawing.Size(221, 6); + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.CUT; + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X"; + this.cutToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.cutToolStripMenuItem.Text = "Cut"; + this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.COPY; + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C"; + this.copyToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.PASTE; + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V"; + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.pasteToolStripMenuItem.Text = "Paste"; + this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); + // + // deleteToolStripMenuItem + // + this.deleteToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.DELETE; + this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; + this.deleteToolStripMenuItem.ShortcutKeyDisplayString = "Del"; + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.deleteToolStripMenuItem.Text = "Delete"; + this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); + // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + this.toolStripSeparator13.Size = new System.Drawing.Size(221, 6); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+A"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.selectAllToolStripMenuItem.Text = "Select All"; + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + // + // toolStripMenuItem8 + // + this.toolStripMenuItem8.Name = "toolStripMenuItem8"; + this.toolStripMenuItem8.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.A))); + this.toolStripMenuItem8.Size = new System.Drawing.Size(224, 22); + this.toolStripMenuItem8.Text = "Select All to SL"; + this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); + // + // toolStripSeparator7 + // + this.toolStripSeparator7.Name = "toolStripSeparator7"; + this.toolStripSeparator7.Size = new System.Drawing.Size(221, 6); + // + // FindtoolStripMenuItem + // + this.FindtoolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.findToolStripMenuItem1, + this.replaceToolStripMenuItem, + this.findNextToolStripMenuItem}); + this.FindtoolStripMenuItem.Name = "FindtoolStripMenuItem"; + this.FindtoolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.FindtoolStripMenuItem.Text = "Find and Replace"; + // + // findToolStripMenuItem1 + // + this.findToolStripMenuItem1.Name = "findToolStripMenuItem1"; + this.findToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.findToolStripMenuItem1.Size = new System.Drawing.Size(162, 22); + this.findToolStripMenuItem1.Text = "Find"; + this.findToolStripMenuItem1.Click += new System.EventHandler(this.findToolStripMenuItem_Click); + // + // replaceToolStripMenuItem + // + this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem"; + this.replaceToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H))); + this.replaceToolStripMenuItem.Size = new System.Drawing.Size(162, 22); + this.replaceToolStripMenuItem.Text = "Replace"; + this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click); + // + // findNextToolStripMenuItem + // + this.findNextToolStripMenuItem.Name = "findNextToolStripMenuItem"; + this.findNextToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3; + this.findNextToolStripMenuItem.Size = new System.Drawing.Size(162, 22); + this.findNextToolStripMenuItem.Text = "Find next"; + this.findNextToolStripMenuItem.Visible = false; + this.findNextToolStripMenuItem.Click += new System.EventHandler(this.findNextToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); + this.toolStripMenuItem1.Size = new System.Drawing.Size(224, 22); + this.toolStripMenuItem1.Text = "Goto..."; + this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); + // + // toolStripSeparator14 + // + this.toolStripSeparator14.Name = "toolStripSeparator14"; + this.toolStripSeparator14.Size = new System.Drawing.Size(221, 6); + // + // advancedToolStripMenuItem + // + this.advancedToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.formatDocumentToolStripMenuItem, + this.formatSelectedTextToolStripMenuItem, + this.commentInToolStripMenuItem, + this.uncommentingSelectedTextToolStripMenuItem}); + this.advancedToolStripMenuItem.Name = "advancedToolStripMenuItem"; + this.advancedToolStripMenuItem.Size = new System.Drawing.Size(224, 22); + this.advancedToolStripMenuItem.Text = "Advanced"; + // + // formatDocumentToolStripMenuItem + // + this.formatDocumentToolStripMenuItem.Name = "formatDocumentToolStripMenuItem"; + this.formatDocumentToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D))); + this.formatDocumentToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.formatDocumentToolStripMenuItem.Text = "Format document"; + this.formatDocumentToolStripMenuItem.Click += new System.EventHandler(this.formatDocumentToolStripMenuItem_Click); + // + // formatSelectedTextToolStripMenuItem + // + this.formatSelectedTextToolStripMenuItem.Name = "formatSelectedTextToolStripMenuItem"; + this.formatSelectedTextToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); + this.formatSelectedTextToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.formatSelectedTextToolStripMenuItem.Text = "Format selected text"; + this.formatSelectedTextToolStripMenuItem.Click += new System.EventHandler(this.formatSelectedTextToolStripMenuItem_Click); + // + // commentInToolStripMenuItem + // + this.commentInToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.ININDENT; + this.commentInToolStripMenuItem.Name = "commentInToolStripMenuItem"; + this.commentInToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K))); + this.commentInToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.commentInToolStripMenuItem.Text = "Commenting selected text"; + this.commentInToolStripMenuItem.Click += new System.EventHandler(this.commentInToolStripMenuItem_Click); + // + // uncommentingSelectedTextToolStripMenuItem + // + this.uncommentingSelectedTextToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.DEINDENT; + this.uncommentingSelectedTextToolStripMenuItem.Name = "uncommentingSelectedTextToolStripMenuItem"; + this.uncommentingSelectedTextToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L))); + this.uncommentingSelectedTextToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.uncommentingSelectedTextToolStripMenuItem.Text = "Uncommenting selected text"; + this.uncommentingSelectedTextToolStripMenuItem.Click += new System.EventHandler(this.uncommentingSelectedTextToolStripMenuItem_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.solutionExplorerToolStripMenuItem}); + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(41, 20); + this.toolStripMenuItem2.Text = "View"; + // + // solutionExplorerToolStripMenuItem + // + this.solutionExplorerToolStripMenuItem.Name = "solutionExplorerToolStripMenuItem"; + this.solutionExplorerToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.solutionExplorerToolStripMenuItem.Text = "Solution Explorer"; + this.solutionExplorerToolStripMenuItem.Click += new System.EventHandler(this.solutionExplorerToolStripMenuItem_Click); + // + // projectToolStripMenuItem + // + this.projectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addNewObjecttoolStripMenuItem, + this.addNewFileToolStripMenuItem}); + this.projectToolStripMenuItem.Name = "projectToolStripMenuItem"; + this.projectToolStripMenuItem.Size = new System.Drawing.Size(53, 20); + this.projectToolStripMenuItem.Text = "Project"; + // + // addNewObjecttoolStripMenuItem + // + this.addNewObjecttoolStripMenuItem.Enabled = false; + this.addNewObjecttoolStripMenuItem.Name = "addNewObjecttoolStripMenuItem"; + this.addNewObjecttoolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.A))); + this.addNewObjecttoolStripMenuItem.Size = new System.Drawing.Size(232, 22); + this.addNewObjecttoolStripMenuItem.Text = "Add New Object"; + this.addNewObjecttoolStripMenuItem.Click += new System.EventHandler(this.addNewObjecttoolStripMenuItem_Click); + // + // addNewFileToolStripMenuItem + // + this.addNewFileToolStripMenuItem.Enabled = false; + this.addNewFileToolStripMenuItem.Name = "addNewFileToolStripMenuItem"; + this.addNewFileToolStripMenuItem.Size = new System.Drawing.Size(232, 22); + this.addNewFileToolStripMenuItem.Text = "Add New Item"; + // + // buildToolStripMenuItem + // + this.buildToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.startToolStripMenuItem, + this.stopToolStripMenuItem, + this.toolStripSeparator23, + this.syntaxCheckerToolStripMenuItem}); + this.buildToolStripMenuItem.Name = "buildToolStripMenuItem"; + this.buildToolStripMenuItem.Size = new System.Drawing.Size(50, 20); + this.buildToolStripMenuItem.Text = "Debug"; + // + // startToolStripMenuItem + // + this.startToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.START; + this.startToolStripMenuItem.Name = "startToolStripMenuItem"; + this.startToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.startToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.startToolStripMenuItem.Text = "Start"; + this.startToolStripMenuItem.Click += new System.EventHandler(this.startToolStripMenuItem_Click); + // + // stopToolStripMenuItem + // + this.stopToolStripMenuItem.Enabled = false; + this.stopToolStripMenuItem.Image = global::LSLEditor.Properties.Resources.END; + this.stopToolStripMenuItem.Name = "stopToolStripMenuItem"; + this.stopToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F5))); + this.stopToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.stopToolStripMenuItem.Text = "Stop"; + this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click); + // + // toolStripSeparator23 + // + this.toolStripSeparator23.Name = "toolStripSeparator23"; + this.toolStripSeparator23.Size = new System.Drawing.Size(177, 6); + // + // syntaxCheckerToolStripMenuItem + // + this.syntaxCheckerToolStripMenuItem.Name = "syntaxCheckerToolStripMenuItem"; + this.syntaxCheckerToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F6; + this.syntaxCheckerToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.syntaxCheckerToolStripMenuItem.Text = "Syntax Checker"; + this.syntaxCheckerToolStripMenuItem.Click += new System.EventHandler(this.syntaxCheckerToolStripMenuItem_Click); + // + // toolStripMenuItem3 + // + this.toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.optionsToolStripMenuItem}); + this.toolStripMenuItem3.Name = "toolStripMenuItem3"; + this.toolStripMenuItem3.Size = new System.Drawing.Size(44, 20); + this.toolStripMenuItem3.Text = "Tools"; + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.optionsToolStripMenuItem.Text = "Options..."; + this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); + // + // viewToolStripMenuItem + // + this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.horizontalToolStripMenuItem, + this.verticalToolStripMenuItem, + this.cascadeToolStripMenuItem, + this.toolStripSeparator11, + this.ArangeIconsToolStripMenuItem, + this.toolStripSeparator10, + this.browserInWindowToolStripMenuItem, + this.WikiSepBrowserstoolStripMenuItem, + this.toolStripSeparator16, + this.tabbedViewToolStripMenuItem, + this.closeActiveWindowToolStripMenuItem}); + this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; + this.viewToolStripMenuItem.Size = new System.Drawing.Size(57, 20); + this.viewToolStripMenuItem.Text = "Window"; + // + // horizontalToolStripMenuItem + // + this.horizontalToolStripMenuItem.Name = "horizontalToolStripMenuItem"; + this.horizontalToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.horizontalToolStripMenuItem.Text = "Horizontal"; + this.horizontalToolStripMenuItem.Click += new System.EventHandler(this.horizontalToolStripMenuItem_Click); + // + // verticalToolStripMenuItem + // + this.verticalToolStripMenuItem.Name = "verticalToolStripMenuItem"; + this.verticalToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.verticalToolStripMenuItem.Text = "Vertical"; + this.verticalToolStripMenuItem.Click += new System.EventHandler(this.verticalToolStripMenuItem_Click); + // + // cascadeToolStripMenuItem + // + this.cascadeToolStripMenuItem.Name = "cascadeToolStripMenuItem"; + this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.cascadeToolStripMenuItem.Text = "Cascade"; + this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.cascadeToolStripMenuItem_Click); + // + // toolStripSeparator11 + // + this.toolStripSeparator11.Name = "toolStripSeparator11"; + this.toolStripSeparator11.Size = new System.Drawing.Size(255, 6); + // + // ArangeIconsToolStripMenuItem + // + this.ArangeIconsToolStripMenuItem.Name = "ArangeIconsToolStripMenuItem"; + this.ArangeIconsToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.ArangeIconsToolStripMenuItem.Text = "Arange Icons"; + this.ArangeIconsToolStripMenuItem.Click += new System.EventHandler(this.normalToolStripMenuItem_Click); + // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(255, 6); + // + // browserInWindowToolStripMenuItem + // + this.browserInWindowToolStripMenuItem.Name = "browserInWindowToolStripMenuItem"; + this.browserInWindowToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.browserInWindowToolStripMenuItem.Text = "Browser in window"; + this.browserInWindowToolStripMenuItem.Click += new System.EventHandler(this.browserInWindowToolStripMenuItem_Click); + // + // WikiSepBrowserstoolStripMenuItem + // + this.WikiSepBrowserstoolStripMenuItem.Name = "WikiSepBrowserstoolStripMenuItem"; + this.WikiSepBrowserstoolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.WikiSepBrowserstoolStripMenuItem.Text = "Online Wiki-pages separate Browser"; + this.WikiSepBrowserstoolStripMenuItem.Click += new System.EventHandler(this.WikiSepBrowserstoolStripMenuItem_Click); + // + // toolStripSeparator16 + // + this.toolStripSeparator16.Name = "toolStripSeparator16"; + this.toolStripSeparator16.Size = new System.Drawing.Size(255, 6); + // + // tabbedViewToolStripMenuItem + // + this.tabbedViewToolStripMenuItem.Name = "tabbedViewToolStripMenuItem"; + this.tabbedViewToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.tabbedViewToolStripMenuItem.Text = "Tabbed document"; + this.tabbedViewToolStripMenuItem.Click += new System.EventHandler(this.tabbedViewToolStripMenuItem_Click); + // + // closeActiveWindowToolStripMenuItem + // + this.closeActiveWindowToolStripMenuItem.Name = "closeActiveWindowToolStripMenuItem"; + this.closeActiveWindowToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F4))); + this.closeActiveWindowToolStripMenuItem.Size = new System.Drawing.Size(258, 22); + this.closeActiveWindowToolStripMenuItem.Text = "Close active window"; + this.closeActiveWindowToolStripMenuItem.Click += new System.EventHandler(this.closeActiveWindowToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.indexToolStripMenuItem, + this.helpKeywordToolStripMenuItem, + this.toolStripSeparator8, + this.checkForUpdatesToolStripMenuItem, + this.toolStripMenuItem4, + this.toolStripSeparator9, + this.ReleaseNotesToolStripMenuItem, + this.toolStripSeparator12, + this.makeBugReporttoolStripMenuItem, + this.toolStripMenuItem6, + this.toolStripSeparator22, + this.toolStripMenuItem5, + this.toolStripSeparator15, + this.toolStripMenuItem7, + this.toolStripSeparator17, + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // indexToolStripMenuItem + // + this.indexToolStripMenuItem.Name = "indexToolStripMenuItem"; + this.indexToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1))); + this.indexToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.indexToolStripMenuItem.Text = "Index LSL Wiki"; + this.indexToolStripMenuItem.Click += new System.EventHandler(this.indexToolStripMenuItem_Click); + // + // helpKeywordToolStripMenuItem + // + this.helpKeywordToolStripMenuItem.Name = "helpKeywordToolStripMenuItem"; + this.helpKeywordToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; + this.helpKeywordToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.helpKeywordToolStripMenuItem.Text = "Help on keyword"; + this.helpKeywordToolStripMenuItem.Click += new System.EventHandler(this.helpKeywordToolStripMenuItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(216, 6); + // + // checkForUpdatesToolStripMenuItem + // + this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; + this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.checkForUpdatesToolStripMenuItem.Text = "Info on the latest release..."; + this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); + // + // toolStripMenuItem4 + // + this.toolStripMenuItem4.Name = "toolStripMenuItem4"; + this.toolStripMenuItem4.Size = new System.Drawing.Size(219, 22); + this.toolStripMenuItem4.Text = "Check for update..."; + this.toolStripMenuItem4.Click += new System.EventHandler(this.toolStripMenuItem4_Click); + // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(216, 6); + // + // ReleaseNotesToolStripMenuItem + // + this.ReleaseNotesToolStripMenuItem.Name = "ReleaseNotesToolStripMenuItem"; + this.ReleaseNotesToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.ReleaseNotesToolStripMenuItem.Text = "Release notes..."; + this.ReleaseNotesToolStripMenuItem.Click += new System.EventHandler(this.ReleaseNotesToolStripMenuItem_Click); + // + // toolStripSeparator12 + // + this.toolStripSeparator12.Name = "toolStripSeparator12"; + this.toolStripSeparator12.Size = new System.Drawing.Size(216, 6); + // + // makeBugReporttoolStripMenuItem + // + this.makeBugReporttoolStripMenuItem.Name = "makeBugReporttoolStripMenuItem"; + this.makeBugReporttoolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.makeBugReporttoolStripMenuItem.Text = "Bug report..."; + this.makeBugReporttoolStripMenuItem.Click += new System.EventHandler(this.makeBugReporttoolStripMenuItem_Click); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(219, 22); + this.toolStripMenuItem6.Text = "LSLEditor Forum..."; + this.toolStripMenuItem6.Click += new System.EventHandler(this.forumStripMenuItem_Click); + // + // toolStripSeparator22 + // + this.toolStripSeparator22.Name = "toolStripSeparator22"; + this.toolStripSeparator22.Size = new System.Drawing.Size(216, 6); + // + // toolStripMenuItem5 + // + this.toolStripMenuItem5.Name = "toolStripMenuItem5"; + this.toolStripMenuItem5.Size = new System.Drawing.Size(219, 22); + this.toolStripMenuItem5.Text = "Donate..."; + this.toolStripMenuItem5.Click += new System.EventHandler(this.toolStripMenuItem5_Click); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(216, 6); + // + // toolStripMenuItem7 + // + this.toolStripMenuItem7.Name = "toolStripMenuItem7"; + this.toolStripMenuItem7.Size = new System.Drawing.Size(219, 22); + this.toolStripMenuItem7.Text = "Contact..."; + this.toolStripMenuItem7.Click += new System.EventHandler(this.toolStripMenuItem7_Click); + // + // toolStripSeparator17 + // + this.toolStripSeparator17.Name = "toolStripSeparator17"; + this.toolStripSeparator17.Size = new System.Drawing.Size(216, 6); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.aboutToolStripMenuItem.Text = "About..."; + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 494); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(742, 22); + this.statusStrip1.TabIndex = 9; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.closeTabToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(112, 26); + // + // closeTabToolStripMenuItem + // + this.closeTabToolStripMenuItem.Name = "closeTabToolStripMenuItem"; + this.closeTabToolStripMenuItem.Size = new System.Drawing.Size(111, 22); + this.closeTabToolStripMenuItem.Text = "Close"; + this.closeTabToolStripMenuItem.Click += new System.EventHandler(this.closeTabToolStripMenuItem_Click); + // + // panel2 + // + this.panel2.Controls.Add(this.tabControlExtended2); + this.panel2.Dock = System.Windows.Forms.DockStyle.Right; + this.panel2.Location = new System.Drawing.Point(542, 24); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(200, 470); + this.panel2.TabIndex = 20; + this.panel2.Visible = false; + // + // tabControlExtended2 + // + this.tabControlExtended2.Controls.Add(this.tabPage1); + this.tabControlExtended2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControlExtended2.Location = new System.Drawing.Point(0, 0); + this.tabControlExtended2.Name = "tabControlExtended2"; + this.tabControlExtended2.SelectedIndex = 0; + this.tabControlExtended2.Size = new System.Drawing.Size(200, 470); + this.tabControlExtended2.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.solutionExplorer1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(192, 444); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "SolutionExplorer"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // solutionExplorer1 + // + this.solutionExplorer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.solutionExplorer1.Location = new System.Drawing.Point(3, 3); + this.solutionExplorer1.Name = "solutionExplorer1"; + this.solutionExplorer1.Size = new System.Drawing.Size(186, 438); + this.solutionExplorer1.TabIndex = 0; + // + // splitter2 + // + this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; + this.splitter2.Location = new System.Drawing.Point(534, 24); + this.splitter2.Name = "splitter2"; + this.splitter2.Size = new System.Drawing.Size(8, 470); + this.splitter2.TabIndex = 22; + this.splitter2.TabStop = false; + // + // panel1 + // + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 458); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(534, 36); + this.panel1.TabIndex = 23; + this.panel1.Visible = false; + // + // splitter1 + // + this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.splitter1.Location = new System.Drawing.Point(0, 450); + this.splitter1.Name = "splitter1"; + this.splitter1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.splitter1.Size = new System.Drawing.Size(534, 8); + this.splitter1.TabIndex = 24; + this.splitter1.TabStop = false; + this.splitter1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitter1_SplitterMoved); + // + // tabControlExtended1 + // + this.tabControlExtended1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.tabControlExtended1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; + this.tabControlExtended1.Location = new System.Drawing.Point(0, 414); + this.tabControlExtended1.Name = "tabControlExtended1"; + this.tabControlExtended1.SelectedIndex = 0; + this.tabControlExtended1.Size = new System.Drawing.Size(534, 36); + this.tabControlExtended1.TabIndex = 25; + this.tabControlExtended1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControlExtended1_MouseDown); + this.tabControlExtended1.SelectedIndexChanged += new System.EventHandler(this.tabControlExtended1_SelectedIndexChanged); + // + // openFileDialog2 + // + this.openFileDialog2.FileName = "openFileDialog2"; + // + // LSLEditorForm + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(742, 516); + this.Controls.Add(this.tabControlExtended1); + this.Controls.Add(this.splitter1); + this.Controls.Add(this.panel1); + this.Controls.Add(this.splitter2); + this.Controls.Add(this.panel2); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.IsMdiContainer = true; + this.MainMenuStrip = this.menuStrip1; + this.Name = "LSLEditorForm"; + this.Text = "LSLEditor"; + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LSLEditorForm_DragDrop); + this.MdiChildActivate += new System.EventHandler(this.LSLEditorForm_MdiChildActivate); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LSLEditorForm_FormClosing); + this.DragEnter += new System.Windows.Forms.DragEventHandler(this.LSLEditorForm_DragEnter); + this.Load += new System.EventHandler(this.LSLEditorForm_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.tabControlExtended2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; + private System.Windows.Forms.ToolStripMenuItem importExampleToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem copyToClipboardToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem projectToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem buildToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem advancedToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; + private System.Windows.Forms.ToolStripMenuItem formatDocumentToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem startToolStripMenuItem; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem formatSelectedTextToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem horizontalToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem verticalToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cascadeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem ArangeIconsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpKeywordToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; + private System.Windows.Forms.ToolStripMenuItem browserInWindowToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; + private System.Windows.Forms.ToolStripMenuItem ReleaseNotesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; + private System.Windows.Forms.ToolStripMenuItem FindtoolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; + private System.Windows.Forms.ToolStripMenuItem stopToolStripMenuItem; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; + private System.Windows.Forms.ToolStripMenuItem tabbedViewToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem closeTabToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem closeActiveWindowToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem WikiSepBrowserstoolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripMenuItem commentInToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem uncommentingSelectedTextToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem replaceToolStripMenuItem; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Splitter splitter2; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.TabControlExtended tabControlExtended1; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem solutionExplorerToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newProjectToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newFileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openProjectSolutionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openFileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newProjectToolStripMenuItem1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator19; + private System.Windows.Forms.ToolStripMenuItem existingProjectToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator addToolStripSeparator; + private System.Windows.Forms.ToolStripMenuItem closeFileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem closeSolutiontoolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator20; + private System.Windows.Forms.ToolStripMenuItem addNewObjecttoolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3; + private System.Windows.Forms.ToolStripMenuItem recentFileToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator21; + private System.Windows.Forms.ToolStripMenuItem printPreviewtoolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem makeBugReporttoolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator22; + private System.Windows.Forms.ToolStripMenuItem recentProjectToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4; + private System.Windows.Forms.TabControlExtended tabControlExtended2; + private System.Windows.Forms.TabPage tabPage1; + private Solution.SolutionExplorer solutionExplorer1; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator23; + private System.Windows.Forms.ToolStripMenuItem syntaxCheckerToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem findNextToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addNewFileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; + private System.Windows.Forms.ToolStripMenuItem pageSettingsToolStripMenuItem; + private System.Windows.Forms.PageSetupDialog pageSetupDialog1; + private System.Windows.Forms.ToolStripMenuItem SaveAllToolStripMenuItem; + private System.Windows.Forms.OpenFileDialog openFileDialog2; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6; + private System.Windows.Forms.ToolStripMenuItem notecardToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem7; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator17; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem8; + } +} \ No newline at end of file diff --git a/LSLEditorForm.cs b/LSLEditorForm.cs new file mode 100644 index 0000000..c275bcb --- /dev/null +++ b/LSLEditorForm.cs @@ -0,0 +1,1880 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Xml; + +using System.Collections.Generic; + +using System.Drawing; +using System.Threading; +using System.Reflection; +using System.Globalization; +using System.Windows.Forms; +using System.Drawing.Printing; + +// aximp is oude informatie, maar ik laat het er even instaan +// aximp %WINDIR%\System32\shdocvw.dll /out:"d:\temp\AxInterop.SHDocVw.dll" /keyfile:"D:\Documents and Settings\Administrator\Mijn documenten\Mijn keys\Test.snk" +// copieer de TWEE files AxInterop.SHDocVw.dll en SHDocVw.dll in de bin/Debug directory +// referentie maken naar die twee files + +// +// Pre build command for using a LSLEditor.rc file containing: About.htm HTML "Resource/About.htm" +// +// "$(DevEnvDir)..\..\SDK\v2.0\bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc" +// +// Project properties Application, resource file + +// At the bottom of the form there are + + +// 1) tabcontrol1 , holding tabbed documents +// 2) splitter1, for increasing simulator window +// 3) panel1 , holding simulator or listview for compiler errors + +// righthand side + +// 1) panel2 , for holding solution explorer + +namespace LSLEditor +{ + public partial class LSLEditorForm : Form + { + public XmlDocument ConfLSL; + public XmlDocument ConfCSharp; + + private Browser browser; + private SimulatorConsole SimulatorConsole; + + public bool CancelClosing = false; + + public GListBoxWindow GListBoxWindow; + public TooltipWindow TooltipMouse; + public TooltipWindow TooltipKeyboard; + public TooltipWindow TooltipListBox; + + public FindWindow findWindow; + public GotoWindow GotoWindow; + + public List llDialogForms; + public List PermissionForms; + + private UpdateApplicationForm updateApplicationForm; + + public SyntaxError SyntaxErrors; + + private System.Diagnostics.Process curProc; + private const int WM_NCACTIVATE = 0x0086; + protected override void WndProc(ref Message m) + { + if (m.Msg == WM_NCACTIVATE) + { + if (m.LParam != IntPtr.Zero) + { + m.WParam = new IntPtr(1); + } + } + else + { + try { curProc.MaxWorkingSet = curProc.MaxWorkingSet; } catch {} + } + base.WndProc(ref m); + } + + public Solution.SolutionExplorer SolutionExplorer + { + get + { + return this.solutionExplorer1; + } + } + + private void SetDefaultProperties() + { + if (Properties.Settings.Default.FontEditor == null) + Properties.Settings.Default.FontEditor = new Font("Courier New", 9.75F, FontStyle.Regular); + + if (Properties.Settings.Default.FontTooltips == null) + Properties.Settings.Default.FontTooltips = new Font(SystemFonts.MessageBoxFont.Name, 9.75F, FontStyle.Regular); + + string strLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + if (Properties.Settings.Default.ProjectLocation == "") + Properties.Settings.Default.ProjectLocation = strLocation; + } + + public LSLEditorForm(string[] args) + { + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false); + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US", false); + + if (args.Length == 1) + { + if (args[0] == "/reset") + { + Properties.Settings.Default.Reset(); + Properties.Settings.Default.CallUpgrade = false; + } + } + + if (Properties.Settings.Default.CallUpgrade) + { + Properties.Settings.Default.Upgrade(); + Properties.Settings.Default.CallUpgrade = false; + } + + // set some normal values on some properties + SetDefaultProperties(); + + curProc = System.Diagnostics.Process.GetCurrentProcess(); + + InitializeComponent(); + + InitRecentFileList(); + InitRecentProjectList(); + InitPluginsList(); + + SetupChildForms(); + + try + { + Start(args); + } + catch (Exception exception) + { + MessageBox.Show("Error:" + OopsFormatter.ApplyFormatting(exception.Message), "Oops"); + } + } + + public Form[] Children + { + get + { + if (this.IsMdiContainer) + return this.MdiChildren; + + List
children = new List(); + foreach (TabPage tabPage in this.tabControlExtended1.TabPages) + children.Add(tabPage.Tag as Form); + return children.ToArray(); + } + } + + public Form ActiveMdiForm + { + get + { + if (this.IsMdiContainer) + return this.ActiveMdiChild; + else + { + if (this.tabControlExtended1.SelectedTab == null) + return null; + return this.tabControlExtended1.SelectedTab.Tag as Form; + } + } + } + + public void ActivateMdiForm(Form form) + { + if (this.IsMdiContainer) + { + this.ActivateMdiChild(form); + } + else + { + for (int intI = 0; intI < this.tabControlExtended1.TabCount; intI++) + { + TabPage tabPage = this.tabControlExtended1.TabPages[intI]; + EditForm f = tabPage.Tag as EditForm; + if (f == form) + { + this.tabControlExtended1.SelectedIndex = intI; + tabPage.Focus(); + break; + } + } + } + } + + public void AddForm(Form form) + { + if (this.IsMdiContainer) + { + form.MdiParent = this; + form.Tag = null; + form.Show(); + ActivateMdiChild(form); + } + else + { + form.Visible = false; + form.MdiParent = null; + TabPage tabPage = new TabPage(form.Text+" "); + tabPage.BackColor = Color.White; + for(int intI=form.Controls.Count-1;intI>=0;intI--) + tabPage.Controls.Add(form.Controls[intI]); + tabPage.Tag = form; + form.Tag = tabPage; + //tabPage.Controls.Add(form.Controls[0]); + this.tabControlExtended1.TabPages.Add(tabPage); + this.tabControlExtended1.SelectedTab = tabPage; + } + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.DoEvents(); + Application.Run(new LSLEditorForm(args)); + } + + private void Start(string[] args) + { + this.ConfLSL = GetXmlFromResource(Properties.Settings.Default.ConfLSL); + this.ConfCSharp = GetXmlFromResource(Properties.Settings.Default.ConfCSharp); + + this.openFileDialog1.FileName = ""; + this.openFileDialog1.InitialDirectory = Properties.Settings.Default.WorkingDirectory; + this.openFileDialog1.Filter = "Secondlife script files (*.lsl)|*.lsl|All files (*.*)|*.*"; + + this.saveFileDialog1.FileName = ""; + this.saveFileDialog1.InitialDirectory = Properties.Settings.Default.WorkingDirectory; + this.saveFileDialog1.Filter = "Secondlife script files (*.lsl)|*.lsl|All files (*.*)|*.*"; + + this.openFileDialog2.Multiselect = false; + this.openFileDialog2.FileName = ""; + this.openFileDialog2.Filter = "LSLEditor Solution File (*.sol)|*.sol|All Files (*.*)|*.*"; + this.openFileDialog2.InitialDirectory = Properties.Settings.Default.ProjectLocation; + + + Version version = Assembly.GetExecutingAssembly().GetName().Version; + this.Text += " " + version.Major + "." + version.Minor; + + if (System.Diagnostics.Debugger.IsAttached) + { + this.Text += " (ALPHA)"; + } + else + { + if (Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location).Contains("beta")) + this.Text += " (BETA)"; + } + + // enables close buttons on tab + this.tabControlExtended1.SetDrawMode(); + this.tabControlExtended1.OnTabClose += new EventHandler(tabControl1_OnTabClose); + + if (args.Length == 0) + { + NewFile(); + } + else + { + if (args[0] == "/reset") + { + NewFile(); + } + else + { + if (Path.GetExtension(args[0]) == ".sol") + { + this.SolutionExplorer.OpenSolution(args[0]); + } + else + { + bool blnRun = false; + foreach (string strFileName in args) + { + if (strFileName == "/run") + { + blnRun = true; + continue; + } + EditForm editForm = new EditForm(this); + editForm.LoadFile(strFileName); + editForm.TextBox.OnCursorPositionChanged += new SyntaxRichTextBox.CursorPositionChangedHandler(TextBox_OnCursorPositionChanged); + AddForm(editForm); + } + if (blnRun) + { + this.stopToolStripMenuItem.Enabled = true; + StartSimulator(); + } + } + } + } + } + + void TextBox_OnCursorPositionChanged(object sender, SyntaxRichTextBox.CursorPositionEventArgs e) + { + this.toolStripStatusLabel1.Text = string.Format("Ln {0,-10} Col {1,-10} Ch {2,-20} Ttl {3,-10} {4,-10} {5,-10}", e.Line, e.Column, e.Char, e.Total, e.Insert ? "INS" : "OVR", e.Caps ? "CAP" : ""); + } + + private XmlDocument GetXmlFromResource(string strName) + { + XmlDocument xml = new XmlDocument(); + Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream(this.GetType().Namespace + "."+strName); + + if (resource != null) + xml.Load(resource); + return xml; + } + + private void NewNotecard() + { + EditForm editForm = new EditForm(this); + editForm.IsScript = false; + editForm.FullPathName = Properties.Settings.Default.ExampleNameNotecard; + editForm.TextBox.OnCursorPositionChanged += new SyntaxRichTextBox.CursorPositionChangedHandler(TextBox_OnCursorPositionChanged); + editForm.Dirty = false; + AddForm(editForm); + } + + private void NewFile() + { + EditForm editForm = new EditForm(this); + editForm.SourceCode = Helpers.GetTemplate.Source(); + editForm.TextBox.FormatDocument(); + editForm.TextBox.ClearUndoStack(); + editForm.FullPathName = Properties.Settings.Default.ExampleName; + editForm.TextBox.OnCursorPositionChanged += new SyntaxRichTextBox.CursorPositionChangedHandler(TextBox_OnCursorPositionChanged); + AddForm(editForm); + } + + public EditForm OpenFile(string strPath, Guid guid, bool blnIsScript) + { + EditForm editForm = null; + if (this.Children.Length > 0) + { + editForm = this.Children[0] as EditForm; + if (editForm != null && !editForm.IsDisposed) + { + if (editForm.ScriptName != Properties.Settings.Default.ExampleName || editForm.Dirty) + editForm = null; + } + } + + if (editForm == null) + { + editForm = new EditForm(this); + editForm.TextBox.OnCursorPositionChanged += new SyntaxRichTextBox.CursorPositionChangedHandler(TextBox_OnCursorPositionChanged); + AddForm(editForm); + } + + editForm.guid = guid; + editForm.IsScript = blnIsScript; + editForm.LoadFile(strPath); + + // 23 oct 2007 + ActivateMdiForm(editForm); + + UpdateRecentFileList(strPath); + + return editForm; + } + + public void OpenFile(string strPath, Guid guid) + { + OpenFile(strPath, guid, true); + } + + private void OpenFile(string strFileName) + { + OpenFile(strFileName, Guid.Empty , true); + } + + private string ClippedPath(string strPath) + { + if (strPath.Length < Properties.Settings.Default.PathClipLength) + return strPath; + + string strRoot = Path.GetPathRoot(strPath); + string strTmp = ""; + while (strTmp.Length < Properties.Settings.Default.PathClipLength) + { + strTmp = Path.Combine(Path.GetFileName(strPath) , strTmp); + strPath = Path.GetDirectoryName(strPath); + if (strPath == strRoot || strPath == null) + break; + } + return Path.Combine(Path.Combine(strRoot, "..."), strTmp); + } + + private void InitRecentFileList() + { + if (Properties.Settings.Default.RecentFileList == null) + Properties.Settings.Default.RecentFileList = new System.Collections.Specialized.StringCollection(); + int intLen = Properties.Settings.Default.RecentFileList.Count; + for (int intI = 0; intI < intLen; intI++) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(ClippedPath(Properties.Settings.Default.RecentFileList[intI])); + tsmi.Tag = Properties.Settings.Default.RecentFileList[intI]; + this.recentFileToolStripMenuItem.DropDownItems.Add(tsmi); + } + } + + private void InitRecentProjectList() + { + if (Properties.Settings.Default.RecentProjectList == null) + Properties.Settings.Default.RecentProjectList = new System.Collections.Specialized.StringCollection(); + int intLen = Properties.Settings.Default.RecentProjectList.Count; + for (int intI = 0; intI < intLen; intI++) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(ClippedPath(Properties.Settings.Default.RecentProjectList[intI])); + tsmi.Tag = Properties.Settings.Default.RecentProjectList[intI]; + this.recentProjectToolStripMenuItem.DropDownItems.Add(tsmi); + } + } + + private void InitPluginsList() + { + // erase old plugins + for (int intI = this.toolStripMenuItem3.DropDownItems.Count - 1; intI > 0; intI--) + this.toolStripMenuItem3.DropDownItems.RemoveAt(intI); + + if (Properties.Settings.Default.Plugins == null) + return; + + ToolStripMenuItem tsmi; + EventHandler handler = new EventHandler(this.PluginsHandler); + foreach (string strPlugin in Properties.Settings.Default.Plugins) + { + if(strPlugin.ToLower().Contains("lslint")) + tsmi = new ToolStripMenuItem(strPlugin, null, handler, Keys.F7); + else + tsmi = new ToolStripMenuItem(strPlugin, null, handler); + this.toolStripMenuItem3.DropDownItems.Add(tsmi); + } + } + + private void UpdateRecentFileList(string strPath) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(ClippedPath(strPath)); + tsmi.Tag = strPath; + this.recentFileToolStripMenuItem.DropDownItems.Insert(0, tsmi); + Properties.Settings.Default.RecentFileList.Insert(0, strPath); + int intListLen = Properties.Settings.Default.RecentFileList.Count; + for (int intI = intListLen - 1; intI > 0; intI--) + { + if (strPath.ToLower() == Properties.Settings.Default.RecentFileList[intI].ToLower()) + { + this.recentFileToolStripMenuItem.DropDownItems.RemoveAt(intI); + Properties.Settings.Default.RecentFileList.RemoveAt(intI); + } + } + int intLen = Properties.Settings.Default.RecentFileMax; + if (this.recentFileToolStripMenuItem.DropDownItems.Count > intLen) + { + this.recentFileToolStripMenuItem.DropDownItems.RemoveAt(intLen); + Properties.Settings.Default.RecentFileList.RemoveAt(intLen); + } + } + + public void UpdateRecentProjectList(string strPath, bool AddToList) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(ClippedPath(strPath)); + tsmi.Tag = strPath; + + if (AddToList) + { + this.recentProjectToolStripMenuItem.DropDownItems.Insert(0, tsmi); + Properties.Settings.Default.RecentProjectList.Insert(0, strPath); + } + + int intListLen = Properties.Settings.Default.RecentProjectList.Count; + for (int intI = intListLen - 1; intI > 0; intI--) + { + if (strPath.ToLower() == Properties.Settings.Default.RecentProjectList[intI].ToLower()) + { + this.recentProjectToolStripMenuItem.DropDownItems.RemoveAt(intI); + Properties.Settings.Default.RecentProjectList.RemoveAt(intI); + } + } + + int intLen = Properties.Settings.Default.RecentProjectMax; + if (this.recentProjectToolStripMenuItem.DropDownItems.Count > intLen) + { + this.recentProjectToolStripMenuItem.DropDownItems.RemoveAt(intLen); + Properties.Settings.Default.RecentProjectList.RemoveAt(intLen); + } + + } + + private void ReadFile() + { + this.openFileDialog1.Multiselect = true; + if (this.openFileDialog1.ShowDialog() == DialogResult.OK) + { + foreach (string strFileName in this.openFileDialog1.FileNames) + { + if (File.Exists(strFileName)) + { + OpenFile(strFileName, Guid.NewGuid()); + UpdateRecentFileList(strFileName); + } + } + } + } + + private void importExampleToolStripMenuItem_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + browser.ShowWebBrowser("Import Examples", Properties.Settings.Default.Examples); + } + + public bool SaveFile(EditForm editForm, bool blnSaveAs) + { + DialogResult dialogresult = DialogResult.OK; + if (editForm.FullPathName == Properties.Settings.Default.ExampleName || blnSaveAs) + { + this.saveFileDialog1.FileName = editForm.FullPathName; + string strExtension = Path.GetExtension(editForm.FullPathName); + this.saveFileDialog1.Filter = "Secondlife script files (*" + strExtension + ")|*" + strExtension + "|All files (*.*)|*.*"; + dialogresult = this.saveFileDialog1.ShowDialog(); + if (dialogresult == DialogResult.OK) + editForm.FullPathName = this.saveFileDialog1.FileName; + } + if (dialogresult == DialogResult.OK) + { + editForm.SaveCurrentFile(); + UpdateRecentFileList(editForm.FullPathName); + return true; + } + return false; + } + + // save file of active MDI child, if any + private bool SaveActiveFile() + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return false; + // save as!! + return SaveFile(editForm,true); + } + + + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.SaveCurrentFile(); + this.Focus(); + } + + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + { + SaveActiveFile(); + } + + private Browser GetBrowser() + { + if (this.browser == null || this.browser.IsDisposed) + { + this.browser = new Browser(this); + if (Properties.Settings.Default.BrowserLocation != Point.Empty) + { + this.browser.StartPosition = FormStartPosition.Manual; + this.browser.Location = Properties.Settings.Default.BrowserLocation; + } + if (Properties.Settings.Default.BrowserSize != Size.Empty) + this.browser.Size = Properties.Settings.Default.BrowserSize; + this.browser.SizeChanged += new EventHandler(browser_SizeChanged); + this.browser.LocationChanged += new EventHandler(browser_LocationChanged); + if (this.browserInWindowToolStripMenuItem.Checked) + { + this.browser.MdiParent = null; + this.browser.Show(); + } + else + { + AddForm(this.browser); + //this.browser.MdiParent = this; + } + } + this.browser.Activate(); + + if (this.IsMdiContainer) + { + this.ActivateMdiChild(this.browser); + } + else + { + for (int intI = 0; intI < this.tabControlExtended1.TabCount; intI++) + { + TabPage tabPage = this.tabControlExtended1.TabPages[intI]; + Browser b = tabPage.Tag as Browser; + if (b == this.browser) + { + this.tabControlExtended1.SelectedIndex = intI; + tabPage.Focus(); + break; + } + } + } + + return this.browser; + } + + void browser_LocationChanged(object sender, EventArgs e) + { + Properties.Settings.Default.BrowserLocation = browser.Location; + } + + void browser_SizeChanged(object sender, EventArgs e) + { + Properties.Settings.Default.BrowserSize = browser.Size; + } + + #region printing + private void pageSettingsToolStripMenuItem_Click(object sender, EventArgs e) + { + // Initialize the dialog's PrinterSettings property to hold user + // defined printer settings. + pageSetupDialog1.PageSettings = + new System.Drawing.Printing.PageSettings(); + + // Initialize dialog's PrinterSettings property to hold user + // set printer settings. + pageSetupDialog1.PrinterSettings = + new System.Drawing.Printing.PrinterSettings(); + + //Do not show the network in the printer dialog. + pageSetupDialog1.ShowNetwork = false; + + //Show the dialog storing the result. + if (pageSetupDialog1.ShowDialog() != DialogResult.OK) + { + pageSetupDialog1.PageSettings = null; + pageSetupDialog1.PrinterSettings = null; + } + } + + private void printPreviewtoolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + Helpers.PrinterHelper printer = new Helpers.PrinterHelper(pageSetupDialog1); + printer.Title = editForm.FullPathName; + printer.SubTitle = DateTime.Now.ToString("s"); + printer.Footer = this.Text; + printer.PrintPreviewEditForm(editForm); + } + + private void printToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + Helpers.PrinterHelper printer = new Helpers.PrinterHelper(pageSetupDialog1); + printer.Title = editForm.FullPathName; + printer.SubTitle = DateTime.Now.ToString("s"); + printer.Footer = this.Text; + printer.PrintEditForm(editForm); + } + #endregion + + private void copyToClipboardToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.ToClipBoard(); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void undoToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Undo(); + } + + private void redoToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Redo(); + } + + private void cutToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Cut(); + } + + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Copy(); + } + + private void pasteToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Paste(); + } + + private void deleteToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.Delete(); + } + + private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.SelectAll(); + } + + private void formatDocumentToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.FormatDocument(); + } + + private void formatSelectedTextToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.AutoFormatSelectedText(); + } + + + private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm != null) + { + ToolStripMenuItem tsmi = sender as ToolStripMenuItem; + if (tsmi != null) + { + tsmi.Checked = !tsmi.Checked; + editForm.TextBox.WordWrap = tsmi.Checked; + } + } + + } + + private void startToolStripMenuItem_Click(object sender, EventArgs e) + { + this.stopToolStripMenuItem.Enabled = true; + StartSimulator(); + } + + private void stopToolStripMenuItem_Click(object sender, EventArgs e) + { + this.stopToolStripMenuItem.Enabled = false; + StopSimulator(); + } + + private void aboutToolStripMenuItem_Click(object sender, EventArgs e) + { + About about = new About(this); + about.ShowDialog(this); + } + + public void OnDirtyChanged(bool blnEnableSave) + { + this.saveToolStripMenuItem.Enabled = blnEnableSave; + } + + private void SetFontsOnWindows() + { + Font listBoxFont; + Font toolTipFont; + + if (Properties.Settings.Default.FontEditor == null) + Properties.Settings.Default.FontEditor = new Font("Courier New", 9.75F, FontStyle.Regular); + + if (Properties.Settings.Default.FontTooltips == null) + Properties.Settings.Default.FontTooltips = new Font(SystemFonts.MessageBoxFont.Name, 9.75F, FontStyle.Regular); + + toolTipFont = Properties.Settings.Default.FontTooltips; + listBoxFont = Properties.Settings.Default.FontEditor; + + this.TooltipMouse.Font = toolTipFont; + this.TooltipKeyboard.Font = toolTipFont; + this.TooltipListBox.Font = toolTipFont; + this.GListBoxWindow.Font = listBoxFont; + + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + editForm.SetFont(); + } + } + + private void SetupChildForms() + { + Font listBoxFont = Properties.Settings.Default.FontEditor; + Font toolTipFont = Properties.Settings.Default.FontTooltips; + + this.TooltipMouse = new TooltipWindow(this); + this.TooltipKeyboard = new TooltipWindow(this); + this.TooltipListBox = new TooltipWindow(this); + this.GListBoxWindow = new GListBoxWindow(this); + + SetFontsOnWindows(); + + this.solutionExplorer1.parent = this; + this.solutionExplorer1.CreateNewFileDrowDownMenu(this.addNewFileToolStripMenuItem); + this.solutionExplorerToolStripMenuItem.Checked = Properties.Settings.Default.ShowSolutionExplorer; + ShowSolutionExplorer(this.solutionExplorerToolStripMenuItem.Checked); + + this.llDialogForms = new List(); + this.PermissionForms = new List(); + + this.TooltipMouse.Tag = ""; + this.TooltipKeyboard.Tag = ""; + this.TooltipListBox.Tag = ""; + this.TooltipListBox.XOffset = 200; // TODO, afhankelijk van toegepaste font + this.GListBoxWindow.Tag = ""; + + ImageList imageList = new ImageList(); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Unknown.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Functions.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Events.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Constants.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Class.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Vars.gif")); + imageList.Images.Add(new Bitmap(this.GetType(), "Images.Properties.gif")); + + this.GListBoxWindow.GListBox.ImageList = imageList; + + this.Move += new EventHandler(LSLEditorForm_SetPosition); + this.Resize += new EventHandler(LSLEditorForm_SetPosition); + + this.GListBoxWindow.GListBox.DoubleClick += new EventHandler(GListBox_DoubleClick); + this.GListBoxWindow.GListBox.SelectedIndexChanged += new EventHandler(GListBox_SelectedIndexChanged); + } + + void GListBox_SelectedIndexChanged(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm != null) + editForm.TextBox.ShowTooltipOnListBox(); + } + + void GListBox_DoubleClick(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm != null) + editForm.TextBox.InsertSelectedWord(); + + } + + private void LSLEditorForm_SetPosition(object sender, EventArgs e) + { + foreach (PermissionsForm pf in this.PermissionForms) + { + pf.Top = this.Top + 30; + pf.Left = this.Right - pf.Width - 5; + } + foreach(llDialogForm df in this.llDialogForms) + { + df.Top = this.Top + 30; + df.Left = this.Right - df.Width - 5; + } + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm != null) + editForm.TextBox.SetPosition(Screen.PrimaryScreen.WorkingArea); + } + + private void LoadProperties() + { + try + { + this.tabControlExtended1.Visible = false; + + // this.panel1.Visible = false; // Simulator + // this.panel2.Visible = false; // right pane + + string strVersion = Properties.Settings.Default.Version; + + Size size = Properties.Settings.Default.LSLEditorSize; + Point location = Properties.Settings.Default.LSLEditorLocation; + Rectangle rect = new Rectangle(location, size); + if(Screen.PrimaryScreen.WorkingArea.Contains(rect)) + { + if (size.Width > 100 && size.Height > 100) + { + this.Location = location; + this.Size = size; + } + } + + this.browserInWindowToolStripMenuItem.Checked = + Properties.Settings.Default.BrowserInWindow; + + this.tabbedViewToolStripMenuItem.Checked = + Properties.Settings.Default.TabbedDocument; + + if (this.tabbedViewToolStripMenuItem.Checked) + SwitchDocumentView(); + + this.WikiSepBrowserstoolStripMenuItem.Checked = + Properties.Settings.Default.WikiSeperateBrowser; + + } + catch(Exception exception) + { + MessageBox.Show("Error Properties: " + OopsFormatter.ApplyFormatting(exception.Message), "Oops, but continue"); + } + } + + public bool CloseAllOpenWindows() + { + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + ActivateMdiForm(editForm); + if (editForm.Dirty) + { + DialogResult dialogResult = MessageBox.Show(this, @"Save """ + editForm.ScriptName + @"""?", "File has changed", MessageBoxButtons.YesNoCancel); + if (dialogResult == DialogResult.Cancel) + { + return false; + } + if (dialogResult == DialogResult.Yes) + { + if(!SaveFile(editForm, false)) + return false; + } + if (dialogResult == DialogResult.No) + { + editForm.Dirty = false; + } + } + CloseActiveWindow(); + } + return true; + } + + private void LSLEditorForm_FormClosing(object sender, FormClosingEventArgs e) + { + try + { + Properties.Settings.Default.LSLEditorSize = this.Size; + Properties.Settings.Default.LSLEditorLocation = this.Location; + + Properties.Settings.Default.Save(); + + if (this.IsMdiContainer) + { + // this is set by any EditForm close + e.Cancel = this.CancelClosing; + return; + } + + if (this.SolutionExplorer != null & !this.SolutionExplorer.IsDisposed) + { + this.SolutionExplorer.CloseSolution(); + } + + e.Cancel = !CloseAllOpenWindows(); + + } + catch + { + } + } + + + private void helpKeywordToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + Point dummy; + string strKeyWord = editForm.TextBox.GetCurrentKeyWord(false, out dummy); + ShowHelpOnKeyWord(strKeyWord); + } + + private void ShowHelpOnKeyWord(string strKeyWord) + { + if (Properties.Settings.Default.HelpOffline) + { + string strHelpFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.HelpOfflineFile); + if (!File.Exists(strHelpFile)) + { + if (MessageBox.Show("No Offline help, use Online Wiki?", "Offline Help fails", MessageBoxButtons.OKCancel,MessageBoxIcon.Question) != DialogResult.OK) + return; + } + else + { + if (strKeyWord == "") + Help.ShowHelp(this, strHelpFile); + else + Help.ShowHelp(this, strHelpFile, HelpNavigator.KeywordIndex, strKeyWord); + return; + } + } + + string strUrl = Properties.Settings.Default.Help + strKeyWord; + + if (strKeyWord == "") + strKeyWord = "Help"; + + if (Properties.Settings.Default.WikiSeperateBrowser) + { + System.Diagnostics.Process.Start(strUrl); + } + else + { + Browser browser = GetBrowser(); + browser.ShowWebBrowser(strKeyWord, strUrl); + } + } + + private void indexToolStripMenuItem_Click(object sender, EventArgs e) + { + string strKeyWord = "HomePage"; + ShowHelpOnKeyWord(strKeyWord); + } + + private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + browser.ShowWebBrowser("Check for Updates", Properties.Settings.Default.Update + strVersion); + } + + private void horizontalToolStripMenuItem_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.TileHorizontal); + } + + private void verticalToolStripMenuItem_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.TileVertical); + } + + private void cascadeToolStripMenuItem_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.Cascade); + } + + private void normalToolStripMenuItem_Click(object sender, EventArgs e) + { + this.LayoutMdi(MdiLayout.ArrangeIcons); + } + + private void browserInWindowToolStripMenuItem_Click(object sender, EventArgs e) + { + this.browserInWindowToolStripMenuItem.Checked = !this.browserInWindowToolStripMenuItem.Checked; + Properties.Settings.Default.BrowserInWindow = this.browserInWindowToolStripMenuItem.Checked; + } + + private void InitSyntaxError() + { + // information out of every script + if (this.SyntaxErrors == null) + { + this.SyntaxErrors = new SyntaxError(); + this.SyntaxErrors.OnSyntaxError += new SyntaxError.SyntaxErrorHandler(SyntaxErrors_OnSyntaxError); + this.SyntaxErrors.Dock = DockStyle.Fill; + } + this.SyntaxErrors.Clear(); + } + + private void SyntaxErrors_OnSyntaxError(object sender, SyntaxError.SyntaxErrorEventArgs e) + { + EditForm editForm = null; + foreach (Form form in this.Children) + { + editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + if (editForm.FullPathName == e.FullPathName) + { + ActivateMdiForm(editForm); + editForm.TextBox.Goto(e.Line, e.Char); + editForm.Focus(); + return; + } + } + editForm = OpenFile(e.FullPathName,e.EditFormGuid,e.IsScript); + editForm.TextBox.Goto(e.Line, e.Char); + editForm.Focus(); + } + + private void StartSimulator() + { + if (!SyntaxCheck(true)) + return; + + this.SimulatorConsole = new SimulatorConsole(this.SolutionExplorer, this.Children); + this.panel1.Controls.Clear(); + this.panel1.Controls.Add(this.SimulatorConsole); + this.panel1.Visible = true; + this.splitter1.SplitPosition = Properties.Settings.Default.SimulatorSize.Height; + } + + public void StopSimulator() + { + this.panel1.Visible = false; + if (this.SimulatorConsole != null) + { + this.SimulatorConsole.Stop(); + this.SimulatorConsole.Dispose(); + } + this.SimulatorConsole = null; + } + + + private bool SyntaxCheck(bool Silent) + { + this.panel1.Visible = false; + InitSyntaxError(); + + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + if (Properties.Settings.Default.AutoSaveOnDebug) + { + if (editForm.Dirty) + editForm.SaveCurrentFile(); + } + editForm.SyntaxCheck(); + } + + if (this.SyntaxErrors.HasErrors) + { + this.panel1.Controls.Clear(); + this.panel1.Controls.Add(this.SyntaxErrors); + this.panel1.Visible = true; + this.splitter1.SplitPosition = Properties.Settings.Default.SimulatorSize.Height; + return false; + } + else + { + if (!Silent) + MessageBox.Show("LSL Syntax seems OK", "LSL Syntax Checker", MessageBoxButtons.OK, MessageBoxIcon.Information); + return true; + } + } + + private void ReleaseNotesToolStripMenuItem_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + string strExeFileName = Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase); + browser.ShowWebBrowser("Release notes", "res://" + strExeFileName + "/" + Properties.Settings.Default.ReleaseNotes); + + } + + void findForm_LocationChanged(object sender, EventArgs e) + { + Properties.Settings.Default.FindLocation = findWindow.Location; + } + + void gotoForm_LocationChanged(object sender, EventArgs e) + { + Properties.Settings.Default.GotoLocation = GotoWindow.Location; + } + + private void splitter1_SplitterMoved(object sender, SplitterEventArgs e) + { + if( this.splitter1.SplitPosition>50) + Properties.Settings.Default.SimulatorSize = new Size(this.splitter1.Width, this.splitter1.SplitPosition); + } + + void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + this.GListBoxWindow.Visible = false; + this.TooltipMouse.Visible = false; + this.TooltipKeyboard.Visible = false; + this.TooltipListBox.Visible = false; + } + + private void SwitchDocumentView() + { + bool blnTabbed = this.tabbedViewToolStripMenuItem.Checked; + + this.horizontalToolStripMenuItem.Enabled = !blnTabbed; + this.verticalToolStripMenuItem.Enabled = !blnTabbed; + this.cascadeToolStripMenuItem.Enabled = !blnTabbed; + this.ArangeIconsToolStripMenuItem.Enabled = !blnTabbed; + + if (blnTabbed) + { + if (!this.IsMdiContainer) + return;// no change + this.tabControlExtended1.TabPages.Clear(); + foreach (Form form in this.Children) + { + //AddForm(editForm); + form.Visible = false; + form.MdiParent = null; + TabPage tabPage = new TabPage(form.Text+" "); + tabPage.BackColor = Color.White; + tabPage.Tag = form; + form.Tag = tabPage; + tabPage.Controls.Add(form.Controls[0]); + this.tabControlExtended1.TabPages.Add(tabPage); + } + this.IsMdiContainer = false; + this.tabControlExtended1.Dock = DockStyle.Fill; + this.tabControlExtended1.SelectedIndexChanged += new EventHandler(tabControl1_SelectedIndexChanged); + this.tabControlExtended1.Visible = true; + } + else + { + if (this.IsMdiContainer) + return;// no change + + this.tabControlExtended1.Visible = false; + //this.tabControl1.Dock = DockStyle.Bottom; + this.IsMdiContainer = true; + foreach (TabPage tabPage in this.tabControlExtended1.TabPages) + { + Form form = tabPage.Tag as Form; + if (form != null) + { + form.Tag = null; + form.Controls.Add(tabPage.Controls[0]); + form.MdiParent = this; + form.Visible = true; + } + } + this.tabControlExtended1.TabPages.Clear(); + } + Properties.Settings.Default.TabbedDocument = blnTabbed; + } + + private void tabbedViewToolStripMenuItem_Click(object sender, EventArgs e) + { + this.tabbedViewToolStripMenuItem.Checked = !this.tabbedViewToolStripMenuItem.Checked; + Properties.Settings.Default.TabbedDocument = this.tabbedViewToolStripMenuItem.Checked; + SwitchDocumentView(); + } + + private void tabControlExtended1_MouseDown(object sender, MouseEventArgs e) + { + TabControl tabControl = sender as TabControl; + if (tabControl == null) + return; + if (e.Button == MouseButtons.Right) + { + for (int intI = 0; intI < tabControl.TabCount; intI++) + { + Rectangle rt = tabControl.GetTabRect(intI); + if (e.X > rt.Left && e.X < rt.Right + && e.Y > rt.Top && e.Y < rt.Bottom) + { + this.contextMenuStrip1.Tag = intI; + this.contextMenuStrip1.Show(tabControl, new Point(e.X, e.Y)); + } + } + } + } + + private bool IsInSolutionExplorer(Guid guid) + { + if (this.SolutionExplorer == null || this.SolutionExplorer.IsDisposed) + return false; + if (this.SolutionExplorer.GetKey(guid) == null) + return false; + return true; + + } + + private void CloseTab(int intTabToDelete) + { + // reset toolstrip information + this.toolStripStatusLabel1.Text = ""; + + //int intTabToDelete = (int)this.contextMenuStrip1.Tag; + if (intTabToDelete >= this.tabControlExtended1.TabCount) + return; + TabPage tabPage = this.tabControlExtended1.TabPages[intTabToDelete]; + if (tabPage.Text.Contains("Browser")) + { + this.browser.Dispose(); + this.browser = null; + GC.Collect(); + } + + EditForm editForm = tabPage.Tag as EditForm; + if (editForm != null && !editForm.IsDisposed) + { + if (editForm.Dirty) + { + this.ActivateMdiForm(editForm); + DialogResult dialogResult = MessageBox.Show(this, @"Save """ + editForm.ScriptName + @"""?", "File has changed", MessageBoxButtons.YesNoCancel); + if (dialogResult == DialogResult.Cancel) + return; + if (dialogResult == DialogResult.Yes) + { + if(IsInSolutionExplorer(editForm.guid)) + { + editForm.SaveCurrentFile(); + } + else + { + // save as + if(!SaveFile(editForm, true)) + return; + } + } + } + editForm.Dispose(); + editForm = null; + } + this.tabControlExtended1.TabPages[intTabToDelete].Dispose(); + GC.Collect(); + } + + private void tabControl1_OnTabClose(object sender, EventArgs e) + { + int intTabToDelete = (int)sender; + CloseTab(intTabToDelete); + } + + private void closeTabToolStripMenuItem_Click(object sender, EventArgs e) + { + int intTabToDelete = (int)this.contextMenuStrip1.Tag; + CloseTab(intTabToDelete); + } + + private void toolStripMenuItem1_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + if (GotoWindow == null || GotoWindow.IsDisposed) + { + GotoWindow = new GotoWindow(this); + if (Properties.Settings.Default.GotoLocation != Point.Empty) + { + GotoWindow.StartPosition = FormStartPosition.Manual; + GotoWindow.Location = Properties.Settings.Default.GotoLocation; + } + GotoWindow.LocationChanged += new EventHandler(gotoForm_LocationChanged); + } + GotoWindow.Show(this); + } + + + public void CloseActiveWindow() + { + if (this.IsMdiContainer) + { + if(this.ActiveMdiForm!=null && !this.ActiveMdiForm.IsDisposed) + this.ActiveMdiForm.Close(); + } + else + { + int intTabToClose = this.tabControlExtended1.SelectedIndex; + if (intTabToClose >= 0) + CloseTab(intTabToClose); + } + } + + private void closeActiveWindowToolStripMenuItem_Click(object sender, EventArgs e) + { + CloseActiveWindow(); + } + + private void WikiSepBrowserstoolStripMenuItem_Click(object sender, EventArgs e) + { + WikiSepBrowserstoolStripMenuItem.Checked = !WikiSepBrowserstoolStripMenuItem.Checked; + Properties.Settings.Default.WikiSeperateBrowser = this.WikiSepBrowserstoolStripMenuItem.Checked; + } + + private void LSLEditorForm_Load(object sender, EventArgs e) + { + LoadProperties(); + if (Properties.Settings.Default.CheckForUpdates) + { + updateApplicationForm = new UpdateApplicationForm(); + updateApplicationForm.Icon = this.Icon; + updateApplicationForm.OnUpdateAvailable += new EventHandler(updateApplicationForm_OnUpdateAvailable); + updateApplicationForm.CheckForUpdate(false); + } + } + + void updateApplicationForm_OnUpdateAvailable(object sender, EventArgs e) + { + updateApplicationForm.ShowDialog(this); + } + + private void commentInToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.MultiLineComment(true); + + } + + private void uncommentingSelectedTextToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.MultiLineComment(false); + + } + + private void FindandReplace(bool blnReplaceAlso) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + if (findWindow == null || findWindow.IsDisposed) + { + findWindow = new FindWindow(this); + findWindow.LocationChanged += new EventHandler(findForm_LocationChanged); + } + Rectangle rect = new Rectangle(this.Location, this.Size); + if (rect.Contains(Properties.Settings.Default.FindLocation)) + findWindow.Location = Properties.Settings.Default.FindLocation; + else + findWindow.Location = this.Location; + Point dummy; + findWindow.ReplaceAlso = blnReplaceAlso; + findWindow.KeyWord = editForm.TextBox.GetCurrentKeyWord(false, out dummy); + if (findWindow.Visible == false) + findWindow.Show(this); + findWindow.FindFocus(); + } + + private void replaceToolStripMenuItem_Click(object sender, EventArgs e) + { + FindandReplace(true); + } + + private void findToolStripMenuItem_Click(object sender, EventArgs e) + { + FindandReplace(false); + } + + private void findNextToolStripMenuItem_Click(object sender, EventArgs e) + { + if (findWindow != null && !findWindow.IsDisposed) + findWindow.Find(); + } + + + public void ShowSolutionExplorer(bool blnVisible) + { + this.panel2.Visible = blnVisible; + this.solutionExplorerToolStripMenuItem.Checked = blnVisible; + this.tabControlExtended1.Refresh(); + } + + private void solutionExplorerToolStripMenuItem_Click(object sender, EventArgs e) + { + this.solutionExplorerToolStripMenuItem.Checked = !this.solutionExplorerToolStripMenuItem.Checked; + Properties.Settings.Default.ShowSolutionExplorer = this.solutionExplorerToolStripMenuItem.Checked; + ShowSolutionExplorer(this.solutionExplorerToolStripMenuItem.Checked); + } + + private void newFileToolStripMenuItem_Click(object sender, EventArgs e) + { + NewFile(); + } + + public void SolutionItemsFileMenu(bool blnVisible) + { + this.addToolStripMenuItem.Visible = blnVisible; + this.addToolStripSeparator.Visible = blnVisible; + this.closeSolutiontoolStripMenuItem.Enabled = blnVisible; + this.addNewObjecttoolStripMenuItem.Enabled = blnVisible; + this.addNewFileToolStripMenuItem.Enabled = blnVisible; + this.newProjectToolStripMenuItem.Enabled = !blnVisible; + } + + private void openFileToolStripMenuItem_Click(object sender, EventArgs e) + { + ReadFile(); + } + + private void closeFileToolStripMenuItem_Click(object sender, EventArgs e) + { + CloseActiveWindow(); + } + + private void recentFileToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + ToolStripMenuItem tsmi = e.ClickedItem as ToolStripMenuItem; + if (tsmi == null) + return; + + this.fileToolStripMenuItem.HideDropDown(); + + string strPath = tsmi.Tag.ToString(); + OpenFile(strPath, Guid.NewGuid()); + UpdateRecentFileList(strPath); + } + + private void makeBugReporttoolStripMenuItem_Click(object sender, EventArgs e) + { + BugReport.BugReportForm bugReport = new BugReport.BugReportForm(this); + bugReport.Show(this); + } + + private void toolStripMenuItem4_Click(object sender, EventArgs e) + { + UpdateApplicationForm uaf = new UpdateApplicationForm(); + uaf.Icon = this.Icon; + uaf.CheckForUpdate(true); + uaf.ShowDialog(this); + } + + private void syntaxCheckerToolStripMenuItem_Click(object sender, EventArgs e) + { + SyntaxCheck(false); + } + + #region SolutionExplorer + private void openProjectSolutionToolStripMenuItem_Click(object sender, EventArgs e) + { + if (this.openFileDialog2.ShowDialog(this) == DialogResult.OK) + { + if (File.Exists(this.openFileDialog2.FileName)) + { + if(CloseAllOpenWindows()) + this.SolutionExplorer.OpenSolution(this.openFileDialog2.FileName); + } + } + } + + private void newProjectToolStripMenuItem_Click(object sender, EventArgs e) + { + NewProject np = new NewProject(this); + if (np.ShowDialog(this) == DialogResult.OK) + CloseAllOpenWindows(); + + } + + private void closeSolutiontoolStripMenuItem_Click(object sender, EventArgs e) + { + this.SolutionExplorer.CloseSolution(); + } + + private void newProjectToolStripMenuItem1_Click(object sender, EventArgs e) + { + this.SolutionExplorer.AddNewProjectAction(); + } + + private void existingProjectToolStripMenuItem_Click(object sender, EventArgs e) + { + this.SolutionExplorer.AddExistingProject(); + } + + private void addNewObjecttoolStripMenuItem_Click(object sender, EventArgs e) + { + this.SolutionExplorer.AddNewObject(); + } + + #endregion SolutionExplorer + + private void recentProjectToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + ToolStripMenuItem tsmi = e.ClickedItem as ToolStripMenuItem; + if (tsmi == null) + return; + + this.fileToolStripMenuItem.HideDropDown(); + + if (CloseAllOpenWindows()) + { + string strPath = tsmi.Tag.ToString(); + this.solutionExplorer1.OpenSolution(strPath); + } + } + + private void LSLEditorForm_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) + e.Effect = DragDropEffects.Copy; + else + e.Effect = DragDropEffects.None; + } + + private delegate void DelegateOpenFile(string s); + private void LSLEditorForm_DragDrop(object sender, DragEventArgs e) + { + try + { + DelegateOpenFile delegateOpenFile = new DelegateOpenFile(OpenFile); + Array allFiles = (Array)e.Data.GetData(DataFormats.FileDrop); + if (allFiles == null) + return; + + for (int intI = 0; intI < allFiles.Length; intI++) + { + string strFileName = allFiles.GetValue(intI).ToString(); + this.BeginInvoke(delegateOpenFile, new object[] { strFileName }); + } + + this.Activate(); // in the case Explorer overlaps this form + } + catch + { + // Error in DragDrop function (dont show messagebox, explorer is waiting + } + } + + private void optionsToolStripMenuItem_Click(object sender, EventArgs e) + { + Tools.ToolsOptions to = new Tools.ToolsOptions(); + to.PropertiesChanged += new LSLEditor.Tools.ToolsOptions.PropertiesChangedHandler(to_PropertiesChanged); + to.Icon = this.Icon; + to.ShowDialog(this); + } + + private void to_PropertiesChanged() + { + this.browserInWindowToolStripMenuItem.Checked = Properties.Settings.Default.BrowserInWindow; + this.WikiSepBrowserstoolStripMenuItem.Checked = Properties.Settings.Default.WikiSeperateBrowser; + this.tabbedViewToolStripMenuItem.Checked = Properties.Settings.Default.TabbedDocument; + + SwitchDocumentView(); + SetFontsOnWindows(); + InitPluginsList(); + } + + private void toolStripMenuItem5_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + browser.ShowWebBrowser("Donate", Properties.Settings.Default.DonateUrl); + } + + private void LSLint() + { + InitSyntaxError(); + + Plugins.LSLint lslint = new Plugins.LSLint(); + + if (lslint.SyntaxCheck(this)) + { + if (lslint.HasErrors) + { + this.panel1.Controls.Clear(); + this.panel1.Controls.Add(this.SyntaxErrors); + this.panel1.Visible = true; + this.splitter1.SplitPosition = Properties.Settings.Default.SimulatorSize.Height; + } + else + { + MessageBox.Show("LSL Syntax seems OK", "LSLint Syntax Checker", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + else + { + MessageBox.Show("LSLint:" + lslint.ExceptionMessage, "LSLint plugin", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void Particles() + { + Plugins.Particles particles = new Plugins.Particles(this); + } + + private void SvnPlugin() + { + if (File.Exists(Svn.Executable)) + { + Properties.Settings.Default.VersionControl = true; + Properties.Settings.Default.VersionControlSVN = true; + Properties.Settings.Default.SvnExe = Svn.Executable; + MessageBox.Show("SVN is installed and can be used in the solution explorer", "SVN information", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + Properties.Settings.Default.VersionControl = false; + Properties.Settings.Default.VersionControlSVN = false; + MessageBox.Show("SVN is NOT installed (can not find svn binary)", "SVN information", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void GenericPlugin(string strPluginName) + { + Plugins.Generic generic = new Plugins.Generic(this, strPluginName); + } + + + private void PluginsHandler(object sender, EventArgs e) + { + this.panel1.Visible = false; + + ToolStripMenuItem tsmi = sender as ToolStripMenuItem; + if (tsmi == null) + return; + + switch (tsmi.Text.ToLower()) + { + case "lslint": + LSLint(); + break; + case "particles": + Particles(); + break; + case "svn (version control)": + SvnPlugin(); + break; + default: + GenericPlugin(tsmi.Text); + //MessageBox.Show("Unknown plugin", "LSLEditor plugins warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + break; + } + } + + private void SaveAllToolStripMenuItem_Click(object sender, EventArgs e) + { + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + if (editForm.Dirty) + editForm.SaveCurrentFile(); + } + // save it all, also solution explorer file + if (this.SolutionExplorer != null & !this.SolutionExplorer.IsDisposed) + this.SolutionExplorer.SaveSolutionFile(); + } + + private void SetupFileMenu() + { + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm != null) + { + this.saveToolStripMenuItem.Text = "Save " + editForm.ScriptName; + this.saveFileDialog1.FileName = editForm.ScriptName; + this.saveToolStripMenuItem.Enabled = editForm.Dirty; + this.closeFileToolStripMenuItem.Enabled = true; + } + else + { + this.closeFileToolStripMenuItem.Enabled = false; + } + } + + private void tabControlExtended1_SelectedIndexChanged(object sender, EventArgs e) + { + SetupFileMenu(); + EditForm ef = this.ActiveMdiForm as EditForm; + if (ef != null) + ef.SetFocus(); + } + + private void LSLEditorForm_MdiChildActivate(object sender, EventArgs e) + { + SetupFileMenu(); + } + + private void fileToolStripMenuItem_Click(object sender, EventArgs e) + { + SetupFileMenu(); + } + + private void forumStripMenuItem_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + browser.ShowWebBrowser("LSLEditor Forum", Properties.Settings.Default.ForumLSLEditor); + } + + private void notecardToolStripMenuItem_Click(object sender, EventArgs e) + { + NewNotecard(); + } + + private void toolStripMenuItem7_Click(object sender, EventArgs e) + { + Browser browser = GetBrowser(); + browser.ShowWebBrowser("Contact Form", Properties.Settings.Default.ContactUrl); + } + + private void toolStripMenuItem8_Click(object sender, EventArgs e) + { + //NativeHelper.SendMyKeys.PasteTextToApp("hello", "SecondLife", null); + EditForm editForm = this.ActiveMdiForm as EditForm; + if (editForm == null) + return; + editForm.TextBox.ToClipBoard(); + NativeHelper.SendMyKeys.ClipBoardToApp("SecondLife", null); + } + + + + } +} \ No newline at end of file diff --git a/LSLEditorForm.resx b/LSLEditorForm.resx new file mode 100644 index 0000000..548795f --- /dev/null +++ b/LSLEditorForm.resx @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 271, 17 + + + 401, 17 + + + 671, 17 + + + 126, 17 + + + 529, 17 + + + 17, 54 + + + 53 + + + + + AAABAAcAEBAQAAAAAAAoAQAAdgAAABAQAAAAAAAAaAUAAJ4BAAAYGAAAAAAAAMgGAAAGBwAAICAQAAAA + AADoAgAAzg0AACAgAAAAAAAAqAgAALYQAAAwMBAAAAAAAGgGAABeGQAAMDAAAAAAAACoDgAAxh8AACgA + AAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAgAAAAACAAACA + gACAAIAAgICAAMDAwAAA/wAA/wAAAP//AAAAAP8AAP//AAAAAAD///8AERERERERERERERERERERERER + ERERERERERERERERERERAAAAAAABEXF//////wEREX+IiIiPgBF3F/f////wEREX+I//+PARdxf/d3d3 + +AEREX//////AXdxeqqqq7wBEREXd3d3d3ERERERERERERERERERERERERERERERERH//wAA//8AAP// + AAD//xERwAd4iEAHiIjAA4iIIAMREeADd/8gAf//8AH//xABERH4ARf//////////////xERKAAAABAA + AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAALJOHQDfjScAeEQoAN+QLgCGUzkAtHU7ANSU + SQDnoEkA6KNOALF8WQBmZmYAtIprAICJiQC+oYwAlJSQAIuWlwCPlpcAmZydAKOlpAC2r6UAlKKsALay + rAC7tq4AuLaxAM3FugDJzMwAz9DNANDQ0ADO09MAy93hANbh5ADW5OgA1+frAOLp6wDn7O0A2OrvANnq + 7wDo8vUA6/T3APP29wAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoKCgoKCgoKCgoKCgoKCgoKCgoKCgo + KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgKCgoKCgoKCgoKKCgoKCgAAAAAAAAAAAAAAAooKBco + CSMjIyMjIyMjIwAKKCgoKAkgHBkZGRkZGSUNAgooFhEoCR0QKSkpKSchJAUKKCgoKAkjFBspKSkpHiYL + CigTDigJHyMMDAwMDA8iGgUKKCgoKAkjIyMjIyMjIyMFChgVEigJAwEBAQEBCAcGBQQoKCgoKAAAAAAA + AAAAAAAoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo//94iv// + AAD//zMV4AdrbsADAqNAA6OjwAFvkyABAADgAQAAIABnfvAApaQQAKSk+AGYjv//NgD//zEG//9RlCgA + AAAYAAAAMAAAAAEACAAAAAAAoAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwb+/APr5+QDQy8oA0szKAKGQ + iQCikIgA18jBAHdEKgB3Ri4AjlY5AKp0WQB1UkAAoXFZAHRSQQBxU0QAhmdYAK+MegCykYEAopKKALqy + rgDPy8kAe0gtAJFZOwCxeVkAtH5fAJ1uVQCeb1YAdFNBAIZmVQCGZ1YAu5mGALycigC6m4oAwKaXAJOA + dQCmlIoA3dLMALyzrgDAubUAp25MALJ6WQDBl30Awpl/ALOPegC7nIoAupuJAMCnmADCqZoAqJeNANzS + zADCurUArFITAL9oLgCUhHkArJuPAMrGwwChVxsAwp+DAMG3rwDEu7QA3GkAANaofgDTwK8AwLGkAMa4 + qwDebwAA3W8AANxtAADGuKoA0snAANDIwADpiiUA95w3AO+YPADgtogA37WIAN61iADftokA37eKANXL + wADXzcEA0ci8AOWsWwDotGUA6LVlAOu5aADpuGwA67tvAOq7cQDluHMA3bV2ALa2tQChpaQA2NzbANfb + 2gDg//8AkpubAJOZmQCgpaUAnaKiAKGvsACvuLkA3u7wANzs7gDd5eYA3vr/AOL7/wCdqqwAtbu8ALDA + wwDg6uwA2+XnAO7z9ADd8fYAv9HVAMLT1wC/0NQA2uzwANPk6ADk8PMA5e7wANzk5gDP09QA7fHyAN32 + /QDP4ucAz+HmANvt8gDa7PEA2OrvAN/q7QDl8PMA3ff/AN73/wDd9v4A3PX9ANrw9wDc8PYAwNHWANvs + 8QDa6/AA4/P4AODq7QDl7/IA5O7xAN31/QDg9/8A3PL6ANjq8ADb7PIA4fH3AN7m6QDY4OMA2/P9ANry + /ADb8/4A2vL9ANfv+gDa8/8A7vL0AO3x8wD4+PkA////AP39/QDp6ekAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4eHh4eHh4eHh4eHh0Q + NgAAAAAAAAAAAAsgIS4uLi4uLi4uLi0fCg8AAAAAAEAFEj9gfZKSkpKSkpKSkpJqaRc2AAAAAEcEByuI + goCMdoGBgYGBgYGNhTAMAAAAAAAAAClolXCRkI+Pj4+Pj4N5l14WAAAAAEATBRFRiWVte6ChoaGhoXx6 + eIoaIwAAAEYzFSUqa25dAQKjo6Ojo6Nxb5MiDgAAAAAAAAAZZ35hXKWkpKSkpKSimI5fCDYAAEExBgUR + UZRsYmNjY2NjY2NkZoRyGyMAAFA8JwMyKoZ/i3Nzc3Nzc3N1dHeHLxw2AAAAAAAAGJafnJycnJycnJyb + nZ6amQk2AEU3JAUFLFNWVVRUVFRUVFVZV1hbWjk2AFI7JhQ4ADU9REJDQ0NDQ0NKSEkNKDQ2AAAAAAAA + AAA6Pk9NTU1NTU1MTE5LS0sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA////Kv///w7///8o////KP///yjwAB8o8AAPToAAB12AAAdD8AAHIIAA + Az2AAAM9+AABPYAAAT2AAABV/AAAXYAAAF2CAABd/wABVf///1X///9V////Vf///1X///9dKAAAACAA + AABAAAAAAQAEAAAAAACAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAICAAAAAAIAAAICAAIAA + gACAgIAAwMDAAAD/AAD/AAAA//8AAAAA/wAA//8AAAAAAP///wARERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAAAAAAAAAAAAAER + EREREXiIiIiIiIiIiIiAERERABF3////////////8BEREX9xF/////////////cBEREXcReP//////// + ///4AREREREXf/iIiIiIiIiP/wEREQABEX/4f4//////j/9wERF/9xF4+H+I//////j/gBERF3cRd/iH + 9//////4//ARERERERf/h/f/////+P/3ARFwAAEXj4d3d3d3d3eP+AERf//3F3+IiIiIiIiIiP8wERd3 + dxF/////////////cBEREREReP///////////4ARcAAAEXi7u7u7u7u7u7uyAX///3EXqqqqqqqqq6us + ygEXd3dxF6qqqqqqqqqqqqoBERERERF3d3d3d3d3d3d3ERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + EREREREREREREf//////////////////////////////////////////8AAAf/AAAD8wAAA/GAAAH5gA + AB/4AAAfHAAADwwAAA+MAAAP/gAABwYAAAcCAAADgwAAA/8AAAMDAAABAYAAAYGAAAH/wAAD//////// + ////////////////////////KAAAACAAAABAAAAAAQAIAAAAAACABAAAAAAAAAAAAAAAAAAAAAAAAJ44 + AACmQAAAsUsAANNtAADZcgAAmDcGAH4wCQB/MQoAlDoMAHAvDwCDNg8AcDEQAJ5CEwDBZRMAoEQVANN0 + FQCWQRYAl0IXAI9CHAChTCEAznQiANF4JgDzoScAXzsoAGpBKwCdUy4AnlMuAJ5VLwCiWDMAplw3AN+N + OwCjXjwArG5PALF0VQBeXl4As3tfALCIYwBmZmYAhHNoAG5ycgBwd3cAc3h3AHV5eAB2enkAeXt6AHl8 + egB6fHoAe317AH1+ewB+f3wAvJiEALmghgCKiooAkJCMAI6RkAD/zJkApaShAKWloQCmpaEAxLKlAKqq + qgChsLEAysG5AMC+uwDCwLwAury9AMXFwgDGxsMAvsLEANnQxQDNy8cA087JANbQyQDP0M0A4NfNAOnc + 0ADs4NEAv9DUANLa2wDO4OQA0uToAOjo6ADg6OoA6urqANnp7QDY6u8A2ervANvr8ADv8/QA6fP2APj4 + +AD7+/sA/f39AAAAAAA0b/8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABdXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dJSUlJSUlJSUl + JSUlJSUlJSUlJSUlXV1dXV1dXV1dXR8SCgcGBgYGBgYGBgYGBgYGBgYGByUmXV1dXV1dXV1dCDtGRkZG + RkZGRkZGRkZGRkZGRkY+BSVdXV1dXUI2XV0gM1VVVVVVVVVVVVVVVVVVVVVVVVUTJV1dXV1dQEA/XV0M + VVVVVVVVVVVVVVVVVVVVVVVVVTILJV1dXV1dXV1dXQ5JVV9fX19fX19fX19fX19fX19VTgUlXV1dXV1d + XV1dICRVVE1NTU1NTU1NTU1NTU1NX1ZVEyVdXV1dNS4qXV1dDFVVPShfPFFfX19fX19fX01YX1UyCyVd + XV1FRT8/XV0OSVU9KF84PF9fX19fX19fUk1fVU4FJV1dXV1dXV1dXSAkVU89KFsiU1pfX19fX19cTV9X + VRMlXV1dXV1dXV1dXQxVVT0oXzRTU19fX19fX19NX1lVMgslXV05MC0qJ11dDklVPSgoKCgoKCgoKCgo + KChNX1VOBSVdXUtLSENEP10gJFVQPT09PT09PT09PT09PT1NVVUTFyVdXV1dXV1dXV0MVVVVVVVVVVVV + VVVVVVVVVVVVVTIJJV1dXV1dXV1dXQ5JVVVVVVVVVVVVVVVVVVVVVVVVTgUlXToxLywrKV1dIw0WFhYW + FhYWFhYWFhYWFhYWFhYWARglTExKR0NBP11dAAQEBAQEBAQEBAQEBAQ3DzcPXg8DASVdXV1dXV1dXV0d + AhQVHh4eHh4eHh4eHh4eHh4eHgMFXV1dXV1dXV1dXV0hHBsaGRkZGRkZGRkZGRkZGRkQEV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1d + XV1dXV1d//////////////////////////////////////gAAD/wAAAf8AAAHzAAAB8YAAAP+AAAD/gA + AA8cAAAHDAAAB/wAAAf+AAADBgAAAwIAAAH/AAAB/wAAAQMAAAABgAAA/4AAAf/AAAP///////////// + //////////////////8oAAAAMAAAAGAAAAABAAQAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AACAAAAAgIAAAAAAgAAAgIAAgACAAICAgADAwMAAAP8AAP8AAAD//wAAAAD/AAD//wAAAAAA////ABER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAAAAAAAAAAAAA + AAAAAAABERERERERERd3d3d3d3d3d3d3d3d3d3cgERERERERERd///////////////////ggERERERAB + ERc///////////////////8wEREREX/wERF4//////////////////9yARERERd3ERF3//////////// + //////+CARERERERERFz///////////////////zAREREREREREXj//////////////////3IBERERER + EREXf/iIiIiIiIiIiIiIj//4IBERERAAAREXP/+If/h/////////j///MBEREX//8BEReP+IeP9///// + ////iP//cgERERd3dxERd//4d/94////////+P//ggERERERERERc//4h4+H////////+P//8wERERER + ERERF4/4h3/3////////+I//9yARERERERERF3//h3j4f///////+I//+CARERAAAAERFz//iHd3d3d3 + d3d3d4j//zAREX////AREXj/iIiIiIiIiIiIiIj//3IBERd3d3cREXf//////////////////4IBERER + EREREXP///////////////////MBEREREREREReP//////////////////cgERERERERERd///////// + //////////ggERAAAAABERd6qqqqqqqqqqqqqqqqqqowEX/////wERF6qqqqqqqqqqqqq7q7rMMyARd3 + d3d3ERF6qqqqqqqqqqqqqrqrp8cyAREREREREREXu7u7u7u7u7u7u7u7u7uyARERERERERERd3d3d3d3 + d3d3d3d3d3d3ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERER + EREREREREREREf///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// + /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP4AAAAB/wAA/gAAAAD/ + AAD+AAAAAP8AAJ4AAAAA/wAADwAAAAB/AACPAAAAAH8AAP8AAAAAfwAA/4AAAAA/AAD/gAAAAD8AAIeA + AAAAPwAAA8AAAAAfAACDwAAAAB8AAP/AAAAAHwAA/+AAAAAPAAD/4AAAAA8AAIHgAAAADwAAAPAAAAAH + AACA8AAAAAcAAP/wAAAABwAA//gAAAADAAD/+AAAAAMAAIB4AAAAAwAAADwAAAABAACAPAAAAAEAAP/+ + AAAAAQAA//8AAAADAAD///////8AAP///////wAA////////AAD///////8AAP///////wAA//////// + AAD///////8AAP///////wAA////////AAD///////8AACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAA + AAAAAAAAAAAAAAAAAACQMAAAmTMAAKE7AACtRwAAu1UAAMNdAADMZgAA020AAN13AAD2kAAAoz0BAIYv + BACbNwQAzGkGAKNEDQBwMRAAnkITAHQ1FAAVFRUAaTIVAKBEFQDTdBUA4oMVAJhDGACgSh4Ao0sfAKFM + IQCaSyMAp08jAJ1NJQClUCUAXzsoAFw9LABhQS8AvHYxANB9MQDeijcAODg4AG5LOADaiTkAvHM9AOGQ + PwB5U0AA3I5AAKxqSQBNTU0AnWhNALN/YwBmZmYAtYRqAO+sagD1s2oAcXFxAHB3dwC4jncAdXp6APa7 + fwD6v38Ae4SEALyYhAB7aoYAh5KSAJOcnACXpaUAmaioAJqmqQCqqqoAra2rAJ+srACvr6wAq66uALSy + rgC3tbAAvLixAL24sQDBu7MAw720AMrCtwDLwrcApra4ANXJuwDXyrwArLy9ANnLvQDczr4A4NDAAOTT + wQDq18QA69jEAPLcxwD13sgAtMXJAM/QzQDGzc4AuszRALvN0gC/0NQAwtPWAMbV2QDJ19sA0trbANvb + 2wDJ2t4Ay9zgANfc4ADa3eEA3uHjAPjw4wDf4uQA2OLlAPjy5QDk5uYA3uLnAOXm5wDS5OgA3OXoAOzr + 6ADr6+kA7uzpAPn06QDq6uoA8u/rAPr16wDW6OwA9vLsAOPr7QD59O0A2OrvANnq7wDo7u8A2+vwAOvt + 8ADt7/AA3ezxAODu8gDv8fIA7vDzAPLz8wD19PMA5fH0APf29AD69/UA6fP2APz69gDt9fcA9/f3APX3 + +ADy+PkA+fz8AAAAAAA0b/8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZUwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMJWVlZWVlZWVlZWVlZWV + lQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQERMJWVlZWVlZWVlZWVlZWVlQEvNjY2NjY2NjY2 + NjY2NjY2NjY2NjY2NjY2NjY2NiwBITCVlZWVlZWVlZWVlZWVlQExf39/f39/f39/f39/f39/f39/f39/ + f39/f39/f2QBEzCVlZWVlZWVlTAwlZWVlRcQf39/f39/f39/f39/f39/f39/f39/f39/f39/f38aGDCV + lZWVlZWVa1RJMJWVlZUBXH9/f39/f39/f39/f39/f39/f39/f39/f39/f387ASAwlZWVlZWVlXZscJWV + lZUAMX9/f39/f39/f39/f39/f39/f39/f39/f39/f39kAQ8wlZWVlZWVlZWVlZWVlZUXEH9/f39/f39/ + f39/f39/f39/f39/f39/f39/f39/GgswlZWVlZWVlZWVlZWVlZWVAVx/f5eXl5eXl5eXl5eXl5eXl5eX + l5eXl5eXhX9/OwEfMJWVlZWVlZWVlZWVlZWVADF/f3I/T15eXl5eXl5eXl5eXl5eXl5eXl+XkH9/ZAEP + MJWVlZWVlTAwMDCVlZWVFxB/f38/QDVzc3Nzc3Nzc3Nzc3Nzc3NzbV6Bl39/fxoLMJWVlZWVblhRTEcw + lZWVlQFcf39hPzVGl5cSl5eXl5eXl5eXl5eXl2Bjl4Z/fzsBHzCVlZWVlXx0b2lwlZWVlQAxf397Pz41 + eJclZZeXl5eXl5eXl5eXl21el5N/f2QBDzCVlZWVlZWVlZWVlZWVlRcQf39/Uj81RpdCNJeXl5eXl5eX + l5eXl5JefZeAf38aGTCVlZWVlZWVlZWVlZWVlZUBXH9/Zj81N5eRLZeXl5eXl5eXl5eXl5dgYpeLf387 + AR8wlZWVlZWVlZWVlZWVlZUBMX9/fz89NUaXQkKXl5eXl5eXl5eXl5dBXpeUf39kAQ8wlZWVlTAwMDAw + MJWVlZUdEH9/f1I/NTU1NTU1NTU1NTU1NTU1NTU6W12Xgn9/GhkwlZWVd1lWU05KRTCVlZWVAVx/f2c/ + Pz8/Pz8/Pz8/Pz8/Pz8/Pz8/P0SXjn9/OwEfMJWVlX55dXFqaHCVlZWVATF/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/ZAEPMJWVlZWVlZWVlZWVlZWVHRB/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + fxoZMJWVlZWVlZWVlZWVlZWVlQFcf39/f39/f39/f39/f39/f39/f39/f39/f39/fzsBHzCVlZWVlZWV + lZWVlZWVlQExf39/f39/f39/f39/f39/f39/f39/f39/f39/f2QBDzCVlTAwMDAwMDAwlZWVlR0CCQkJ + CQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkDHjCVelpXVVBNS0hDMJWVlZUBBwgICAgICAgICAgICAgI + CAgICAg5OQgzORaWliIEASYwlY+NjIqJh4SDiJWVlZUUDg0GBgYGBgYGBgYGBgYGBgYGBgYyOBUpOCku + ljwFASowlZWVlZWVlZWVlZWVlZWVAQojKyQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCcoATCVlZWVlZWV + lZWVlZWVlZWVlRwBAQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBG5WVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV + lZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWV////////AAD///////8AAP// + /////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA//////// + AAD///////8AAP8AAAAA/wAA/gAAAAD/AAD+AAAAAH8AAP4AAAAAfwAAngAAAAB/AAAPAAAAAD8AAI8A + AAAAPwAA/wAAAAA/AAD/gAAAAB8AAP+AAAAAHwAAh4AAAAAfAAADwAAAAA8AAIPAAAAADwAA/8AAAAAP + AAD/4AAAAAcAAP/gAAAABwAAgeAAAAAHAAAA8AAAAAMAAIDwAAAAAwAA//AAAAADAAD/+AAAAAEAAP/4 + AAAAAQAAgHgAAAABAAAAPAAAAAAAAIA8AAAAAAAA//4AAAABAAD//wAAAAMAAP///////wAA//////// + AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP// + /////wAA + + + \ No newline at end of file diff --git a/MakeZipFile.cmd b/MakeZipFile.cmd new file mode 100644 index 0000000..f7a1082 --- /dev/null +++ b/MakeZipFile.cmd @@ -0,0 +1,13 @@ +cd "C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\bin\Debug" + +copy LsLEditor.exe LsLEditor-beta.exe + +del d:\temp\LsLEditor-beta.zip +del d:\temp\LsLEditor-beta.exe.bz2 +del d:\temp\LsLEditor-beta.exe.gz + +"c:\Program Files\7-Zip\7z" a -tzip d:\temp\LsLEditor-beta.zip LsLEditor-beta.exe +"c:\Program Files\7-Zip\7z" a -tbzip2 d:\temp\LsLEditor-beta.exe.bz2 LsLEditor-beta.exe +"c:\Program Files\7-Zip\7z" a -tgzip d:\temp\LsLEditor-beta.exe.gz LsLEditor-beta.exe + +pause diff --git a/PermissionsForm.Designer.cs b/PermissionsForm.Designer.cs new file mode 100644 index 0000000..47b056a --- /dev/null +++ b/PermissionsForm.Designer.cs @@ -0,0 +1,136 @@ +namespace LSLEditor +{ + partial class PermissionsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // button1 + // + this.button1.BackColor = System.Drawing.Color.SlateBlue; + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Location = new System.Drawing.Point(48, 248); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(80, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Yes"; + this.button1.UseVisualStyleBackColor = false; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 8); + this.label1.MaximumSize = new System.Drawing.Size(260, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 13; + this.label1.Text = "label1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 88); + this.label2.MaximumSize = new System.Drawing.Size(260, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 14; + this.label2.Text = "label2"; + // + // button2 + // + this.button2.BackColor = System.Drawing.Color.SlateBlue; + this.button2.ForeColor = System.Drawing.Color.White; + this.button2.Location = new System.Drawing.Point(144, 248); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(80, 23); + this.button2.TabIndex = 15; + this.button2.Text = "No"; + this.button2.UseVisualStyleBackColor = false; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(16, 224); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(58, 13); + this.label3.TabIndex = 16; + this.label3.Text = "Is this OK?"; + // + // panel1 + // + this.panel1.AutoScroll = true; + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.label2); + this.panel1.Location = new System.Drawing.Point(16, 8); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(264, 200); + this.panel1.TabIndex = 17; + // + // PermissionsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.CornflowerBlue; + this.ClientSize = new System.Drawing.Size(290, 300); + this.Controls.Add(this.panel1); + this.Controls.Add(this.label3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "PermissionsForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "llDialogForm"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Panel panel1; + } +} \ No newline at end of file diff --git a/PermissionsForm.cs b/PermissionsForm.cs new file mode 100644 index 0000000..d6f69d2 --- /dev/null +++ b/PermissionsForm.cs @@ -0,0 +1,112 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class PermissionsForm : Form + { + private SecondLifeHost host; + private SecondLife.String ObjectName; + private SecondLife.String OwnerName; + private SecondLife.key id; + private SecondLife.key agent; + private SecondLife.integer intPermissions; + + public PermissionsForm(SecondLifeHost host, string strObjectName, SecondLife.key id, string strOwner, SecondLife.key agent, int intPermissions) + { + InitializeComponent(); + + this.host = host; + this.OwnerName = strOwner; + this.ObjectName = strObjectName; + this.agent = agent; + this.id = id; + this.intPermissions = intPermissions; + + StringBuilder sb = new StringBuilder(); + + if ((intPermissions & SecondLife.PERMISSION_DEBIT) == SecondLife.PERMISSION_DEBIT) + sb.AppendLine("Take Linden dollars (L$) from you"); + + if ((intPermissions & SecondLife.PERMISSION_TAKE_CONTROLS) == SecondLife.PERMISSION_TAKE_CONTROLS) + sb.AppendLine("Act on your control inputs"); + + if ((intPermissions & SecondLife.PERMISSION_TRIGGER_ANIMATION) == SecondLife.PERMISSION_TRIGGER_ANIMATION) + sb.AppendLine("Animate your avatar"); + + if ((intPermissions & SecondLife.PERMISSION_ATTACH) == SecondLife.PERMISSION_ATTACH) + sb.AppendLine("Attach to your avatar"); + + if ((intPermissions & SecondLife.PERMISSION_CHANGE_LINKS) == SecondLife.PERMISSION_CHANGE_LINKS) + sb.AppendLine("Link and delink from other objects"); + + if ((intPermissions & SecondLife.PERMISSION_TRACK_CAMERA) == SecondLife.PERMISSION_TRACK_CAMERA) + sb.AppendLine("Track your camera"); + + if ((intPermissions & SecondLife.PERMISSION_CONTROL_CAMERA) == SecondLife.PERMISSION_CONTROL_CAMERA) + sb.AppendLine("Control your camera"); + + this.label1.Text = "'"+strObjectName+"', an object owned by '"+strOwner + "',\nwould like to:"; + this.label2.Text = sb.ToString(); + } + + private void button2_Click(object sender, EventArgs e) + { + this.host.SetPermissions(new SecondLife.integer(0)); + this.Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + this.host.SetPermissions(this.intPermissions); + this.Close(); + } + } +} \ No newline at end of file diff --git a/PermissionsForm.resx b/PermissionsForm.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/PermissionsForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Plugins/Generic.cs b/Plugins/Generic.cs new file mode 100644 index 0000000..2ec58b2 --- /dev/null +++ b/Plugins/Generic.cs @@ -0,0 +1,109 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Windows.Forms; +using System.Reflection; + +namespace LSLEditor.Plugins +{ + class Generic + { + private delegate void RunDelegate(string strFilePath, RichTextBox tb); + + public Generic(LSLEditorForm parent, string strPluginName) + { + EditForm editForm = parent.ActiveMdiForm as EditForm; + if (editForm == null) + return; + + string strFilePath = editForm.FullPathName; + RichTextBox tb = editForm.TextBox as RichTextBox; + + string strDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string strPluginsDirectory = Path.Combine(strDirectory, "Plugins"); + string strProgram = Path.Combine(strPluginsDirectory, strPluginName + ".exe"); + + Assembly assembly = null; + + try + { + assembly = Assembly.LoadFrom(strProgram); + } + catch + { + MessageBox.Show("Not a valid plugin, see http://www.lsleditor.org/help/Plugins.aspx", "Plugins", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + if (assembly == null) + return; + + object[] args = new object[] { strFilePath, tb }; + + foreach (Type t in assembly.GetTypes()) + { + if (t.BaseType.Name == "Form") + { + Form form = assembly.CreateInstance(t.FullName, false, + BindingFlags.Public|BindingFlags.Instance|BindingFlags.CreateInstance, + null,args,null,null) as Form; + if (form != null) + { + parent.AddForm(form); + return; + } + } + MethodInfo info = t.GetMethod("Run", + BindingFlags.Public | + BindingFlags.NonPublic | + BindingFlags.Static); + + if (info == null) + continue; + + info.Invoke(null, args); + } + } + } +} diff --git a/Plugins/LSLint.cs b/Plugins/LSLint.cs new file mode 100644 index 0000000..ae5ce38 --- /dev/null +++ b/Plugins/LSLint.cs @@ -0,0 +1,189 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Reflection; +using System.Diagnostics; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Text; +/* +

+ - Added: Plugin support
+ At this moment only lslint.exe is supported! (get the windows version from http://w-hat.com/lslint/)
+ Create a subdirectory 'plugins' in the directory where LSLEditor.exe resides
+ Copy lslint.exe into this plugins directory
+ Menu Tools - Options - Environment - Plugins - Check lslint checkbox
+ When hitting the OK button, Menu - Tools - lslint should appear
+

+ + */ +namespace LSLEditor.Plugins +{ + class LSLint + { + public string ExceptionMessage; + public bool HasErrors; + + public LSLint() + { + ExceptionMessage = ""; + } + private string Execute(string strSourceCode) + { + string strAll = ""; + try + { + string strPluginName = "lslint"; + string strArguments = ""; + Process process = new Process(); + + string strDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string strPluginsDirectory = Path.Combine(strDirectory, "Plugins"); + string strProgram = Path.Combine(strPluginsDirectory, strPluginName + ".exe"); + + process.StartInfo.UseShellExecute = false; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.RedirectStandardInput = true; + process.StartInfo.CreateNoWindow = true; + process.StartInfo.FileName = strProgram; + process.StartInfo.Arguments = strArguments; + process.Start(); + process.StandardInput.Write(strSourceCode); + process.StandardInput.Close(); + strAll = process.StandardError.ReadToEnd(); + process.WaitForExit(); + } + catch(Exception exception) + { + this.ExceptionMessage += exception.Message + "\r\n"; + } + return strAll; + } + + private void RunOnce(ListView listView, EditForm editForm) + { + // ProjectName, ScriptName, + string strErrors = Execute(editForm.SourceCode); + StringReader sr = new StringReader(strErrors); + int intNr = 1; + while (true) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + strLine = strLine.Trim(); + + if (strLine.StartsWith("TOTAL")) + continue; + + string strLineNr = ""; + string strColumnNr = ""; + string strErrorNr = ""; + + int intImageIndex = -1; + if (strLine.StartsWith("WARN")) + intImageIndex = 1; + + if (strLine.StartsWith("ERR")) + intImageIndex = 0; + + int intI = strLine.IndexOf("::"); + if (intI > 0) + { + strLine = strLine.Substring(intI + 2).Trim(); + intI = strLine.IndexOf(":"); + if (intI > 0) + { + string strLineColumn = strLine.Substring(0, intI).Replace("(", "").Replace(")", "").Replace(" ", ""); + string[] LineColumn = strLineColumn.Split(new char[] { ',' }); + if (LineColumn.Length > 1) + { + int intLine = 0; + int intColumn = 0; + + int.TryParse(LineColumn[0], out intLine); + int.TryParse(LineColumn[1], out intColumn); + + strLineNr = intLine.ToString(); + strColumnNr = intColumn.ToString(); + strErrorNr = intNr.ToString(); + } + strLine = strLine.Substring(intI + 1).Trim(); + } + } + + ListViewItem lvi = new ListViewItem(new string[] { + "", // 0 + strErrorNr, // 1 + strLine, // 2 + editForm.ScriptName, // 3 + strLineNr, // 4 + strColumnNr, // 5 + editForm.ProjectName , // 6 + editForm.FullPathName, // 7 + editForm.guid.ToString(), // 8 + editForm.IsScript.ToString()// 9 + } , intImageIndex); + listView.Items.Add(lvi); + if(strErrorNr!="") + intNr++; + } + } + + public bool SyntaxCheck(LSLEditorForm parent) + { + foreach (Form form in parent.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + RunOnce(parent.SyntaxErrors.ListView, editForm); + } + this.HasErrors = (parent.SyntaxErrors.ListView.Items.Count != 0); + return (ExceptionMessage == ""); + } + } +} diff --git a/Plugins/Particles.cs b/Plugins/Particles.cs new file mode 100644 index 0000000..061dff3 --- /dev/null +++ b/Plugins/Particles.cs @@ -0,0 +1,74 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Windows.Forms; +using System.Reflection; + +namespace LSLEditor.Plugins +{ + class Particles + { + public Particles(LSLEditorForm parent) + { + if (parent.IsMdiContainer) + { + string strPluginName = "Particles"; + //string strArguments = ""; + + string strDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string strPluginsDirectory = Path.Combine(strDirectory, "Plugins"); + string strProgram = Path.Combine(strPluginsDirectory, strPluginName + ".exe"); + + Assembly assembly = Assembly.LoadFrom(strProgram); + Form frmMain = assembly.CreateInstance("Particles.frmMain") as Form; + parent.AddForm(frmMain); + } + else + { + MessageBox.Show("This plugin does not run in tabbed mode", "Particles plugin", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/Plugins/Svn.cs b/Plugins/Svn.cs new file mode 100644 index 0000000..0c5cfe6 --- /dev/null +++ b/Plugins/Svn.cs @@ -0,0 +1,148 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.Text; + +using System.Windows.Forms; + +using Microsoft.Win32; + +using System.IO; +using System.Diagnostics; + +namespace LSLEditor +{ + class Svn + { + public string Output; + public string Error; + + // HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\svn.exe + // HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\svn.exe + public static string Executable + { + get + { + try + { + string strKey = @"Software\Microsoft\Windows\CurrentVersion\App Paths\svn.exe"; + RegistryKey key = Registry.CurrentUser.OpenSubKey(strKey, false); + if (key == null) + return null; + string strExe = key.GetValue("").ToString(); + key.Close(); + return strExe; + } + catch + { + return null; + } + } + } + + public static bool IsInstalled + { + get + { + return (Svn.Executable != null); + } + } + + public bool Execute(string Arguments, bool ShowOutput, bool ShowError) + { + this.Error = ""; + this.Output = ""; + + Process p = new Process(); + StreamWriter sw; + StreamReader sr; + StreamReader err; + + p.StartInfo.FileName = Properties.Settings.Default.SvnExe; + p.StartInfo.Arguments = Arguments; + p.StartInfo.RedirectStandardError = true; + p.StartInfo.RedirectStandardInput = true; + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.UseShellExecute = false; + p.StartInfo.CreateNoWindow = true; + + p.Start(); + + sw = p.StandardInput; + sr = p.StandardOutput; + err = p.StandardError; + + sw.AutoFlush = true; + + StringBuilder sb = new StringBuilder(); + + while (sr.Peek() >= 0) + { + char[] buffer = new char[1024]; + sr.Read(buffer, 0, buffer.Length); + sb.Append(new string(buffer)); + } + sw.Close(); + this.Output = sb.ToString(); + + sb = new StringBuilder(); + while (err.Peek() >= 0) + { + char[] buffer = new char[4096]; + err.Read(buffer, 0, buffer.Length); + sb.Append(new string(buffer)); + } + this.Error = sb.ToString(); + + if (this.Error != "" && ShowError) + MessageBox.Show(this.Error, "SVN Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + + if (this.Output != "" && ShowOutput) + MessageBox.Show(this.Output, "SVN Information", MessageBoxButtons.OK, MessageBoxIcon.Information); + + return (this.Error == ""); + } + } +} diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..bf9c5e3 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,210 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace LSLEditor.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LSLEditor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap ADDITEM { + get { + object obj = ResourceManager.GetObject("ADDITEM", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap COPY { + get { + object obj = ResourceManager.GetObject("COPY", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap CUT { + get { + object obj = ResourceManager.GetObject("CUT", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap DEINDENT { + get { + object obj = ResourceManager.GetObject("DEINDENT", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap DELETE { + get { + object obj = ResourceManager.GetObject("DELETE", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap END { + get { + object obj = ResourceManager.GetObject("END", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap FIND { + get { + object obj = ResourceManager.GetObject("FIND", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ININDENT { + get { + object obj = ResourceManager.GetObject("ININDENT", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap logo { + get { + object obj = ResourceManager.GetObject("logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap NEWDOC { + get { + object obj = ResourceManager.GetObject("NEWDOC", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap NEWPROJ { + get { + object obj = ResourceManager.GetObject("NEWPROJ", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap OPEN { + get { + object obj = ResourceManager.GetObject("OPEN", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap PASTE { + get { + object obj = ResourceManager.GetObject("PASTE", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap PRINT { + get { + object obj = ResourceManager.GetObject("PRINT", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap PROJECT { + get { + object obj = ResourceManager.GetObject("PROJECT", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap PROPS { + get { + object obj = ResourceManager.GetObject("PROPS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap REDO { + get { + object obj = ResourceManager.GetObject("REDO", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap SAVE { + get { + object obj = ResourceManager.GetObject("SAVE", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap SAVEAS { + get { + object obj = ResourceManager.GetObject("SAVEAS", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap START { + get { + object obj = ResourceManager.GetObject("START", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap UNDO { + get { + object obj = ResourceManager.GetObject("UNDO", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..1861bfb --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\icons\copy.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\logo.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\inindent.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\delete.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\newproj.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\print.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\find.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\save.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\newdoc.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\deindent.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\paste.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\props.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\end.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\open.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\project.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\redo.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\saveas.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\undo.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\start.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\cut.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\icons\additem.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..48acd51 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,1225 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace LSLEditor.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("SecondLife Name")] + public string AvatarName { + get { + return ((string)(this["AvatarName"])); + } + set { + this["AvatarName"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2.40.0")] + public string Version { + get { + return ((string)(this["Version"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool BrowserInWindow { + get { + return ((bool)(this["BrowserInWindow"])); + } + set { + this["BrowserInWindow"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string AvatarKey { + get { + return ((string)(this["AvatarKey"])); + } + set { + this["AvatarKey"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("LSLEditor Island")] + public string RegionName { + get { + return ((string)(this["RegionName"])); + } + set { + this["RegionName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("smtp.emailserver.ext")] + public string EmailServer { + get { + return ((string)(this["EmailServer"])); + } + set { + this["EmailServer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("youraddress@yourdomain.ext")] + public string EmailAddress { + get { + return ((string)(this["EmailAddress"])); + } + set { + this["EmailAddress"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ProxyServer { + get { + return ((string)(this["ProxyServer"])); + } + set { + this["ProxyServer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ProxyUserid { + get { + return ((string)(this["ProxyUserid"])); + } + set { + this["ProxyUserid"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ProxyPassword { + get { + return ((string)(this["ProxyPassword"])); + } + set { + this["ProxyPassword"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point BrowserLocation { + get { + return ((global::System.Drawing.Point)(this["BrowserLocation"])); + } + set { + this["BrowserLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point FindLocation { + get { + return ((global::System.Drawing.Point)(this["FindLocation"])); + } + set { + this["FindLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Size BrowserSize { + get { + return ((global::System.Drawing.Size)(this["BrowserSize"])); + } + set { + this["BrowserSize"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://www.lslwiki.net/lslwiki/wakka.php?wakka=")] + public string Help { + get { + return ((string)(this["Help"])); + } + set { + this["Help"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Resource.ConfLSL.xml")] + public string ConfLSL { + get { + return ((string)(this["ConfLSL"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point LSLEditorLocation { + get { + return ((global::System.Drawing.Point)(this["LSLEditorLocation"])); + } + set { + this["LSLEditorLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Size LSLEditorSize { + get { + return ((global::System.Drawing.Size)(this["LSLEditorSize"])); + } + set { + this["LSLEditorSize"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("25")] + public double RegionFPS { + get { + return ((double)(this["RegionFPS"])); + } + set { + this["RegionFPS"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 175")] + public global::System.Drawing.Size SimulatorSize { + get { + return ((global::System.Drawing.Size)(this["SimulatorSize"])); + } + set { + this["SimulatorSize"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point SimulatorLocation { + get { + return ((global::System.Drawing.Point)(this["SimulatorLocation"])); + } + set { + this["SimulatorLocation"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("new.lsl")] + public string ExampleName { + get { + return ((string)(this["ExampleName"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("ReleaseNotes.htm")] + public string ReleaseNotes { + get { + return ((string)(this["ReleaseNotes"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("254464, 255232")] + public global::System.Drawing.Point RegionCorner { + get { + return ((global::System.Drawing.Point)(this["RegionCorner"])); + } + set { + this["RegionCorner"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool TabbedDocument { + get { + return ((bool)(this["TabbedDocument"])); + } + set { + this["TabbedDocument"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SLColorScheme { + get { + return ((bool)(this["SLColorScheme"])); + } + set { + this["SLColorScheme"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SL4SpacesIndent { + get { + return ((bool)(this["SL4SpacesIndent"])); + } + set { + this["SL4SpacesIndent"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool AutoWordSelection { + get { + return ((bool)(this["AutoWordSelection"])); + } + set { + this["AutoWordSelection"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Point GotoLocation { + get { + return ((global::System.Drawing.Point)(this["GotoLocation"])); + } + set { + this["GotoLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool WikiSeperateBrowser { + get { + return ((bool)(this["WikiSeperateBrowser"])); + } + set { + this["WikiSeperateBrowser"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("C:\\Documents and Settings\\Alphons\\Mijn documenten\\Visual Studio 2005\\Projects")] + public string OopsRemove { + get { + return ((string)(this["OopsRemove"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("About.htm")] + public string About { + get { + return ((string)(this["About"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("224, 224, 224")] + public global::System.Drawing.Color BracketHighlight { + get { + return ((global::System.Drawing.Color)(this["BracketHighlight"])); + } + set { + this["BracketHighlight"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("175, 0")] + public global::System.Drawing.Size SolutionSize { + get { + return ((global::System.Drawing.Size)(this["SolutionSize"])); + } + set { + this["SolutionSize"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("4")] + public int TabStops { + get { + return ((int)(this["TabStops"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int ToolTipDelay { + get { + return ((int)(this["ToolTipDelay"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CallUpgrade { + get { + return ((bool)(this["CallUpgrade"])); + } + set { + this["CallUpgrade"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("15")] + public int RecentFileMax { + get { + return ((int)(this["RecentFileMax"])); + } + set { + this["RecentFileMax"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CheckForUpdates { + get { + return ((bool)(this["CheckForUpdates"])); + } + set { + this["CheckForUpdates"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CheckEveryDay { + get { + return ((bool)(this["CheckEveryDay"])); + } + set { + this["CheckEveryDay"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool CheckEveryWeek { + get { + return ((bool)(this["CheckEveryWeek"])); + } + set { + this["CheckEveryWeek"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2010-01-01")] + public global::System.DateTime CheckDate { + get { + return ((global::System.DateTime)(this["CheckDate"])); + } + set { + this["CheckDate"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection RecentProjectList { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["RecentProjectList"])); + } + set { + this["RecentProjectList"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("15")] + public int RecentProjectMax { + get { + return ((int)(this["RecentProjectMax"])); + } + set { + this["RecentProjectMax"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection RecentFileList { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["RecentFileList"])); + } + set { + this["RecentFileList"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool IndentCursorPlacement { + get { + return ((bool)(this["IndentCursorPlacement"])); + } + set { + this["IndentCursorPlacement"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool IndentFullAuto { + get { + return ((bool)(this["IndentFullAuto"])); + } + set { + this["IndentFullAuto"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Indent { + get { + return ((bool)(this["Indent"])); + } + set { + this["Indent"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Drawing.Font FontEditor { + get { + return ((global::System.Drawing.Font)(this["FontEditor"])); + } + set { + this["FontEditor"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Drawing.Font FontTooltips { + get { + return ((global::System.Drawing.Font)(this["FontTooltips"])); + } + set { + this["FontTooltips"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection Bugreports { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["Bugreports"])); + } + set { + this["Bugreports"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("60")] + public int PathClipLength { + get { + return ((int)(this["PathClipLength"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SmtpUserid { + get { + return ((string)(this["SmtpUserid"])); + } + set { + this["SmtpUserid"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SmtpPassword { + get { + return ((string)(this["SmtpPassword"])); + } + set { + this["SmtpPassword"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("PLAIN")] + public string SmtpAuth { + get { + return ((string)(this["SmtpAuth"])); + } + set { + this["SmtpAuth"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("default.lsl")] + public string ExampleTemplate { + get { + return ((string)(this["ExampleTemplate"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool HelpOnline { + get { + return ((bool)(this["HelpOnline"])); + } + set { + this["HelpOnline"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool HelpOffline { + get { + return ((bool)(this["HelpOffline"])); + } + set { + this["HelpOffline"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("LSLEditorHelp.chm")] + public string HelpOfflineFile { + get { + return ((string)(this["HelpOfflineFile"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string CVSEXE { + get { + return ((string)(this["CVSEXE"])); + } + set { + this["CVSEXE"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string CVSROOT { + get { + return ((string)(this["CVSROOT"])); + } + set { + this["CVSROOT"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ProjectLocation { + get { + return ((string)(this["ProjectLocation"])); + } + set { + this["ProjectLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool DeleteOldFiles { + get { + return ((bool)(this["DeleteOldFiles"])); + } + set { + this["DeleteOldFiles"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool CodeCompletionUserVar { + get { + return ((bool)(this["CodeCompletionUserVar"])); + } + set { + this["CodeCompletionUserVar"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CodeCompletion { + get { + return ((bool)(this["CodeCompletion"])); + } + set { + this["CodeCompletion"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool CommentCStyle { + get { + return ((bool)(this["CommentCStyle"])); + } + set { + this["CommentCStyle"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SkipWarnings { + get { + return ((bool)(this["SkipWarnings"])); + } + set { + this["SkipWarnings"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SingleQuote { + get { + return ((bool)(this["SingleQuote"])); + } + set { + this["SingleQuote"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool QuotesListVerbose { + get { + return ((bool)(this["QuotesListVerbose"])); + } + set { + this["QuotesListVerbose"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection Plugins { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["Plugins"])); + } + set { + this["Plugins"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CodeCompletionArguments { + get { + return ((bool)(this["CodeCompletionArguments"])); + } + set { + this["CodeCompletionArguments"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool IndentWarning { + get { + return ((bool)(this["IndentWarning"])); + } + set { + this["IndentWarning"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool IndentAutoCorrect { + get { + return ((bool)(this["IndentAutoCorrect"])); + } + set { + this["IndentAutoCorrect"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool VersionControl { + get { + return ((bool)(this["VersionControl"])); + } + set { + this["VersionControl"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool VersionControlSVN { + get { + return ((bool)(this["VersionControlSVN"])); + } + set { + this["VersionControlSVN"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SvnExe { + get { + return ((string)(this["SvnExe"])); + } + set { + this["SvnExe"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SvnUserid { + get { + return ((string)(this["SvnUserid"])); + } + set { + this["SvnUserid"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SvnPassword { + get { + return ((string)(this["SvnPassword"])); + } + set { + this["SvnPassword"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("ANSI")] + public string OutputFormat { + get { + return ((string)(this["OutputFormat"])); + } + set { + this["OutputFormat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ShowSolutionExplorer { + get { + return ((bool)(this["ShowSolutionExplorer"])); + } + set { + this["ShowSolutionExplorer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string WorkingDirectory { + get { + return ((string)(this["WorkingDirectory"])); + } + set { + this["WorkingDirectory"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Production")] + public string XSecondLifeShard { + get { + return ((string)(this["XSecondLifeShard"])); + } + set { + this["XSecondLifeShard"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool AutoSaveOnDebug { + get { + return ((bool)(this["AutoSaveOnDebug"])); + } + set { + this["AutoSaveOnDebug"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ToolTip { + get { + return ((bool)(this["ToolTip"])); + } + set { + this["ToolTip"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool HelpNewTab { + get { + return ((bool)(this["HelpNewTab"])); + } + set { + this["HelpNewTab"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CodeCompletionAnimation { + get { + return ((bool)(this["CodeCompletionAnimation"])); + } + set { + this["CodeCompletionAnimation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("NoteCard.txt")] + public string ExampleNameNotecard { + get { + return ((string)(this["ExampleNameNotecard"])); + } + set { + this["ExampleNameNotecard"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool llGetScriptName { + get { + return ((bool)(this["llGetScriptName"])); + } + set { + this["llGetScriptName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool StatesInGlobalFunctions { + get { + return ((bool)(this["StatesInGlobalFunctions"])); + } + set { + this["StatesInGlobalFunctions"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("LSLEditor parcel")] + public string ParcelName { + get { + return ((string)(this["ParcelName"])); + } + set { + this["ParcelName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Description of LSLEditor parcel")] + public string ParcelDescription { + get { + return ((string)(this["ParcelDescription"])); + } + set { + this["ParcelDescription"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("00000000-0000-0000-0000-000000000000")] + public string ParcelOwner { + get { + return ((string)(this["ParcelOwner"])); + } + set { + this["ParcelOwner"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("00000000-0000-0000-0000-000000000000")] + public string ParcelGroup { + get { + return ((string)(this["ParcelGroup"])); + } + set { + this["ParcelGroup"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("512")] + public int ParcelArea { + get { + return ((int)(this["ParcelArea"])); + } + set { + this["ParcelArea"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute(@" + // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) + default + { + state_entry() + { + llSay(0, ""Hello, Avatar!""); + } + touch_start(integer total_number) + { + llSay(0, ""Touched: ""+(string)total_number); + } + } + ")] + public string Example { + get { + return ((string)(this["Example"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/checkforupdate/Default.aspx?\r\n ")] + public string Update { + get { + return ((string)(this["Update"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/examples/\r\n ")] + public string Examples { + get { + return ((string)(this["Examples"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/uploadscript/\r\n ")] + public string Upload { + get { + return ((string)(this["Upload"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n Resource.ConfCSharp.xml\r\n ")] + public string ConfCSharp { + get { + return ((string)(this["ConfCSharp"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/CheckForUpdate/Manifest.aspx\r\n ")] + public string UpdateManifest { + get { + return ((string)(this["UpdateManifest"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n Resource.ToolsOptions.xml\r\n ")] + public string ToolsOptions { + get { + return ((string)(this["ToolsOptions"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/mail/\r\n ")] + public string ContactUrl { + get { + return ((string)(this["ContactUrl"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/donate.htm\r\n ")] + public string DonateUrl { + get { + return ((string)(this["DonateUrl"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://wiki.secondlife.com/wiki/Special:Search?go=Go&search=\r\n " + + " ")] + public string Help2 { + get { + return ((string)(this["Help2"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lslwiki.net/lslwiki/wakka.php?wakka=\r\n ")] + public string Help1 { + get { + return ((string)(this["Help1"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n http://www.lsleditor.org/forum/\r\n ")] + public string ForumLSLEditor { + get { + return ((string)(this["ForumLSLEditor"])); + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..8150cc7 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,356 @@ + + + + + + SecondLife Name + + + 2.40.0 + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + youraddress@yourdomain.ext + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + Resource.ConfLSL.xml + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 175 + + + 0, 0 + + + new.lsl + + + ReleaseNotes.htm + + + 254464, 255232 + + + True + + + False + + + False + + + False + + + 0, 0 + + + False + + + C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects + + + About.htm + + + 224, 224, 224 + + + 175, 0 + + + 4 + + + 100 + + + True + + + 15 + + + True + + + True + + + False + + + 2010-01-01 + + + + + + 15 + + + + + + False + + + True + + + True + + + + + + + + + + + + 60 + + + + + + + + + PLAIN + + + default.lsl + + + True + + + False + + + LSLEditorHelp.chm + + + + + + + + + + + + False + + + False + + + True + + + False + + + False + + + False + + + False + + + + + + True + + + True + + + False + + + False + + + False + + + + + + + + + + + + ANSI + + + False + + + + + + Production + + + False + + + True + + + True + + + True + + + NoteCard.txt + + + False + + + False + + + LSLEditor parcel + + + Description of LSLEditor parcel + + + 00000000-0000-0000-0000-000000000000 + + + 00000000-0000-0000-0000-000000000000 + + + 512 + + + + // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) + default + { + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } + } + + + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + + + http://www.lsleditor.org/examples/ + + + + + http://www.lsleditor.org/uploadscript/ + + + + + Resource.ConfCSharp.xml + + + + + http://www.lsleditor.org/CheckForUpdate/Manifest.aspx + + + + + Resource.ToolsOptions.xml + + + + + http://www.lsleditor.org/mail/ + + + + + http://www.lsleditor.org/donate.htm + + + + + http://wiki.secondlife.com/wiki/Special:Search?go=Go&search= + + + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + + + http://www.lsleditor.org/forum/ + + + + \ No newline at end of file diff --git a/Resource/About.htm b/Resource/About.htm new file mode 100644 index 0000000..3602b03 --- /dev/null +++ b/Resource/About.htm @@ -0,0 +1,212 @@ + + + About LSL-Editor + + + + Special thanks to:
+
+ +
    + +
  • Vlad Bjornson
  • +
  • Mazok Nishi
  • +
  • Sonja Manatiso
  • +
  • Hippi Hammerer
  • + +
  • Baron Hauptmann
  • +
  • Arfim Balut
  • +
  • Thelma Huet
  • + +
  • Rand Charleville
  • +
  • MeAm Okelly
  • +
  • krishna Kanik
  • +
  • Smoere Broek
  • + +
  • Frederick Zanzibar
  • +
  • Andon Beattie
  • +
  • Rejha Vuckovic
  • +
  • Alidar Moxie
  • +
  • Al Supercharge
  • + +
  • Krissmas Merryman
  • +
  • Jolan Fonda
  • +
  • Hippi Hammerer
  • +
  • Sonja Manatiso
  • + +
  • Chase Marellan
  • +
  • Dui Zhang
  • +
  • Scott Diener
  • +
  • Nakiakekai Heliosense
  • + +
  • Adalace Jewell
  • +
  • Dave Dennis
  • +
  • Scythe Elfenbeim
  • +
  • Rynnan Riggles
  • +
  • SynCere Talon
  • +
  • Maxis Neely
  • + +
  • Nightwind Redgrave
  • +
  • WaMark Basevi
  • +
  • Brett Henley
  • +
  • Wam7c Macchi
  • +
  • Wen Grian
  • +
  • Reno Folland
  • +
  • Deven Lefavre
  • +
  • Suepahfly Streeter
  • +
  • Hector Greenspan
  • + +
  • Ricky Lucero
  • +
  • Miguel Yesheyev
  • +
  • Lisa Flatley
  • +
  • Vico Torok
  • +
  • Indigo Mertel
  • +
  • JenniferD Noel
  • +
  • Tabitha Greenspan
  • +
  • Pol McLaglen
  • + +
  • Mitchmiester Slade
  • +
  • Murie Lynagh
  • + +
  • Madgeek Nixdorf
  • +
  • Alexin Auer
  • +
  • Trance Broek
  • +
  • Blackstone Market
  • +
  • Dana Mureaux
  • + +
  • Dig Somme
  • +
  • ichiro Kiama
  • +
  • Theo Outlander
  • + +
  • Saul Kish
  • +
  • Sempronio Barbosa
  • +
  • Capt Blinker
  • +
  • Debbie Trilling
  • +
  • Nigel Beaumont
  • +
  • Billboard Kidd
  • + +
  • Ryder Dryke
  • +
  • Sylvia Baxter
  • + +
  • Wolt Amat
  • +
  • Matthew White
  • +
  • Ruth Chabay
  • +
  • Ricky Lucero
  • +
  • Nico van Klaveren
  • +
  • SummerDale Beckstrand
  • + +
  • Wen Grian
  • +
  • SK Decosta
  • +
  • Agathos Frascati
  • + +
  • Rhianne Darkstone
  • +
  • Wolt Amat
  • + +
  • Tarquin Janus
  • +
  • Costas Menico
  • +
  • Piet Garfield
  • +
  • Stephane Zugzwang
  • + +
  • WaMark Basevi
  • +
  • Agathos Frascati
  • +
  • Al Supercharge
  • +
  • Pencilsky Germi
  • +
  • Kii Lilliehook
  • + +
  • Metal Gynoid
  • +
  • Indigo Mertel
  • +
  • Tee Tulip
  • +
  • Frans Carbaat
  • +
  • Orcian Longstaff
  • +
  • Salid Sewell
  • +
  • AnnMarie Coronet
  • +
  • constantin klein
  • +
  • Dan Hartshorn
  • +
  • Second Nature 3
  • +
  • Trevor Langdon
  • +
  • Lecalat Starbrook
  • +
  • Jesse Barnett
  • +
  • Daniel Quigley
  • +
  • Chavo Raven
  • +
  • Gerral Hubbard
  • +
  • DrDoug Pennell
  • +
  • Forest Klaar
  • +
  • Gearsawe Stonecutter
  • + +
  • Avian Islands
  • +
  • Bernard Davis
  • +
  • DangerDave Writer
  • +
  • Olivier Jeanjean
  • +
  • Mo Hax
  • +
  • Salahzar Stenvaag
  • + +
  • Kirrineth Dragonash
  • +
  • Rock Vacirca
  • +
  • Maeva Anatine
  • +
  • Lois Laughton
  • + +
  • Elizabeth Didier
  • +
  • Hiroshi Iuga
  • +
  • Susan Koltai
  • +
  • Klaus-E Klingner
  • +
  • Bimble
  • + +
  • Richard Collins
  • +
  • Ralph Brown
  • + +
  • Igorbar Barbosa
  • +
  • Ichiro Kiama
  • +
  • Fletcher Rock
  • + +
  • Zoe Gauvreau
  • +
  • Luca Peck
  • +
  • James Leach
  • +
  • Michael Schneider
  • + +
  • Basel Janus
  • +
  • Petersnow Hyun
  • +
  • Itsme Frederix
  • +
  • Moard Ling
  • + +
  • Diosnegro Bertolucci
  • +
  • Hiroza Hird
  • + +
  • Cale Vinson
  • +
  • Yenzo Cortes
  • +
  • Malcolm J. Kudra
  • +
  • Robert Hayden
  • +
  • John Stout
  • +
  • Jim McElhiney
  • +
  • Sergey Mirontsev
  • +
  • David S
  • +
  • Never 30
  • +
  • Maurice 'colorstonic'
  • +
  • Ricc Harding
  • +
  • Thomas 'Angeldust'
  • +
  • Sally LaSalle
  • +
  • Sebastian Fuentes
  • +
  • Sandra Lee
  • +
  • Dimentox Travanti
  • +
  • Peter Swales
  • +
  • Nicole Wells
  • +
  • Matthew Oberlin
  • +
  • Lee 'Sailer' Ponzu
  • +
  • Marco Piazza
  • +
  • Darek Deluca
  • +
  • Johannes Rajala
  • +
  • Till Stirling
  • +
  • CharlyM3 Foden
  • +
  • Gerry Woolfenden
  • +
  • Michael Powell
  • +
  • Ronin DeVinna www.slportugal.com
  • +
  • Toran Cult
  • +
  • Strife Onizuka
  • +
  • Sandra Tsure
  • +
+
+ + + + \ No newline at end of file diff --git a/Resource/App.ico b/Resource/App.ico new file mode 100644 index 0000000..21a42c8 Binary files /dev/null and b/Resource/App.ico differ diff --git a/Resource/AssemblyInfo.cs b/Resource/AssemblyInfo.cs new file mode 100644 index 0000000..c8f231a --- /dev/null +++ b/Resource/AssemblyInfo.cs @@ -0,0 +1,101 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("LSL-Editor")] +[assembly: AssemblyDescription("LSL-Editor for editing en compiling LSL scripts")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Van der Heijden Holding BV")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Alphons van der Heijden")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("2.40.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyName("")] +//[assembly: AssemblyKeyFile("..\\..\\Resource\\test.snk")] \ No newline at end of file diff --git a/Resource/ConfCSharp.xml b/Resource/ConfCSharp.xml new file mode 100644 index 0000000..4360f6c --- /dev/null +++ b/Resource/ConfCSharp.xml @@ -0,0 +1,102 @@ + + + + + //.* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resource/ConfLSL.xml b/Resource/ConfLSL.xml new file mode 100644 index 0000000..572619d --- /dev/null +++ b/Resource/ConfLSL.xml @@ -0,0 +1,4188 @@ + + + + //.* + + + + "[^"\\]* (?>\\.[^"\\]*)*" + + + + + \+\+|\-\-|\<\<|\>\>|\<\=|\>\=|\=\=|\!\=|\&\&|\|\||\+\=|\-\=|\*\=|\/\=|\%\= + + + + + [+-]?0x[\da-fA-F.p]+ | [-+]?\d* \.?\d+([eE][-+]?\d+)? + + + + + + + + + + + + + All scripts must have a + default + state, + which also must be the first state entered when the script starts. + If another state is defined before the default state, + the compiler will report a syntax error. + + + + + + + + + + + + + + + + + + + + + + + + Complete listing of the Linden Library function calls available in lsl. + + string llStringTrim(string text, integer trim_type); + + Outputs a string eliminating whitespace from the start and/or end of the specified string. + + Constants for trim_type: + STRING_TRIM_HEAD: trim all leading spaces in text + STRING_TRIM_TAIL: trim all trailing spaces in text + STRING_TRIM: trim all leading and trailing spaces in text + string to trim + + STRING_TRIM_HEAD,STRING_TRIM_TAIL or STRING_TRIM + + + + + void llSetLinkPrimitiveParams(integer linknumber, list rules); + + Sets the parameters (or properties) of any linked prim in none step + + + + void llSetLinkTexture(integer linknumber, string texture, integer face); + + Sets the texture of linked prims + + + + integer llGetObjectPrimCount(key id); + + Returns the prim count for any object id in the same sim. + + + + list llGetParcelDetails(vector pos, list details); + + Returns of a list of the details in the order they are in the details list, + for the parcel at pos. pos is in absolute region coordinates. + + + + integer llGetParcelMaxPrims(vector pos, integer sim_wide); + + + + integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide); + + Returns the number of prims used on the parcel at pos which are in category. + + If sim_wide is TRUE, it returns the number of objects + for the entire sim in the category specified. + If sim_wide is FALSE, it returns the number of objects + on this specific parcel in the category specified + region coordinate + + a PARCEL_COUNT_* flag + + Can be TRUE or FALSE + + + + list llGetParcelPrimOwners(vector pos); + + Returns a strided list of keys and integers of up to 100 + agents who own objects in the parcel at pos. + The list is formatted as + [ key agentKey1, integer agentCount1, key agentKey2, integer agentCount2, ... ], + sorted by agent key. + The integers are counts of the number of prims (not objects) + owned by the corresponding agents. + Sleeps the script for 2.0 seconds. + Function only works when the object owner is in the sim + (likely the reason it doesn't work when deeded to group). + + + + integer llAbs(integer val); + + Returns the absolute value of val. + + + float llAcos(float val); + + Returns the arccosine in radians of val. + + + llAddToLandPassList(key avatar, float hours); + + Add avatar to the land pass list for hours. + + + llAdjustSoundVolume(float volume); + + Adjusts the volume of the currently playing attached sound started + with llPlaySound or llLoopSound. + This function Has no effect on sounds started with llTriggerSound. + + + llAllowInventoryDrop(integer add); + + If add == TRUE, users that do no have object modify permissions can + still drop inventory items onto object. + + + float llAngleBetween(rotation a, rotation b); + + Returns the angle in radians between rotations a and b. + + + llApplyImpulse(vector force, integer local); + + Applies the impulse in local coordinates if local == TRUE. + Otherwise the impulse is applied in global coordinates. + This function only works on physical objects. + + + llApplyRotationalImpulse(vector force, integer local); + + Applies a rotational impulse force in local coordinates if local == TRUE. + Otherwise the impulse is applied in global coordinates. + This function only works on physical objects. + + + float llAsin(float val); + + Returns the arcsine in radians of val. + + + float llAtan2(float y, float x); + + returns the arctangent2 of y, x + + + llAttachToAvatar(integer attachment); + + Attach to avatar at point attachment. + Requires the PERMISSION_ATTACH runtime permission. + + + + key llAvatarOnSitTarget(void); + + If an avatar is sitting on the sit target, return the avatars key, + NULL_KEY otherwise. This only will detect + avatars sitting on sit targets defined with llSitTarget. + + + rotation llAxes2Rot(vector fwd, vector left, vector up); + + Returns the rotation represented by coordinate axes fwd, left, and up. + + + rotation llAxisAngle2Rot(vector axis, float angle); + + Returns the rotation generated angle about axis. + + + llBreakAllLinks(void); + + Delinks all objects in the link set. + Requires the permission PERMISSION_CHANGE_LINKS be set. + + + llBreakLink(integer linknum); + + Delinks the object with the given link number. + Requires permission PERMISSION_CHANGE_LINKS be set. + + + list llCSV2List(string src); + + Create a list from a string of comma separated values specified in src. + + + integer llCeil(float val); + + Returns largest integer value >= val. + + + float llCloud(vector offset); + + Returns the cloud density at the object position + offset. + + + llCollisionFilter(string name, key id, iteger accept); + + If accept == TRUE, only accept collisions with objects name and id, + otherwise with objects not name or id. + Specify an empty string or NULL_KEY to not filter + on the corresponding parameter. + + + llCollisionSound(string impact_sound, float impact_volume); + + Suppress default collision sounds, replace default impact sounds + with impact_sound found in the object inventory. + Supply an empty string to suppress collision sounds. + + + llCollisionSprite(string impact_sprite); + + Suppress default collision sprites, replace default impact sprite + with impact_sprite found in the object inventory. + Supply an empty string to just suppress. + + + float llCos(float theta); + + Returns the cosine of thetaradians. + + + llCreateLink(key target, integer parent); + + Attempt to link object script is attached to and target. + Requires permission PERMISSION_CHANGE_LINKS be set. + If parent== TRUE, object script is attached to is the root. + + + + + list llDeleteSubList(list src, integer start, integer end); + + Remove the slice from the list and return the remainder. + The start and end are inclusive, so 0, length -1 would delete the + entire list and 0,0 would delete the first list entry. + Using negative numbers for start and/or end causes the index to count + backwards from the length of the list, so 0,-1 would delete the entire + list. If start is larger than end the list deleted is the exclusion + of the entries, so 6,4 would delete the entire list except + for the 5th list entry. + + + string llDeleteSubString(string src, integer start, integer end); + + Removes the indicated substring and returns the result. + The start and end are inclusive, so 0,length-1 would + delete the entire string and 0,0 would delete the first character. + Using negative numbers for start and/or end causes the index to + count backwards from the length of the string, so 0,-1 would + delete the entire string. If start is larger than end the sub string + is the exclusion of the entries, so 6,4 would delete the entire string + except for the 5th character. + + + llDetachFromAvatar(void); + + Drop off of avatar. + + + vector llDetectedGrab(integer number); + + Returns the grab offset of detected object number. + Returns <0,0,0> if number is not valid sensed object. + + + key llDetectedKey(integer number); + + Returns the key of detected object number. + Returns NULL_KEY if number is not valid sensed object. + + + integer llDetectedLinkNumber(integer number); + + Returns the link position of the triggered event for touches. + 0 for a non-linked object, 1 for the root of a linked + object, 2 for the first child, etc. + + + string llDetectedName(integer number); + + Returns the name of detected object number. + Returns empty string if number is not valid sensed object. + + + key llDetectedOwner(integer number); + + Returns the key of detected number objects owner. + Returns invalid key if number is not valid sensed object. + + + vector llDetectedPos(integer number); + + Returns the position of detected object number. + Returns <0,0,0> if number is not valid sensed object. + + + rotation llDetectedRot(integer number); + + Returns the rotation of detected object number. + Returns <0,0,0,1> if number is not valid sensed object. + + + integer llDetectedType(integer number); + + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object + number. Returns 0 if number is not valid sensed object. + Note that number is a bitfield, so comparisons need to be a bitwise + and check. eg: + integer type = llDetectedType(0); + if (type and AGENT) + { + // ...do stuff with the agent + } + + + vector llDetectedVel(integer number); + + Returns the velocity of detected object number. + Returns <0,0,0 and > + if number is not valid sensed object. + + + llDialog(key avatar, string message, list buttons, integer channel); + + Opens a "notify box" in the top-right corner of the given avatars + screen displaying the message. Up to four + buttons can be specified in a list of strings. When the player + clicks a button, the name of the button is chatted on + the specified channel. Channels work just like llSay(), + so channel 0 can be heard by everyone. The chat + originates at the objects position, not the avatars position. e.g. + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], 4913); + llDialog(who, "This shows only an OK button.", [], 192); + llDialog(who, "This chats so you can hear it.", ["Hooray"], 0); + + + llDie(void); + + Delete the object which holds the script. + + + string llDumpList2String(list src, string separator); + + Write the list out in a single string using separator between values. + + + integer llEdgeOfWorld(vector pos, vector dir); + + Returns TRUE if the line along dir from poshits the edge + of the world in the current simulator and returns + FALSE if that edge crosses into another simulator. + + + llEjectFromLand(key pest); + + Ejects pestfrom land that you own. + + + llEmail(string address, string subject, string message); + + Sends email to addresswith subjectand message. + + + rotation llEuler2Rot(vector vec); + + Returns the rotation represented by Euler Angle vec. + + + float llFabs(float val); + + Returns the absolute value of val. + + + integer llFloor(float val); + + Returns largest integer value<= val. + + + float llFrand(float mag); + + Returns a pseudo-random number between [0, mag). + + + vector llGetAccel(void); + + Gets the acceleration. + + + integer llGetAttached(void); + + Returns the object attachment point or 0 if not attached. + + + integer llGetAgentInfo(key id); + + Returns information about the given agent id. Returns a bitfield + of agent info constants. + + + vector llGetAgentSize(key id); + + If the agent id is in the same sim as the object, returns + the size of the avatar. + + + float llGetAlpha(integer face); + + Returns the alpha of the given face. If faceis ALL_SIDES + the value returned is the mean average of all faces. + + + float llGetAndResetTime(void); + + Gets the time in seconds since creation and sets the time to zero. + + + string llGetAnimation(key id); + + Returns the currently playing animation for avatar id. + + + vector llGetCenterOfMass(void); + + Returns the center of mass of the root object. + + + vector llGetColor(integer face); + + Returns the color of face as a vector of red, green, and blue values + between 0 and 1. If face is ALL_SIDES + the color returned is the mean average of each channel. + + + string llGetDate(void); + + Returns the current UTC date as YYYY-MM-DD. + + + float llGetEnergy(void); + + Returns how much energy is in the object as a percentage of maximum. + + + vector llGetForce(void); + + Returns the current force if the script is physical. + + + integer llGetFreeMemory(void); + + Returns the available heap space for the current script. + + + key llGetInventoryKey(string name); + + Returns the key of the inventory name. + + + string llGetInventoryName(integer type, integer number); + + Get the name of the inventory item number of type. + Use the inventory constants to specify the type. + inventory item type + + inventory item number + + + + integer llGetInventoryNumber(integer type); + + Get the number of items of type in the object inventory. + Use the inventory constants to specify the type. + inventory item type + + + key llGetKey(void); + + Get the key for the object which has this script. + + + key llGetLandOwnerAt(vector pos); + + Returns the key of the land owner at posor NULL_KEY if public. + + + key llGetLinkKey(integer linknum); + + Returns the key of linknumin the link set. + + + string llGetLinkName(integer linknum); + + Returns the name of linknumin the link set. + + + integer llGetLinkNumber(void); + + Returns what link number in a link set the for the object + which has this script. 0 means no link, 1 the root, 2 for + first child, etc. + + + integer llGetListEntryType(list src, integer index); + + Returns the type of the variable at index in src. + + + integer llGetListLength(list src); + + Returns the number of elements in src. + + + vector llGetLocalPos(void); + + Returns the local position of a child object relative to the root. + + + rotation llGetLocalRot(void); + + Returns the local rotation of a child object relative to the root. + + + llGetNextEmail(string address, string subject); + + Get the next waiting email with appropriate addressand/or subject. + If the parameters are blank, they are not used for filtering. + + + key llGetNotecardLine(string name, integer line); + + This function fetches line number line of notecard name and returns + the data through the dataserver event. The line count starts at zero. + If the requested line is past the end of the notecard the dataserver + event will return the constant EOF string. + The key returned by this function is a unique identifier which will + be supplied to the dataserver event in the requested parameter. + + + integer llGetNumberOfSides(void); + + Returns the number of sides of the current object which has the script. + + + string llGetObjectName(void); + + Returns the name of the object which has the script. + + + vector llGetOmega(void); + + Returns the omega. + + + key llGetOwner(void); + + Returns the owner of the object. + + + key llGetOwnerKey(key id); + + Returns the owner of object id. + + + integer llGetPermissions(void); + + Returns what permissions have been enabled.eg: + + integer perm = llGetPermissions(); + if((perm and PERMISSION_DEBIT) == PERMISSION_DEBIT) + { + // code goes here + } + + + key llGetPermissionsKey(void); + + Returns avatar that has enabled permissions. + Returns NULL_KEY if not enabled. + + + vector llGetPos(void); + + Returns the position. + + + llGetRegionFPS(void); + + Returns the mean region frames per second. + + + string llGetRegionName(void); + + Returns the current region name. + + + float llGetRegionTimeDilation(void); + + Returns the current time dilation as a float between 0 and 1. + + + rotation llGetRot(void); + + Returns the rotation. + + + vector llGetScale(void); + + Returns the scale. + + + string llGetScriptName(void); + + Returns the name of this script. + + + integer llGetStartParameter(void); + + Returns the start parameter passed to llRezObject. + If the object was created from agent inventory, this function + returns 0. + + + integer llGetScriptState(string name); + + Resets TRUE if script nameis running + + + integer llGetStatus(integer status); + + Returns the value of status. + The value will be one of the status constants. + + + string llGetSubString(string src, integer start, integer end); + + Returns the indicated substring from src. The startand end are + inclusive, so 0,length-1 would capture the entire string and 0,0 + would capture the first character. Using negative numbers for + start and/or end causes the index to count backwards from the length + of the string, so 0,-1 would capture the entire string. + If start is larger than end the sub string is the exclusion of the + entries, so 6,4 would give the entire string + except for the 5th character. + + + vector llGetSunDirection(void); + + Returns the sun direction on the simulator. + + + string llGetTexture(integer face); + + Returns the texture of faceif it is found in object inventory. + + + vector llGetTextureOffset(integer side); + + Returns the texture offset of sidein the x and y components of a vector. + + + float llGetTextureRot(integer side); + + Returns the texture rotation of side. + + + vector llGetTextureScale(integer side); + + Returns the texture scale of sidein the x and y components of a vector. + + + float llGetTime(void); + + Returns the time in seconds since creation of this script. + + + float llGetTimeOfDay(void); + + Gets the time in seconds since midnight in Second Life. + + + vector llGetTorque(void); + + Returns the torque if the script is physical. + + + vector llGetVel(); + + Returns the velocity. + + + float llGetWallclock(void); + + Returns the time in seconds since simulator timezone midnight. + + + llGiveInventory(key destination, string inventory); + + Give the named inventory item to the keyed avatar or object in the + same simulator as the giver. If the recipient is an avatar, + the avatar then follows the normal procedure of accepting + or denying the offer. If the recipient is an object, + the same permissions apply as if you were dragging inventory + onto the object by hand, ie if llAllowInventoryDrop has been called + with TRUE, any other object can pass objects to its inventory. + + + llGiveInventoryList(key destination, string category, list inventory); + + Give the list of named inventory items to the keyed avatar or object + in the same simulator as the giver. If the recipient is an avatar, + the avatar then follows the normal procedure of accepting or denying + the offer. The offered inventory is then placed in a folder named + category in the recipients inventory. If the recipient is an object, + the same permissions apply as if you were dragging inventory onto the + object by hand, ie if llAllowInventoryDrop has been called with TRUE, + any other object can pass objects to its inventory.If the + recipient is an object, the category parameter is ignored. + + + llGiveMoney(key destination, integer amount); + + Transfer amountfrom the script owner to destination. + This call will fail if PERMISSION_DEBIT has not been set. + + + float llGround(vector offset); + + Retuns the ground hieght at the object position + offset. + + + vector llGroundContour(vector offset); + + Retuns the ground contour at the object position + offset. + + + vector llGroundNormal(vector offset); + + Retuns the ground contour at the object position + offset. + + + llGroundRepel(float height, integer water, float tau); + + Critically damps to heightif within height* 0.5 of level. + The heightis above ground level if water + is FALSE or above the higher of land and water if water is TRUE. + + + vector llGroundSlope(vector offset); + + Returns the ground slope at the object position + offset. + + + string llInsertString(string dst, integer position, string src); + + Inserts src into dst at position and returns the result. + + + llInstantMessage(key user, string message); + + Send messageto the user as an instant message. + + + string llKey2Name(key id); + + If object id is in the same simulator, return the name of the object. + + + string llList2CSV(list src); + + Create a string of comma separated values from list. + + + float llList2Float(list src, integer index); + + Returns the float at index in the list src. + + + integer llList2Integer(list src, integer index); + + Returns the integer at index in the list src. + + + key llList2Key(list src, integer index); + + Returns the key at index in the list src. + + + list llList2List(list src, integer start, integer end); + + Returns the slice of the list from startto end from the list + srcas a new list. The startand end parameters + are inclusive, so 0,length-1 would copy the entire list and 0,0 + would capture the first list entry. Using negative + numbers for startand/or end causes the index to count backwards + from the length of the list, so 0,-1 would + capture the entire list. If startis larger than end the list + returned is the exclusion of the entries, so 6,4 would + give the entire list except for the 5th entry. + + + list llList2ListStrided(list src, integer start, integer end, integer stride); + + Copy the strided slice of src from start to end. + + + rotation llList2Rot(list src, integer index); + + Returns the rotation at index in src. + + + string llList2String(list src, integer index); + + Returns the string at index in src. + + + llList2Vector(list src, integer index); + + Returns the vector at index in src. + + + integer llListFindList(list src, list test); + + Returns the position of the first instance of testin src. + Returns -1 if test is not in src. + + + list llListInsertList(list dest, list src, integer pos); + + Returns the list created by inserting src into dest at pos. + + + list llListRandomize(list src, integer stride); + + Returns srcrandomized into blocks of size stride. + If the length of srcdividided by strideis non-zero, + this function does not randomize the list. + + + list llListSort(list src, integer stride, integer ascending); + + Returns src sorted into blocks of stride in ascending order if + ascending is TRUE. Note that sort only + works in the head of each sort block is the same type. + list to sort + + blocks of stride length + + + TRUE ascending sort result, FALSE = descending sort result + + + + integer llListen(integer channel, string name, key id, string msg); + + Sets a listen event callback for msg on channel from name and + returns an identifier that can be used to + deactivate or remove the listen. The name, id and/or msg parameters + can be blank to indicate not to filter on + that argument. Channel 0 is the public chat channel that all avatars + see as chat text. Channels 1 to 2,147,483,648 + are hidden channels that are not sent to avatars. + + + llListenControl(integer number, integer active); + + Make a listen event callback active or inactive. Pass in the value + returned from llListen to the number parameter + to specify which event you are controlling. + Use boolean values to spcify active + + + llListenRemove(integer number); + + Removes a listen event callback. Pass in the value returned from + llListen to the number parameter to specify + which event you are removing. + + + llLookAt(vector target, float strength, float damping); + + Cause object to point the forward axis toward target. + Good strengthvalues are around half the mass of the + object and good damping values are less than 1/10th of the strength. + Asymmetrical shapes require smaller + damping. A strength of 0.0 cancels the look at. + + + llLoopSound(string sound, flaot volume); + + Similar to llPlaySound, this function plays a sound attached to an + object, but will continuously loop that sound + until llStopSound or llPlaySound is called. Only one sound may be + attached to an object at a time. A second call + to llLoopSound with the same key will not restart the sound, but the + new volume will be used. This allows + control over the volume of already playing sounds. Setting the + volumeto 0 is not the same as calling + llStopSound; a sound with 0 volume will continue to loop. + To restart the sound from the beginning, call + llStopSound before calling llLoopSound again. + + + llLoopSoundMaster(string sound, flaot volume); + + Behaviour is identical to llLoopSound, with the addition of marking + the source as a "Sync Master", causing + "Slave" sounds to sync to it. If there are multiple masters within + a viewers interest area, the most audible one (a + function of both distance and volume) will win out as the master. + The use of multiple masters within a small area + is unlikely to produce the desired effect. + + + llLoopSoundSlave(string sound, flaot volume); + + Behaviour is identical to llLoopSound, + unless there is a "Sync Master" present. If a Sync Master is already + playing the Slave sound will begin playing from the same point + the master is in its loop syncronizing the loop + points of both sounds. If a Sync Master is started when the Slave + is already playing, the Slave will skip to the + correct position to sync with the Master. + + + llMakeExplosion(integer particles, float scale, float velocity, float lifetime,float arc, string texture, vector offset); + + Make a round explosion of particles using texture from the objects inventory. + + + llMakeFire(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make fire particles using texturefrom the objects inventory. + + + llMakeFountain(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make a fountain of particles using texturefrom the objects inventory. + + + llMakeSmoke(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make smoky particles using texturefrom the objects inventory. + + + llMessageLinked(integer linknum, integer num, string str, key id); + + Sends num, str, and id to members of the link set. + The linknumparameter is either the linked number + available through llGetLinkNumber or a link constant. + + + llMinEventDelay(float delay); + + Set the minimum time between events being handled. + + + llModifyLand(integer action, integer size); + + Modify land with action on size area. + The parameters can be chosen from the land constants. + + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT + + + LAND_SMALL_BRUSH, LAND_MEDIUM_BRUSH or LAND_LARGE_BRUSH + + + + llMoveToTarget(vector target, float tau); + + Critically damp to position targetin tau-seconds if the + script is physical. Good tau-values are greater than 0.2. + A tau of 0.0 stops the critical damping. + + + llOffsetTexture(float offset_s, float offset_t, integer face); + + Sets the texture s and t offsets of face. + If faceis ALL_SIDES this function sets the texture offsets for + all faces. + + + integer llOverMyLand(key id); + + Returns TRUE if id is over land owned by the object owner, + FALSE otherwise. + + + list llParseString2List(string src, list separators, list spacers); + + Breaks src into a list, discarding anything in separators, + keeping any entry in spacers. The + separators and spacers must be lists of strings with a maximum + of 8 entries each. So, if you had made the + call: + llParseString2List("Parsethisnow! I dare:you to.", ["this", "!", " "], [":"]); + You would get the list: + ["Parse", "now", "I", "dare", ":", "you", "to"] + + + llParticleSystem(list parameters); + + Makes a particle system based on the parameter list. + The parametersare specified as an ordered list of + parameter and value. Valid parameters and their expected + values can be found in the particle system constants. + Here is a simple example: + llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_WIND_MASK, + PSYS_PART_START_COLOR, <1,0,0>, + PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE]); + + + llPassCollisions(integer pass); + + If passis TRUE, land and object collisions are passed from + children on to parents. + + + llPassTouches(integer pass); + + If passis TRUE, touches are passed from children on to parents. + + + llPlaySound(string sound, float volume); + + Plays a sound once. The sound will be attached to an object and + follow object movement. Only one sound may + be attached to an object at a time, and attaching a new sound or + calling llStopSound will stop the previously + attached sound. A second call to llPlaySound with the same sound + will not restart the sound, but the new + volume will be used, which allows control over the volume + of already playing sounds. To restart the sound from + the beginning, call llStopSound before calling llPlaySound again. + + + llPlaySoundSlave(string sound, float volume); + + Behaviour is identical to llPlaySound, unless there is + a "Sync Master" present. If a Sync Master is already + playing the Slave sound will not be played until the Master + hits its loop point and returns to the beginning. + llPlaySoundSlave will play the sound exactly once; if it is + desired to have the sound play every time the Master + loops, either use llLoopSoundSlave with extra silence padded + on the end of the sound or ensure that + llPlaySoundSlave is called at least once per loop of the Master. + + + llPointAt(vector pos); + + Make avatar that owns object point at pos. + + + llPow(float base, float exp); + + Returns baseraised to the exp. + + + llPreloadSound(string sound); + + Preloads sound from object inventory on nearby viewers. + + + llPushObject(key id, vector impulse, vector angular_impulse, integer local); + + Applies impulseand angular_impulseto object id. + + + llReleaseControls(key avatar); + + Stop taking inputs from avatar. + + + llRemoteLoadScript(key target, string name, integer running, integer param); + + If the owner of the object this script is attached can modify target + and the objects are in the same region, copy + script nameonto target, if running == TRUE, start the script with param. + If namealready exists on target, it is replaced. + + + llRemoveInventory(string inventory); + + Remve the name inventory item from the object inventory. + + + llRemoveVehicleFlags(integer flags); + + Sets the vehicle flagsto FALSE. Valid parameters can be found in the vehicle flags constants section. + + + key llRequestAgentData(key id, integer data); + + This function requests data about agent id. If and when the information + is collected, the dataserver event is + called with the returned key returned from this function passed in + the requested parameter. See the agent data + constants for details about valid values of dataand what each will + return in the dataserver event. + + + key llRequestInventoryData(string name); + + Requests data from object inventory item name. When data is available + the dataserver event will be raised with + the key returned from this function in the requested parameter. + The only request currently implemented is to + request data from landmarks, where the data returned is in the + form "<float, float, float>" which can be cast to a + vector. This position is in region local coordinates. + + + llRequestPermissions(key avatar, iteger perm); + + Ask avatar to allow the script to do perm. The permparameter should + be a permission constant. Multiple + permissions can be requested simultaneously by oring the + constants together. Many of the permissions requests + can only go to object owner. This call will not stop script + execution -if the specified avatar grants the requested + permissions, the run_time_permissions event will be called. + + + llResetScript(void); + + Resets this script. + + + llResetOtherScript(string name); + + Resets the script name. + + + llResetTime(void); + + Sets the internal timer to zero. + + + llRezObject(string inventory, vector pos, vector vel, rotation rot, integer param); + + Creates objects inventory object at position poswith velocity + veland rotation rot. The paramvalue + will be available to the newly created object in the on_rez + event or through the llGetStartParameter library + function. The velparameter is ignored if the rezzed object + is not physical. + + + float llRot2Angle(rotation rot); + + Returns the rotation angle represented by rot. + + + vector llRot2Axis(rotation rot); + + Returns the rotation axis represented by rot. + + + vector llRot2Euler(rotation rot); + + Returns the Euler Angle representation of rot. + + + vector llRot2Fwd(rotation rot); + + Returns the forward axis represented by rot. + + + vector llRot2Left(rotation rot); + + Returns the left axis represented by rot. + + + vector llRot2Up(rotation rot); + + Returns the up axis represented by rot. + + + rotation llRotBetween(vector a, vector b); + + Returns the rotation needed to rotate ato b. + + + llRotLookAt(rotation rot, float strength, float damping); + + Cause object to rotate to rot. Good strengthvalues are around + half the mass of the object and good + damping values are less than 1/10th of the strength. + Asymmetrical shapes require smaller damping.A + strengthof 0.0 cancels the look at. + + + integer llRotTarget(rotation rot, float error); + + Set object rotation within error of rotationas a rotational + target and return an integer number for the + target. The number can be used in llRotTargetRemove. + + + llRotTargetRemove(integer number); + + Remove rotational target number. + + + llRotateTexture(float radians, integer face); + + Sets the texture rotation of faceto radians. + If faceALL_SIDES, rotate the texture of all faces. + + + integer llRound(float val); + + returns valrounded to the nearest integer. + + + integer llSameGroup(key id); + + Returns TRUE if the object or agen id is in the same simulator + and has the same active group as this object. + Otherwise, returns FALSE. + + + llRegionSay(integer channel, string text); + + Says the string text on channel number channel that can be heard + anywhere in the region by a script listening on channel. + + Any integer value other than zero + + + Message to be transmitted + + + + llSay(integer channel, string text); + Say text on channel. + Channel 0 is the public chat channel that all + avatars see as chat text. Channels 1 to 2,147,483,648 are private + channels that are not sent to avatars but other scripts can listen + for through the llListen api. + + Channel to use to say text on + + Text to say + + + llScaleTexture(float horizontal, float vertical, integer side); + + Sets the horizontal and vertical repeats per face on side. + If side == ALL_SIDES, all sides are set in one call. + Negative values for horizontal and vertical will flip the texture. + + + integer llScriptDanger(vector pos); + + Returns true if pos is over public land, land that doesnt allow everyone + to edit and build, or land that doesnt allow outside scripts. + + + llSensor(string name, key id, integer type, float range, float arc); + + Performs a single scan for nameand id with typewithin + rangemeters and arcradians of forward vector. + Specifying a blank name or NULL_KEY id will not filter + results for any particular name or id A range of 0.0 + does not perform a scan. The typeparameter should be an + object type constant vlaue. + + + llSensorRemove(void); + + Removes the sensor. + + + llSensorRepeat(string name, key id, integer type, float range, float arc, float rate); + + Performs a repeating sensor scan for name and id with type + (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within range meters and arc + radians of forward vector (name and/or id can be empty or 0). + A range of 0.0m does perform a scan. The parameters have the same + function as llSensor, except rate, which defines the number of + seconds between repeated sensor or no_sensor event calls. + + + llSetAlpha(float alpha, integer face); + + Sets the alpha value for face. If face is ALL_SIDES, + set the alpha to all faces. The alphavalue is interpreted + as an opacity percentage -1.0 is fully opaque, and 0.2 is + mostly transparent. This api will clamp alphavalues + less 0.1 to .1 and greater than 1.0 to 1. + + + llSetBuoyancy(float buoyancy); + + Set the object buoyancy. A value of 0 is none, + less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. + + + llSetCameraAtOffset(vector offset); + + Sets the camera at offset used in this object + if an avatar sits on it. + + + llSetCameraEyeOffset(vector offset); + + Sets the camera eye offset used in this object if an avatar sits on it. + + + llSetColor(vector color, integer face); + + Sets the color of face. If face is ALL_SIDES, set the color to all faces. + + + llSetDamage(float damage); + + Sets the amount of damage that will be done to an object + that this object hits. This object will be destoyed on + damaging another object. + + + llSetForce(vector force, integer local); + + If the object is physical, this function sets the force. + The vector is in loal coordinates if local is TRUE, global if + FALSE. + + + llSetForceAndTorque(vector force, vector torque, integer local); + + If the object is physical, this function sets the forceand + torque. The vectors are in loal coordinates if local is + TRUE, global if FALSE. + + + llSetHoverHeight(float height, float water, float tau); + + Critically damps to a height. The height is above ground + and water if water is TRUE. + + + llSetLinkColor(integer linknumber, vector color, integer face); + + Sets the color of the linked child specified by linknumber. + A value of 0 means no link, 1 the root, 2 for first + child, etc. If linknumber is ALL_SIDES, set the color + of all objects in the linked set. If faceis + ALL_SIDES, set the color of all faces. + + + llSetObjectName(string name); + + Sets the object name to name. + + + llSetPos(vector pos); + + If the object is not physical, this function sets the position + in region coordinates. If the object is a child, the + position is treated as root relative and the linked set is adjusted. + + + llSetRot(rotation rot); + + If the object is not physical, this function sets the rotation. + If the object is a child, the position is treated as root + relative and the linked set is adjusted. + + + llSetScale(vector scale); + + Sets the object scale. + + + llSetScriptState(string name, integer run); + + Control the state of a script on the object. + + + llSetSitText(string text); + + Displays textrather than sit in viewer pie menu. + + + llSetSoundQueueing(integer queue); + + Sets whether successive calls to llPlaySound, llLoopSound, + etc., (attached sounds) interrupt the playing sound. + The default for objects is FALSE. Setting this value to + TRUE will make the sound wait until the current playing + sound reaches its end. The queue is one level deep. + + + llSetStatus(integer status, integer value); + + Sets the statusto value. Use status constants for the values of status. + + + llSetText(string text, vector color, float alpha); + + Sets text that floats above object to text, + using the specified color and alpha. + + + llSetTexture(string texture, integer face); + + Sets the texturefrom object inventory of face. + If face is ALL_SIDES, set the texture to all faces. + + + llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate); + + Animates a texture by setting the texture scale and offset. + The mode is a mask of texture animation constants. + You can only have one texture animation on an object, + calling llSetTextureAnim more than once on an object + will reset it. + You can only do one traditional animation, ROTATE or SCALE + at a time, you cannot combine masks. In the case + of ROTATE or SCALE, sizex and sizey are ignored, and startand + lengthare used as the start and + length values of the animation. For rotation, startand lengthare + in radians. + The facespecified which face to animate. If faceis ALL_SIDES, + all textures on the object are animated. + The sizex and sizey describe the layout of the frames within + the texture. sizex specifies how many + horizontal frames and sizey is how many vertical frames. + startis the frame number to begin the animation on. Frames + are numbered from left to right, top to bottom, + starting at 0. + lengthis the number of frames to animate. 0 means to animate + all frames after the start frame. + rateis the frame rate to animate at. 1.0 means 1 frame per + second, 10.0 means 10 frames per second, etc. + + + llSetTimerEvent(float sec); + + Sets the timer event to be triggered every secseconds. + Passing in 0.0 stops further timer events. + + + llSetTorque(vector torque, integer local); + + If the object is physical, this function sets the torque. + The vector is in loal coordinates if local is TRUE, global + if FALSE. + + + llSetTouchText(string text); + + Displays textin viewer pie menu that acts as a touch. + + + llSetVehicleFlags(integer flags); + + Sets the vehicle flagsto TRUE. + Valid parameters can be found in the vehicle flags constants section. + + + llSetVehicleFloatParam(integer param_name, float param_value); + + Sets the vehicle floating point parameter param_nameto param_value. + Valid parameters and their expected + values can be found in the vehicle parameter constants section. + + + llSetVehicleType(integer type); + + Activates the vehicle action and choose vehicle type. + Valid types and an explination of their characteristeics + can be found in the vehicle type constants section. + + + llSetVehicleRotationParam(integer param_name, rotation param_value); + + Sets the vehicle rotation parameter param_nameto param_value. + Valid parameters can be found in the + vehicle parameter constants section. + + + llSetVehicleVectorParam(integer param_name, vector param_value); + + Sets the vehicle vector parameter param_nameto param_value. + Valid parameters can be found in the + vehicle paramter constants section. + + + llShout(integer channel, string text); + + Shout texton channel. Channel 0 is the public chat channel that + all avatars see as chat text. Channels 1 to + 2,147,483,648 are private channels that are not sent to + avatars but other scripts can listen for through the llListen api. + + + float llSin(float theta); + + Returns the sine of thetain radians. + + + llSitTarget(vector offset, rotation rot); + + Set the sit location for this object. If offset == ZERO_VECTOR + clear the sit target. + + + llSleep(float sec); + + Puts the script to sleep for secseconds. + + + float llSqrt(float val); + + Returns the square root of val. If valis less than 0.0, + this function returns 0.0 and raises a math runtime error. + + + llStartAnimation(string anim); + + This function starts animation anim for the avatar that owns the object. + + + llStopAnimation(string anim); + + Stop animation animfor avatar that owns object. + + + llStopHover(void); + + Stop hover to a height. + + + llStopLookAt(void); + + Stop causing object to look at target. + + + llStopMoveToTarget(void); + + Stops critically damped motion. + + + llStopPointAt(void); + + Stop avatar that owns object pointing. + + + llStopSound(void); + + Stops a currently playing attached sound started with + llPlaySound or llLoopSound. Has no effect on sounds + started with llTriggerSound. + + + integer llStringLength(string src); + + Returns the number of characters in src. + + + integer llSubStringIndex(string source, string pattern); + + Finds index in source where pattern first appears. + Returns -1 if no match is found found. + + + llTakeControls(integer controls, integer accept, integer pass_on); + + If (accept== (controls and input)), send input to object. + If the boolean pass_onis TRUE, also send input + to avatar. + + + float llTan(float theta); + + Returns the tangent of thetaradians. + + + integer llTarget(vector position, float range); + + Set object position within rangeof positionas a target + and returns an integer ID for the target. + + + llTargetOmega(vector axis, float spinrate, float gain); + + Attempt to spin at spinratewith strength gainon axis. + A spinrateof 0.0 cancels the spin. This + function always works in object local coordinates. + + + llTargetRemove(integer tnumber); + + Remove target number tnumber. + + + llTeleportAgentHome(key id); + + Teleport agent on the owners land to agents home location. + + + string llToLower(string src); + + Returns src in all lower case. + + + string llToUpper(string src); + + Returns src in all upper case. + + + llTriggerSound(string sound, float volume); + + Plays a transient sound NOT attached to an object. + The sound plays from a stationary position located at the + center of the object at the time of the trigger. + There is no limit to the number of triggered sounds which can be + generated by an object, and calling llTriggerSound does not affect + the attached sounds created by llPlaySound + and llLoopSound. This is very useful for things like collision noises, + explosions, etc. There is no way to stop or + alter the volume of a sound triggered by this function. + + + llTriggerSoundLimited(string sound, float volume, vector tne, vector bsw); + + Plays a transient sound NOT attached to an object with its + audible range limited by the axis aligned bounding + box define by tne(top-north-eash) and bsw (bottom-south-west). + The sound plays from a stationary position + located at the center of the object at the time of the trigger. + There is no limit to the number of triggered sounds + which can be generated by an object, and calling llTriggerSound + does not affect the attached sounds created by + llPlaySound and llLoopSound. This is very useful for things + like collision noises, explosions, etc. There is no + way to stop or alter the volume of a sound triggered by this function. + + + llUnSit(key id); + + If agent identified by id is sitting on the object the script + is attached to or is over land owned by the objects + owner, the agent is forced to stand up. + + + float llVecDist(vector a, vector b); + + Returns the distance from ato b + + + float llVecMag(vector vec); + + Returns the magnitude of vec. + + + vector llVecNorm(vector vec); + + Returns normalized vec. + + + llVolumeDetect(integer detect); + + When detect = TRUE, this makes the entire link set the script + is attached to phantom but if another object + interpenetrates it, it will get a collision_start event. + When an object stops interpenetrating, a collision_end event + is generated. While the other is interpenetrating, + collision events are NOT generated. The script must be applied + to the root object of the link set to get the collision events. + Collision filters work normally. + + + float llWater(vector offset); + + Returns the water height at the object position + offset. + + + llWhisper(integer channel, string text); + + Whisper texton channel. Channel 0 is the public chat channel that + all avatars see as chat text. Channels 1 to 2,147,483,648 are + private channels that are not sent to avatars but other scripts + can listen for through the llListen api. + + + vector llWind(vector offset); + + Returns the wind velocity below the object position + offset. + + + llAddToLandBanList(key agent, float hours); + + Adds agent to the parcel ban list for the specified number of hours. + A value of 0 for hours will add agent indefinitely. + The smallest value hours will accept is 0.01; + anything smaller will be seen as 0. + When values that small are used, it seems the function bans + in 30 second increments (Probably 36 second increments, + as 0.01 of an hour is 36 seconds). + Residents teleporting to a parcel where they are banned + will be redirected to a neighboring parcel. + + + integer llBase64ToInteger(string str); + + Little endian decode the 8 character Base64 string str into an integer. + + + string llBase64ToString(string str); + + Converts a Base 64 string to a conventional string. + If the conversion creates any unprintable characters, they are converted to question marks (this behavior is different then llUnescapeURL). + + + llClearCameraParams(); + + Resets all camera parameters to default values and turns + off scripted camera control. + + + llCloseRemoteDataChannel(key channel); + + Closes XML-RPC channel. + + + integer llDetectedGroup(integer number); + + Returns TRUE if detected object or agent number has the same + user group active as this object. + It will return FALSE if the object or agent is in the group, + but the group is not active. + + + string llEscapeURL(string url); + + Returns the string that is the URL-escaped version of url + (replacing spaces with %20, etc). + This function returns the UTF-8 encoded escape codes + for selected characters. + + + llForceMouselook(integer mouselook); + + After calling this function with mouselook set to TRUE, + any agent sitting down on the prim will be forced into mouselook. + Just like llSitTarget, this changes a permanent property + of the prim (not the object) and needs to be reset by calling + this function with mouselook set to FALSE in order to disable it. + + + list llGetAnimationList(key id); + + Returns a list of keys of all playing animations for avatar id. + + + list llGetBoundingBox(key object); + + Returns the bounding box around the object or avatar with + the key object (including any linked prims) relative to the + root prim, in a list: [ (vector) min_corner, (vector) max_corner ] + + + vector llGetCameraPos(); + Returns the position of the camera of the user that granted the + script PERMISSION_TRACK_CAMERA. If no user has granted the permission, + it returns ZERO_VECTOR. + + + rotation llGetCameraRot(); + + Returns the rotation of the camera of the user who's granted + this script PERMISSION_TRACK_CAMERA. If no user has granted the + permission, it returns ZERO_ROTATION. The key of the user whose + camera is being tracked can be obtained using llGetPermissionsKey. + + + key llGetCreator(); + + Returns the key of the object's original creator. Similar to llGetOwner. + + + vector llGetGeometricCenter(); + + Returns the geometric center of the linked set the + script is in relative to the object's position + (the position of the root prim of a linked set). + To get the object's position, use llGetPos. + + + float llGetGMTclock(); + + Gets the time in seconds since midnight in GMT/UTC. + + + key llGetInventoryCreator(string item); + + This function returns the UUID of the creator of item. + If item is not found in inventory, + the object says "No item named 'name' ". + + + integer llGetInventoryPermMask(string item, integer mask); + + Returns the requested permission mask for the inventory + item defined by item. If item is not in the object's inventory, + llGetInventoryPermMask returns 0 and causes the object to + say "No item named '<item>'", where "<item>" is item. + If this is used to determine whether or not an inventory item + exists within the object, it will have the side effect of spamming chat. + inventory item + + MASK_BASE, MASK_OWNER,MASK_GROUP, MASK_EVERYONE or MASK_NEXT + + + + integer llGetInventoryType(string name); + + Returns the type of the inventory item name. + Remember, like the other inventory functions, llGetInventoryType + is case-sensitive. + + + float llGetMass(); + + Returns the scripted object's mass. When called from a script + in a linkset, the parent will return the sum of the linkset weights, + while a child will return just its own mass. When called from + a script inside an attachment, this function will return the mass + of the avatar it's attached to, not its own. + + + key llGetNumberOfNotecardLines(string name); + + Returns number of lines in the notecard name via the dataserver event. + (Cast the value returned by the dataserver to an integer.) + The key returned is a query id for identifying the dataserver reply. + + + integer llGetNumberOfPrims(); + + Returns the number of prims in (and avatars seated on) + the object the script is in. + + + string llGetObjectDesc(); + + Returns the description of the scripted object/prim. + You can set the description using llSetObjectDesc. + + + float llGetObjectMass(key id); + + Gets the mass of the object or avatar corresponding to id. + + + integer llGetObjectPermMask(integer mask); + + Returns the requested permission mask for the root object + the task is attached to. + + + + integer llGetParcelFlags(vector pos); + + Returns a bitfield specifying the parcel flags + (PARCEL_FLAG_*) for the parcel under the position pos. + + + list llGetPrimitiveParams(list params); + + Returns primitive parameters specified in the params list. + + + vector llGetRegionCorner(); + + Returns the RegionCorner of the simulator containing the task. + + + integer llGetRegionFlags(); + + Returns a bitfield specifying the region flags + (REGION_FLAG_*) for the region the object is in. + + + vector llGetRootPosition(); + + Gets the position (in region coordinates) + of the root/parent prim of the object containing the script. + This is used to allow a child prim to determine where the root is. + + + rotation llGetRootRotation(); + + Gets the global rotation of the root object of the + object script is attached to. + + + string llGetSimulatorHostname(); + + Returns the host name (server) of the sim + in which the scripted object is located. + For example, "sim225.agni.lindenlab.com". + + + string llGetTimestamp(); + + Returns the current time-and-date (a timestamp) + in the format YYYY-MM-DDThh:mm:ss.ff..fZ, + for example: 2004-08-27T00:56:21.785886Z + The letter Z stands for Zulu, + the military time zone name for UTC. T is just + a separator between date and time. + + + integer llGetUnixTime(); + + Returns the number of seconds elapsed since 00:00 hours, + Jan 1, 1970 UTC from the system clock. + In UNIX terms, time_t. This is great for a monotonic + source of time that ticks once a second. + + + key llHTTPRequest(string url, list parameters, string body); + + Sends HTTP request to url with the specified body and parameters. + + url must always be a valid HTTP or HTTPS URL, pointing to a + location outside the Linden Lab and Second Life servers. + + + string llIntegerToBase64(integer number); + + Encodes number as an 8-character Base64 string. + + + list llListReplaceList(list dest, list src, integer start, integer end); + + Returns a list replacing the slice of the list dest from + start to end with the list src. start and end are inclusive, + so 0, 1 would replace the first two entries + and 0, 0 would replace only the first list entry. + + + float llListStatistics(integer operation, list input); + + This function allows a script to perform a statistical + operation as defined by operation on a list composed + of integers and floats. + + One of LIST_STAT_* values + + + + llLoadURL(key avatar_id, string message, string url); + + llLoadURL displays a dialog box to the user offering + to load a web page using the default web browser. + + + float llLog(float val); + + Returns the base e (natural) logarithm of val (value). + + + float llLog10(float val); + + Returns the base 10 (common) logarithm of val (value). + + + llMapDestination(string simname, vector position, vector lookat); + + Shows a given location on the map. + Works in attachments, or during touch events. + Currently the function will open the map window whenever it is called. + There is no way to simply set the map position without + opening the window. + + + string llMD5String(string src, integer nonce); + + Performs a RSA Data Security, Inc. MD5 Message-Digest + Algorithm on string with nonce (also known as salt). + Returns a 32-character hex string. (128-bit in binary.) + + + integer llModPow(integer a, integer b, integer c); + + Returns a raised to the b power, mod c. ( (a ^ b)%c ). + b is capped at 0xFFFF (16 bits). + + + llOpenRemoteDataChannel(); + + Creates a channel to listen for XML-RPC calls. + Will trigger a remote_data event with type = REMOTE_DATA_CHANNEL + and a channel ID (key) once it is available. + This channel ID must be referenced in the XML-RPC call + to the script (from the outside internet)-- + so the key must somehow get to the scripter's XML-RPC client, + most often via llEmail, llHttpRequest or llLoadUrl. + + + llOwnerSay(string message); + + Says message to only the owner of the object running the script + if the owner has been within the object's simulator since + logging into Second Life, regardless of where they may be are in-world. + + + llParcelMediaCommandList(list command_list); + + Playing QuickTime movies (you have to own the land). + + + list llParcelMediaQuery(list query_list); + + Queries the texture and/or URL for QuickTime-playable + video on the land parcel. + This function will only work if the script is contained + within an object owned by the landowner (or if the land + is owned by a group, only if the object has been deeded + to the group). It will not work for group land if the + object owner is a member of the group. The object + actually has to be owned by the group. + + + list llParseStringKeepNulls(string src, list separators, list spacers); + + llParseStringKeepNulls works almost exactly the same as + llParseString2List, except that if a null is found + it will add a null string instead of discarding it + like llParseString2List does. + + + llReleaseCamera(key agent); + + A FollowCam function that returns the camera to the + key agent after permission to change it with + llSetCameraParams has been granted via + llRequestPermissions(agent_key, PERMISSION_CONTROL_CAMERA). + + + llRemoteDataReply(key channel, key message_id, string sdata, integer idata); + + Send an XML-RPC reply to the request with message_id + on channel with payload of string sdata and integer idata. + The size of sdata is limited to 254 characters. + + + llRemoteDataSetRegion(); + + does not work! + + + llRemoteLoadScriptPin(key target, string name, integer pin, integer running, integer start_param); + + If the owner of the object containing this script can modify + the object identified by the key target, and if the pin matches + the PIN previously set using llSetRemoteScriptAccessPin + (on the target prim), then the script name will be copied into target. + + + llRemoveFromLandBanList(key avatar); + + Remove avatar from the land parcel ban list. + + + llRemoveFromLandPassList(key avatar); + + Remove avatar from the land parcel pass list. + + + + llResetLandBanList(void) + + Removes all residents from the land ban list. + + + + llResetLandPassList(void) + + Removes all residents from the land access/pass list. + + + + key llRequestSimulatorData(string simulator, integer data); + + Requests data about the sim with the name simulator. + simulator is case-insensitive. + Returns a dataserver query ID and triggers the dataserver + event when data is found. The sim name is usually not case-sensitive, + but sometimes will return data for a similarly-named sim + if the supplied case doesn't match the intended sim's actual name. + + + llRezAtRoot(string inventory, vector pos, vector vel, rotation rot, integer param); + + Rezzes object's inventory item named inventory at + pos with velocity vel and rotation rot with start parameter param. + + + key llSendRemoteData(key channel, string dest, integer idata, string sdata); + + Send an XML-RPC request to dest (probably an URL) + through channel with payload of channel (in a string), + integer idata and string sdata. + + + llSetCameraParams(list rules); + + Sets multiple camera parameters at once. + List format is [rule1, value1, rule2, value2 . . . ruleN, valueN] + + + llSetLinkAlpha(integer linknumber, float alpha, integer face); + + Sets the side number face on the linked child linknumber + to the transparency alpha. + + + llSetLocalRot(rotation rot); + + Sets the rotation of a child prim relative to the root prim. + + + llSetObjectDesc(string name); + + Sets the description of the scripted prim to name. + You can get the description using llGetObjectDesc. + The description is limited to 127 characters. + + + llSetParcelMusicURL(string url) + + Sets the streaming audio URL for the parcel the + scripted object is on (the object must be owned + by the owner of the parcel, if the parcel is group + owned the object must be owned by that group). + + + llSetPayPrice(integer price, list quick_pay_buttons); + + Sets the values of the buttons and the text box default + for the Pay dialog -- when a user right-clicks on + the object and selects "Pay", llSetPayPrice will affect + what buttons exist, what their values are, and whether + or not there is a manual payment text entry box. + + + llSetPrimitiveParams(list rule); + + This function changes the many properties (or "parameters") + of a prim in one operation. The parameter is a list of changes. + (Don't confuse prim parameters with function parameters.) + + + llSetRemoteScriptAccessPin(integer pin); + + If pin is set to a non-zero number, the task will accept + remote script loads via llRemoteLoadScriptPin + if passed the matching PIN. + Otherwise llRemoteLoadScriptPin is ignored + + + string llStringToBase64(string str); + + Converts a string to the Base 64 representation of the string. + + + string llUnescapeURL(string url); + + Returns the string that is the URL unescaped version + of url, replacing "%20" with spaces, etc. + The function can output raw UTF-8 strings. + + + string llXorBase64StringsCorrect(string s1, string s2) + + Performs an xor on two Base64 strings and returns a Base64 string. + s2 repeats if it is shorter than s1. + This function is for encrypting data. Put your data in s1 and + your key in s2 to encrypt or put the encrypted data into s1 + with the same key in s2 to decrypt again. + + + llSetInventoryPermMask(string item, integer mask, integer value); + + Sets the given permission mask to the new value on the inventory item. + + + llSetObjectPermMask(integer mask, integer value); + + Sets the given permission mask to the new value on the root object + the task is attached to. + + + llSetSoundRadius(float radius); + + Establishes a hard cut-off radius for audibility of scripted + sounds (both attached and triggered) + + + llTakeCamera(key avatar); + + Move avatar's viewpoint to task + + + list llGetObjectDetails(key id, list params); + + Returns a list of the details specified in params for the object with key id. + + prim or avatar UUID that is in the same region + + + list of OBJECT_* flags + + + + + llSetClickAction(integer action); + + Sets the action performed when a prim is clicked upon. + + a CLICK_ACTION_* flag + + + + + integer llGetRegionAgentCount(); + + Returns an integer that is the number of avatars in the region. + + + + llTextBox( key avatar, string message, integer chat_channel ); + + *** Pre-release Documentation Warning *** + Shows a dialog box on avatar's screen with the text message. + It contains a text box for input, any text that is entered + is said on chat_channel when the "OK" button is clicked. + + + + string llGetAgentLanguage( key avatar ); + + Returns a string that is the language code of the preferred + interface language of the user avatar. + + + + vector llDetectedTouchUV( integer index ); + + Returns a vector that is the texture coordinates for where + the prim was touched. The x and y vector positions contain + the u and v face coordinates respectively. + + TOUCH_INVALID_TEXCOORD is returned + when the touch UV coordinates cannot be determined. + + Index of detection information + + + + + integer llDetectedTouchFace( integer index ); + + Returns an integer that is the index of the face the avatar clicked on. + + Index of detection information + + + + + vector llDetectedTouchPos( integer index ); + + Returns a vector that is the position where the object + was touched in region coordinates, unless it is attached to + the HUD, in which case it returns the position relative + to the attach point. + + Index of detection information + + + + + vector llDetectedTouchNormal( integer index ); + + Returns a vector that is the surface normal + (perpendicular to the surface) where the touch event was triggered. + + Index of detection information + + + + + vector llDetectedTouchBinormal( integer index ); + + Returns a vector that is the surface binormal + (tangent to the surface) where the touch event was triggered. + + Index of detection information + + + + + vector llDetectedTouchST( integer index ); + + Returns a vector that is the surface coordinates for where the prim was touched. + The x and y vector positions contain the horizontal (s) and vertical (t) face + coordinates respectively. + Each component is in the interval [0.0, 1.0]. + + TOUCH_INVALID_TEXCOORD is returned when the surface coordinates cannot be determined. + + Index of detection information + + + + + string llSHA1String( string src ); + + *** Pre-release Documentation Warning *** + Returns a string of 40 hex characters that is the SHA1 security hash of src. + + + + integer llGetFreeURLs( ); + + + key llRequestURL( ); + + + key llRequestSecureURL( ); + + + llReleaseURL( string url ); + + + llHTTPResponse( key request_id, integer status, string body ); + + + llHTTPResponse( key request_id, integer status, string body ); + + + + + Every state must have at least one handler. You can choose to + handle an event by defining one of the the reserved + event handlers named here. + + at_target(integer tnum, vector targetpos, vector ourpos); + + This event handler is triggered when the scripted object comes within + a defined range of the target position targetpos + (defined by the llTarget function call). + + + + at_rot_target(integer number, rotation target_rotation, rotation our_rotation); + + This event is triggered when a script comes within a defined + angle of a target rotation. The range is set by a call + to llRotTarget. + + + + not_at_rot_target(void); + + When a target is set via the llRotTarget library call, + but the script is outside the specified angle this event is raised. + + + + not_at_target(void); + + When a target is set via the llTarget library call, + but the script is outside the specified range this event is raised. + + + attach(key attached); + + This event is triggered whenever a object with this script is + attached or detached from an avatar. If it is attached, + attached is the key of the avatar it is attached to, otherwise + attached is NULL_KEY. + + + changed(integer change); + + Triggered when various events change the object. The change + argument will be a bitfield of change constants. + + + collision(integer total_number); + + This event is raised while another object is colliding with + the object the script is attached to. The number of + detected objects is passed to the script. Information on + those objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + collision_end(integer total_number); + + This event is raised when another object stops colliding with + the object the script is attached to. The number of + detected objects is passed to the script. Information on those + objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + collision_start(integer total_number); + + This event is raised when another object begins to collide with + the object the script is attached to. The number of + detected objects is passed to the script. Information on + those objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + control(key name, integer levels, integer edges); + + Once a script has the ability to grab control inputs from the avatar, + this event will be used to pass the commands + into the script. The levelsand edgesare bitfields + of control constsants. + + + dataserver(key requested, string data); + + This event is triggered when the requested data is returned + to the script. Data may be requested by the + llRequestAgentData, the llRequestInventoryData, + and the llGetNotecardLine function calls. + + + email(string time, string address, string subject, string body, integer remaining); + + This event is triggered when an email sent to this script arrives. + The remaining tells how many more emails are known as still pending. + + + land_collision(vector position); + + This event is raised when the object the script is attached + to is colliding with the ground. + + + land_collision_end(vector position); + + This event is raised when the object the script is attached + to stops colliding with the ground. + + + land_collision_start(vector position); + + This event is raised when the object the script is attached + to begins to collide with the ground. + + + link_message(integer sender_number, integer number, string message, key id); + + Triggered when object receives a link message via llMessageLinked + library function call. + + + listen(integer channel, string name, key id, string message); + + This event is raised whenever a chat message matching the + constraints passed in the llListen command is heard. + The nameand id of the speaker as well as the messageare passed + in as parameters. Channel 0 is the public + chat channel that all avatars see as chat text. + Channels 1 through 2,147,483,648 are private channels that are not + sent to avatars but other scripts can listen on those channels. + + + money(key giver, integer amount); + + This event is triggered when user giver has given an amount + of Linden dollars to the object. + + + moving_end(void); + + Triggered whenever a object with this script stops moving. + + + moving_start(void); + + Triggered whenever a object with this script starts moving. + + + no_sensor(void); + + This event is raised when sensors are active + (via the llSensor library call) but are not sensing anything. + + + + object_rez(key id); + + Triggered when object rez-es in another object from its + inventory via the llRezObject api. The id is the globally + unique key for the object. + + + on_rez(integer start_param); + + Triggered whenever a object is rez-ed from inventory + or by another object. The start_paramis the parameter + passed in from the call to llRezObject. + + + run_time_permissions(integer permissions); + + Scripts need permission from either the owner or the avatar + they wish to act on before they perform certain + functions, such as debiting money from their owners account, + triggering an animation on an avatar, or capturing + control inputs. The llRequestPermissions library + function is used to request these permissions and the various + permissions integer constants can be supplied. + The integer returned to this event handler contains the current set + of permissions flags, so if permissionseqal 0 then no permissions are set. + + + sensor(integer total_number); + + This event is raised whenever objects matching the constraints + of the llSensor command are detected. + The number of detected objects is passed to the script + in the total_number parameter. Information on those + objects may be gathered via the llDetected* library functions. + + + state_entry(void); + + The state_entry event occurs whenever a new state is entered, + including program start, and is always the first event handled. + + + state_exit(void); + + The state_exit event occurs whenever the state command + is used to transition to another state. It is handled + before the new states state_entry event. + + + timer(void); + + This event is raised at regular intervals set by the + llSetTimerEvent library function. + + + touch(integer total_number); + + This event is raised while a user is touching the object + the script is attached to. The number of touching objects is + passed to the script in the total_number parameter. + Information on those objects may be gathered via the + llDetected* library functions. + + + touch_end(integer total_number); + + This event is raised when a user stops touching the object + the script is attached to. The number of touching + objects is passed to the script in the total_number parameter. + Information on those objects may be gathered + via the llDetected* library functions. + + + touch_start(integer total_number); + + This event is raised when a user first touches the object the script is + attached to. The number of touching objects is passed to the script in + the total_number parameter. Information on those objects may be gathered + via the llDetected() library functions. + + + http_response(key request_id, integer status, list metadata, string body); + + This event handler is invoked when an HTTP response is received for + a pending llHTTPRequest request or if a pending request fails or times out. + + + remote_data(integer event_type, key channel, key message_id, string sender, integer idata, string sdata); + + Triggered by various XML-RPC calls with event_type specifying the type of data. + + + + To ease scripting, many useful constants are defined by LSL. + + The boolean constants represent the values for TRUE and FALSE. + LSL represents booleans as integer values 1 + and 0 respectively. Since there is no boolean type these + constants act as a scripting aid usually employed for + testing variables which conceptually represent boolean values. + + An integer constant for boolean comparisons. Has the value '1'. + + + An integer constant for boolean comparisons. Has the value '0'. + + + + The status constants are used in the llSetStatus and llGetStatus + library calls. These constants can be bitwise ored + together when calling the library functions to set the same + value to more than one status flag + Status Constants + + Controls whether the object moves physically. + This controls the same flag that the ui checkbox for + Physical controls. The default is FALSE. + + + Controls whether the object collides or not. + Setting the value to TRUE makes the object non-colliding with + all objects. It is a good idea to use this for most objects + that move or rotate, but are non-physical. It is also + useful for simulating volumetric lighting. The default is FALSE. + + + + + Controls whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + + Controls whether the object can be grabbed. + A grab is the default action when in third person, and is + available as the hand tool in build mode. + This is useful for physical objects that you dont want other + people to be able to trivially disturb. + The default if FALSE + + + Controls whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + + Controls whether the object is returned to the owners + inventory if it wanders off the edge of the world. It is + useful to set this status TRUE for things like bullets + or rockets. The default is TRUE + + + + These constants can be combined using the binary | operator + and are used in the llSensor and related calls. + Object Type Constants + + Objects in world that are agents. + + + Objects in world that are running a script or + currently pysically moving. + + + Static in-world objects. + + + Scripted in-world objects. + + + + The permission constants are used for passing values + to llRequestPermissions, determing the value of + llGetPermissions, and explicitly passed to the + run_time_permissions event. For many of the basic library + functions to work, a specific permission must be enabled. + The permission constants can be ored together to be + used in conjunction. + + Permission Constants + + If this permission is enabled, the object can successfully + call llGiveMoney to debit the owners account. + + + If this permission enabled, the object can successfully + call the llTakeControls libray call. + + + (not yet implemented) + + + If this permission is enabled, the object can successfully + call llStartAnimation for the avatar that owns this + object. + + + If this permission is enabled, the object can successfully + call llAttachToAvatar to attach to the given avatar. + + + (not yet implemented) + + + If this permission is enabled, the object can successfully + call llCreateLink, llBreakLink, and + llBreakAllLinks to change links to other objects. + + + (not yet implemented) + + + (not yet implemented) + + + + These constants can be used to refer to a specific inventory + type in calls to llGetInventoryNumber + andllGetInventoryName. + Inventory Constants + + + + + + + + + Each constant refers to the named type of inventory. + + + + These constants are used to refer to attachment points + in calls to llAttachToAvatar. + Attachment Constants + + Attach to the avatar chest. + + + Attach to the avatar head. + + + Attach to the avatar left shoulder. + + + Attach to the avatar right shoulder. + + + Attach to the avatar left hand. + + + Attach to the avatar right hand. + + + Attach to the avatar left foot. + + + Attach to the avatar right foot. + + + Attach to the avatar back. + + + Attach to the avatar pelvis. + + + Attach to the avatar mouth. + + + Attach to the avatar chin. + + + Attach to the avatar left ear. + + + Attach to the avatar right ear. + + + Attach to the avatar left eye. + + + Attach to the avatar right eye. + + + Attach to the avatar nose. + + + Attach to the avatar right upper arm. + + + Attach to the avatar right lower arm. + + + Attach to the avatar left upper arm. + + + Attach to the avatar left lower arm. + + + Attach to the avatar right hip. + + + Attach to the avatar right upper leg. + + + Attach to the avatar right lower leg. + + + Attach to the avatar left hip. + + + Attach to the avatar lower upper leg. + + + Attach to the avatar lower left leg. + + + Attach to the avatar belly. + + + Attach to the avatar right pectoral. (depreciated) + + + Attach to the avatar left pectoral. (depreciated) + + + + + + + + + + + + + These constants are only used in calls to llModifyLand. + The constants are equivalent to the similarly labelled + user interface elements for editing land in the viewer. + Land Constants + + Action to level the land. + + + Action to raise the land. + + + Action to lower the land. + + + Use a small brush size. + + + Use a medium brush size. + + + Use a large brush size. + + + + These constants are used in calls to llSetLinkColor and + llMessageLinked. + + Link Constants + + This targets every object in the linked set. + + + This targets the root of the linked set. + + + This targets every object in the linked set except + the object with the script. + + + This targets every object except the root in the linked set. + + + + These constants are used in llTakeControls as well + as the control event handler. + Control Constants + + Test for the avatar move forward control. + + + Test for the avatar move back control. + + + Test for the avatar move left control. + + + Test for the avatar move right control. + + + Test for the avatar rotate left control. + + + Test for the avatar rotate right control. + + + Test for the avatar move up control. + + + Test for the avatar move down control. + + + Test for the avatar left button control. + + + Test for the avatar left button control while in mouse look. + + + + These constants are used in the changed event handler. + Change Constants + + The object inventory has changed. + + + The object inventory has changed because an item was + added through the llAllowInventoryDrop interface. + + + The object color has changed. + + + The object shape has changed, eg, a box to a cylinder + + + The object scale has changed. + + + The texture offset, scale rotation, or simply the object + texture has changed. + + + The object has linked or its links were broken. + + + + These constants are used to determine the variable type + stored in a heterogenous list. The value returned from + llGetListEntryType can be used for comparison against + these constants. + Type Constants + + The list entry is an integer. + + + The list entry is a float. + + + The list entry is a string. + + + The list entry is a key. + + + The list entry is a vector. + + + The list entry is a rotation. + + + The list entry is invalid. + + + + Each of these constants represents a bit in the integer + returned from the llGetAgentInfo function and can be used + in an expression to determine the specified information + about an agent. + Agent Info Constants + + The agent is flying. + + + The agent has attachments. + + + The agent has scripted attachments. + + + + These constants are used in the llSetTextureAnim api to + control the animation mode. + Texture Animation Constants + + Texture animation is on. + + + Loop the texture animation. + + + Play animation in reverse direction. + + + play animation going forwards, then backwards. + + + slide in the X direction, instead of playing separate frames. + + + Animate texture rotation. + + + Animate the texture scale. + + + + These constants are used in calls to the llParticleSystem + api to specify parameters. + Particle System Parameters + + Each particle that is emitted by the particle system is + simulated based on the following flags. To use + multiple flags, bitwise or (|) them together. + PSYS_PART_FLAGS Values + + + Interpolate both the color and alpha from the start + value to the end value. + + + Interpolate the particle scale from the start value + to the end value. + + + Particles have their velocity damped towards the wind velocity. + + + Particles bounce off of a plane at the objects Z height. + + + The particle position is relative to the source objects position. + + + The particle orientation is rotated so the vertical + axis faces towards the particle velocity. + + + The particle heads towards the location of the target + object as defined by PSYS_SRC_TARGET_KEY. + + + The particle glows. + + + (not implemented) + + + (not implemented) + + + (not implemented) + + + The pattern which is used to generate particles. + Use one of the following values: + PSYS_SRC_PATTERN Values + + + Drop particles at the source position. + + + Shoot particles out in all directions, + using the burst parameters. + + + Shoot particles across a 2 dimensional area defined + by the arc created from + PSYS_SRC_OUTERANGLE. + There will be an open area defined by PSYS_SRC_INNERANGLE + within the larger arc. + + + Shoot particles out in a 3 dimensional cone with + an outer arc of PSYS_SRC_OUTERANGLE and an + inner open area defined by PSYS_SRC_INNERANGLE. + + + a vector <r,g,b> which determines the starting + color of the object. + + + a float which determines the starting alpha of the object. + + + a vector <r, g, b> which determines the ending + color of the object. + + + a float which determines the ending alpha of the object. + + + a vector <sx, sy, z>, + which is the starting size of the particle billboard + in meters (z is ignored). + + + a vector <sx, sy, z>, which is the ending + size of the particle billboard in meters (z is ignored). + + + age in seconds of a particle at which it dies. + + + a vector <x, y, z> which is the acceleration + to apply on particles. + + + an asset name for the texture to use for the particles. + + + how often to release a particle burst (float seconds). + + + specifies the inner angle of the arc created + by the PSYS_PART_SRC_PATTERN_ANGLE or + PSYS_PART_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will not have particles + in it.. + + + specifies the outer angle of the arc created + by the PSYS_PART_SRC_PATTERN_ANGLE or + PSYS_PART_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle + will be filled with particles.. + + + how many particles to release in a burst. + + + what distance from the center of the object + to create the particles. + + + minimum speed that a particle should be moving. + + + maximum speed that a particle should be moving. + + + how long this particle system should last, + 0.0 menas forever. + + + the key of a target object to move towards + if PSYS_PART_TARGET_POS_MASK is enabled. + + + Sets the angular velocity to rotate the axis + that SRC_PATTERN_ANGLE and + SRC_PATTERN_ANGLE_CONE use.. + + + + These constants are used in calls to the + llRequestAgentData api to collect information about + an agent which will + be provided in the dataserver event. + Texture Animation Constants + + "1" for online "0" for offline. + + + The name of the agent. + + + The date the agent was born returned in ISO 8601 format of YYYY-MM-DD. + + + Returns the agent ratings as a comma separated string + of six integers. They are: + + 1. Positive rated behavior + 2. Negative rated behavior + 3. Positive rated appearance + 4. Negative rated appearance + 5. Positive rated building + 6. Negative rated building + + + + LSL provides a small collection of floating point + constants for use in float arithmetic. + These constants are usually + employed while performing trigonometric calculations, + but are sometimes useful for other applications such as + specifying arc radians to sensor or particle system functions. + Float Constants + + 3.14159265 - The radians of a hemicircle. + + + 6.28318530 - The radians of a circle. + + + 1.57079633 - The radians of a quarter circle. + + + 0.01745329 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying + the degrees by this number. + + + 57.2957795 - Number of degrees per radian. + You can use this number to convert radians to degrees by + multiplying the radians by this number. + + + 1.41421356 - The square root of 2. + + + + There is only one key constant which acts as an invalid key: NULL_KEY. + + + There is one uncategorized integer constant + which is used in some of the texturing and coloring api: ALL_SIDES + + + There is one uncategorized string constant + which is used in the dataserver event: EOF + + + There is only one vector constant which + acts as a zero vector: ZERO_VECTOR = <0,0,0>. + + + There is only one rotation constant + which acts as a zero rotation: ZERO_ROTATION = <0,0,0,1>. + + + Parameters + + A vector of timescales for exponential + decay of the vehicles linear velocity along its preferred axes of + motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + + A vector of timescales for exponential + decay of the vehicles angular velocity about its preferred axes of + motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + + The direction and magnitude (in preferred frame) + of the vehicles linear motor. The vehicle will accelerate + (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + + The timescale for exponential approach to full linear motor velocity. + + + The timescale for exponential decay of the linear motors magnitude. + + + The direction and magnitude (in preferred frame) + of the vehicles angular motor.The vehicle will accelerate + (or decelerate if necessary) to match its velocity to its motor. + + + The timescale for exponential approach to full angular motor velocity. + + + The timescale for exponential decay of the angular motors magnitude. + + + The height (above the terrain or water, or global) + at which the vehicle will try to hover. + + + A slider between minimum (0.0 = bouncy) + and maximum (1.0 = fast as possible) damped motion of the + hover behavior. + + + The period of bounce (or timescale of exponential approach, + depending on the hover efficiency) for the + vehicle to hover to the proper height. + + + A slider between minimum (0.0) and maximum anti-gravity (1.0). + + + A slider between minimum (0.0) and maximum (1.0) + deflection of linear velocity. That is, its a simple + scalar for modulating the strength of linear deflection. + + + The timescale for exponential success of linear + deflection deflection. It is another way to specify how much + time it takes for the vehicles linear velocity + to be redirected to its preferred axis of motion. + + + A slider between minimum (0.0) and maximum (1.0) + deflection of angular orientation. That is, its a simple + scalar for modulating the strength of angular + deflection such that the vehicles preferred axis of motion + points toward its real velocity. + + + The timescale for exponential success of linear + deflection deflection. Its another way to specify the strength + of the vehicles tendency to reorient itself so + that its preferred axis of motion agrees with its true velocity. + + + A slider between minimum (0.0 = wobbly) and + maximum (1.0 = firm as possible) stability of the vehicle to + keep itself upright. + + + The period of wobble, or timescale for + exponential approach, of the vehicle to rotate such that its preferred + "up" axis is oriented along the worlds "up" axis. + + + A slider between anti (-1.0), none (0.0), + and maxmum (1.0) banking strength. + + + A slider between static (0.0) and dynamic (1.0) + banking. "Static" means the banking scales only with the + angle of roll, whereas "dynamic" is a term + that also scales with the vehicles linear speed. + + + The timescale for banking to exponentially + approach its maximum effect. This is another way to scale the + strength of the banking effect, however it affects the + term that is proportional to the difference between what + the banking behavior is trying to do, and what the + vehicle is actually doing. + + + A rotation of the vehicles preferred axes of + motion and orientation (at, left, up) with respect to the vehicles + local frame (x, y, z). + + + + Flags + + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + + + This flag prevents linear deflection parallel to world z-axis. + This is useful for preventing ground vehicles + with large linear deflection, like bumper cars, + from climbing their linear deflection into the sky. + + + For vehicles with vertical attractor + that want to be able to climb/dive, for instance, + airplanes that want to use the banking feature. + + + Ignore terrain height when hovering. + + + Ignore water height when hovering. + + + Hover at global height. + + + Hover doesnt push down. Use this flag for hovering vehicles + that should be able to jump above their hover + height. + + + Prevents ground vehicles from motoring into the sky. + + + + Types + + Simple vehicle that bumps along the ground, + and likes to move along its local x-axis. + // most friction for left-right, least for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <30, 1, 1000> ); + // no angular friction + llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> ); + // no linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 120 ); + // no agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 120 ); + // no hover (but with timescale of 10 sec if enabled) + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 10 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // maximum linear deflection with timescale of 1 second + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 1 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 ); + // no vertical attractor (doesnt mind flipping over) + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 ); + // no banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 10 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY ); + // set these flags (the limit_roll flag will have no effect + // until banking is enabled, if ever) + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Another vehicle that bounces along the ground but needs + the motors to be driven from external controls or + timer events. + // most friction for left-right, least for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <100, 2, 1000> ); + // no angular friction + llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> ); + // linear motor wins after about a second, decays after about a minute + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor wins after a second, decays in less time than that + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.8 ); + // no hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // maximum linear deflection with timescale of 2 seconds + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 2 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 ); + // critically damped vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 10 ); + // weak negative critically damped banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.2 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Hovers over water with lots of friction and some anglar deflection. + // least for forward-back, most friction for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <10, 3, 2> ); + // uniform angular friction (setting it as a scalar rather than a vector) + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 ); + // linear motor wins after about five seconds, decays after about a minute + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor wins after four seconds, decays in same amount of time + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 4 ); + // hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 2.0 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 ); + // halfway linear deflection with timescale of 3 seconds + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 3 ); + // angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 ); + // somewhat bounscy vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 5 ); + // weak negative damped banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.3 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.8 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Uses linear deflection for lift, no hover, and banking to turn. + // very little friction along forward-back axis + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <200, 10, 5> ); + // uniform angular friction + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 20 ); + // linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 2 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 8 ); + // no hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // linear deflection + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.5 ); + // angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 1.0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 2.0 ); + // vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.9 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 2 ); + // banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 2 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_LIMIT_ROLL_ONLY ); + + + Hover, and friction, but no deflection. + // uniform linear friction + llSetVehicleFloatParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, 5 ); + // uniform angular friction + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 ); + // linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 6 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 10 ); + // hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.8 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 ); + // no linear deflection + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 5 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 ); + // no vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 ); + // no banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 5 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove all flags + llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DEBUG_CHANNEL is an integer constant that, when passed to + llSay, llWhisper, or llShout as a channel parameter, + will print text to the Script Warning/Error Window. + It has the value '2147483647'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use this to get or set the parcel media MIME type (e.g. "text/html"). + + + Use this to get or set the parcel media pixel resolution. + + + Use this to get or set the parcel media description. + + + Used to get or set the parcel's media looping variable. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PRIM_GLOW is used to get or set the glow status of the face. + + + + + Area in radians specifying where particles + will NOT be created (for ANGLE patterns) + + + Area in radians filled with particles + (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, + acts as PSYS_SRC_ANGLE_BEGIN itself, + and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END) + + + + + + + + PUBLIC_CHANNEL is an integer constant that, when passed to + llSay, llWhisper, or llShout as a channel parameter, + will print text to the publicly heard chat channel. Has the value '0'. + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the object's name. + + + Gets the object's description. + If id is an avatar, an empty string is returned. + + + Gets the object's position in region coordinates. + + + Gets the object's rotation. + + + Gets the object's velocity. + + + Gets an object's owner's key. + If id is group owned, a NULL_KEY is returned. + + + Gets the prims's group key. + If id is an avatar, a NULL_KEY is returned. + + + Gets the object's creator key. + If id is an avatar, a NULL_KEY is returned. + + + + Performs the default action: when the prim is touched, touch events are triggered" + + + When the prim is touched, touch events are triggered" + + + When the prim is touched, the avatar sits upon it + + + When the prim is touched, the buy dialog is opened + + + When the prim is touched, the pay dialog is opened + + + When the prim is touched, the object inventory dialog is opened + + + When the prim is touched, html-on-a-prim is enabled? + + + When the prim is touched, the web media dialog is opened" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resource/ReleaseNotes.htm b/Resource/ReleaseNotes.htm new file mode 100644 index 0000000..14a0184 --- /dev/null +++ b/Resource/ReleaseNotes.htm @@ -0,0 +1,1382 @@ +
+ +

Release 2.40

+ +

April 17 2010 14:51 (local time)
+ - Added: stub functions for: +

    +
  • llGetFreeURLs
  • +
  • llRequestURL
  • +
  • llRequestSecureURL
  • +
  • llReleaseURL
  • +
  • llHTTPResponse
  • +
  • llGetHTTPHeader
  • +
+
+

+ +

Release 2.39

+ +

October 28 2008 11:28 (local time)
+ - Added: stub functions for: +

    +
  • llTextBox
  • +
  • llGetAgentLanguage
  • +
  • llDetectedTouchUV
  • +
  • llDetectedTouchFace
  • +
  • llDetectedTouchPos
  • +
  • llDetectedTouchNormal
  • +
  • llDetectedTouchBinormal
  • +
  • llDetectedTouchST
  • +
  • llSHA1String
  • +
+
+

+ +

Release 2.38

+ +

July 28 2008 14:10 (local time)

+ - Changed: Key cache file changed, so did lsleditor (??? who made the xml file, it uses siblings, not parent-child relations????)
+

+ +

Summer break ;-)

+ +

May 18 2008 18:37 (local time)

+ - Changed: Ctrl-Shft-A uses 4-spaces intdent when (auto)pasting in SL
+

+ +

May 13 2008 13:21 (local time)

+ - Changed: Adding duplicate items in solution explorer starts numbering at 1
+ - Fixed: focus when switching tabs
+ - Fixed: Save All (Ctrl Shft S), does not save Solution
+

+ +

Release 2.37

+ +

May 2 2008 19:00 (local time)

+ - Added: PRIM_GLOW
+ - Added: llSetClickAction (and constants)
+ - Fixed: & in dialogue box
+ - Fixed: Permission dialogue box text messed up when the script name is too long
+

+ +

Release 2.36

+ +

Apr 3 2008 12:47 (local time)

+ - Fixed: llAbs throws error on large numbers
+

+ +

Mar 28 2008 12:47 (local time)

+ - Fixed: llListen should also listen when using "" keys
+ - Added: Basic authentication to llHTTPRequest, eg. http: //userid:password@domain.name/path
+ - Added: llEmail shows error responses from smtp server when in error
+

+ +

Mar 27 2008 13:33 (local time)

+ - Added (experimental): 'Ctrl Shift A' pastes active LSLEditor script to SecondLife (has to open script editor in SL first)
+

+ +

Mar 21 2008 12:12 (local time)

+ - Fixed: Shift Home crashes editor when nothing is selected
+

+ +

Release 2.35

+ +

Mar 16 2008 15:22 (local time)

+ - Added: llGetParcelDetails (see also menu - tools - options - debugging internal)
+ - Added: Alt-Backspace alternative for Ctrl-Z
+ - Fixed: Some focus issue on the find window
+ - Added: PARCEL_MEDIA_COMMAND_TYPE, PARCEL_MEDIA_COMMAND_SIZE, PARCEL_MEDIA_COMMAND_DESC, PARCEL_MEDIA_COMMAND_LOOP_SET
+ - Added: Contact item on menu Help
+ - Removed: some compression code
+

+ +

Feb 29 2008 12:40 (local time)

+ - Fixed: NULL_KEY was no key
+

+ +

Release 2.34

+ +

Feb 23 2008 19:45 (local time)

+

+ - Added: First generic plugin support
+ - Added: integer multiply operator for float operand
+ - Added: minus operator to rotation
+ - Fixed: Internals to pass more language tests, e.g. bool on ZERO_ROTATION and NULL_KEY, adding items to list
+

+ +

Feb 22 2008 23:38 (local time)

+

+ - Fixed: Browser status hides bottom scrollbar
+ - Fixed: Switching between Tabbed document and Windowed document, browser disappears
+ - Fixed: (key)"" == False
+ - Added: state changes allowed in global functions (when set in Debugging - General menu)
+ - Fixed: info on llInsertString was missing a few spaces
+ - Added: Debug windows have context menu, Copy, Select All and Clear
+ - Added: File - New - New notecard
+ - Changed: llGetScriptName returns scriptname without extension (when set in Debugging - General menu)
+ - Fixed: Don't send empty bugreports
+ - Fixed: tabs are presented in SL as 4 spaces, for example llStringLength("\t") == 4
+ - Fixed: remove old files after Autoupdate
+ - Fixed: autoupdate menu was readonly
+

+ +

Release 2.33

+ +

Feb 12 2008 08:12 (local time)

+

+ - Fixed: llLog and llLog10
+

+ +

Feb 04 2008 16:30 (local time)

+

+ - Added: Shortcut key for lslint, F7 ;-)
+ - Fixed: llMessageLinked using LINK_THIS works also when NOT using solution explorer
+ - Fixed: default value of key type is wrong
+ - Added: All animation / expression names are added to the autocompletion function (as strings)
+ - Added: Autocompletion of animation names can be switched on/off by menu Tools - Options - Text Editor - Code completion
+ - Fixed: crash of lsleditor on llHTTPRequest when errors occur
+ - Changed: Information on llSensorRepeat()
+ - Added: llResetLandPassList()
+

+ +

Release 2.32

+ +

Jan 27 2008 14:00 (local time)

+

+ - Added: open multiple files from menu 'File - Open - File...' or Ctrl-O
+ - Fixed: global functions do not parse when using multiple brackets on 1 line
+ - Fixed: renaming files and directories in solution explorer sometimes crashes lsleditor
+ - Changed: 'Recent Projects' in 'Recent Solutions'
+ - Changed: 'Add new Project' changed into 'Add new Solution'
+

+ +

Release 2.31

+ +

Jan 14 2008 16:28 (local time)

+

+ - Changed: llUnescapeURL and llEscapeURL using UTF8 encoding
+ - Changed: llBase64ToString and llStringToBase64 using UTF8 encoding
+ - Changed: improved label parsing
+

+ + +

Jan 12 2008 10:43 (local time)

+

+ - Fixed: llDialog does not show OK button, using no buttons
+

+ +

Jan 09 2008 17:18 (local time)

+

+ - Added: Online Help browser, New tab for every search can be unchecked in menu Tools - Options - Environment - Help
+ - Fixed: No scrolling when using Autoformat (Ctrl-D)
+

+ +

Jan 06 2008 13:31 (local time)

+

+ - Fixed: llGetListEntryType does not work on negative index
+ - Added: missing operators on integer
+ - Fixed: wrong parsing and casting of large hex numbers
+

+ +

Jan 05 2008 12:44 (local time)

+

+ - Added: show status of capslock
+

+ +

Release 2.30

+ +

Dec 29 2007 12:27 (local time)

+

+ - Fixed: llParseString2List loops when using empty strings on spacers
+

+ +

Dec 27 2007 22:57 (local time)

+

+ - Added: Disable tooltip user-setting, menu Tools - Options - Help
+ - Added: Link to the LSLEditor forum, menu Help - Forum
+ - Added: Auto save on menu Tools - Options - Debugging - General - Auto save
+ - Fixed: sending/retrieving bugreports crashes lsleditor when internet connection is not available
+ - Fixed: turning off autoindent errors on braces
+ - Fixed: line number issue on scrolling
+ - Fixed: cast error using llList2Vector for strings
+

+ +

Release 2.29

+ +

Dec 18 2007 16:38 (local time)

+

+ - Added: when nothing is selected, Shift-Delete, copies entire line to clipboard and deletes it
+ - Fixed: Ctrl-X is not undo-able
+ - Fixed: jump labels containing '_' give error
+ - Added: ATTACH_HUD_* constants
+

+ +

Dec 14 2007 17:51 (local time)

+

+ - Fixed: Unchecking Check-For-Updates, does check for updates, thats wrong
+

+ +

Release 2.28

+ +

Dec 14 2007 00:40 (local time)

+

+ - Added: INS (insert) / OVR (override) on status bar, changes when hitting Insert key
+ - Changed: Tab on notecards shows 'Text', where scripts shows 'Script'
+

+ + +

Dec 13 2007 23:52 (local time)

+

+ - Added: When changing to a non existing state, show warning
+ - Changed: llGetWallclock and llGetGMTclock
+

+ +

Dec 09 2007 02:30 (local time)

+

+ - Fixed: certain conditions the tab-stops at 4 chars goes to 6 chars wide
+

+ +

Dec 08 2007 15:55 (local time)

+

+ - Changed: Some Internals to pass more tests from http://wiki.secondlife.com/wiki/LSL_Language_Test
+ Some tests fail due to known issues. http://www.lsleditor.org/help/knownissues.htm
+ - Fixed: shift-home and shift-end selects from 'start' cq. 'end' of selection (only forward selection supported)
+

+ +

Dec 07 2007 02:44 (local time)

+

+ - Fixed: lsleditor crashes when using lslint plugin
+ - Added: Total char count
+ - Added: Last modified on SolutionExplorer items properties
+ - Changed: new implementation of llHTTPRequest, returns http status
+ - Changed: float shows 6 digits behind the decimal point (like SL)
+

+ +

Dec 06 2007 14:38 (local time)

+

+ - Fixed: Version 2.24 an above were broken on simple Verbose messages!!
+

+ +

Release 2.27

+ +

Dec 05 2007 17:35 (local time)

+

+ - Fixed: llModPow gives wrong answer using large numbers
+ - Fixed: Crash when clicked on errors, when script edit windows are closed
+ - Fixed: Oops Renaming files and objects in Solutionexplorer using same name but upper/lower case chars
+ - Fixed: Oops from llGetObjectDetails (only OBJECT_NAME and OBJECT_DESC implemented)
+ - Fixed: comments having unballanced string quotes do not compile
+

+ +

Release 2.26

+ +

Nov 28 2007 19:31 (local time)

+

+ - Changed: llBase64ToInteger , needs testings
+ - Changed: paint line numbers only when they are changed
+ - Changed: doubleclick selects whole words (including '_')
+

+ +

Nov 26 2007 13:33 (local time)

+

+ - Added: random return when failing to parse string in llBase64ToInteger
+ - Fixed: list constructor and large signed/unsigned integer problem
+

+ +

Nov 24 2007 19:16 (local time)

+

+ - Fixed: llListenRemove does not work
+ - Fixed: llMessageLinked adds 1 extra event when compiling
+

+ +

Release 2.25

+ +

Nov 22 2007 23:59 (local time)

+

+ - Added: true/false operators on vector and rotation
+ - Fixed: llRequestAgentData(uuid, DATA_BORN) has wrong date notation
+ - Fixed: listen event always gets the wrong sender id
+

+ +

Nov 20 2007 09:20 (local time)

+

+ - Fixed: typo on llRemoveSensor
+

+ +

Nov 19 2007 10:09 (local time)

+

+ - Fixed: llGetWallclock gives also fraction of seconds
+ - Added: X-SecondLife-Shard header in http request can be configured via menu - Tools - Options - Debugging - Internal (default = Production)
+ - Fixed: X-SecondLife-Region header in http request uses int coords.
+ - Fixed: notecards don't care about 'autocorrect indent'
+

+ +

Nov 15 2007 00:19 (local time)

+

+ - Fixed: Find and Find Replace window pushes editor to background when goes invisible
+ - Fixed: Find and Find Replace window does not focus text search box
+

+ +

Nov 14 2007 17:10 (local time)

+

+ - Added: X-SecondLife-* headers in http request
+

+ + +

Release 2.24

+ +

Nov 13 2007 01:33 (local time)

+

+ - Added: llResetLandBanList
+

+ +

Nov 10 2007 03:12 (local time)

+

+ - Fixed: Editing notecards is broken
+

+ +

Nov 09 2007 01:21 (local time)

+

+ - Fixed: CONTROL_ML_LBUTTON was missssspelleddd
+

+ +

Nov 07 2007 14:19 (local time)

+

+ - Fixed: info on llDetachFromAvatar() shows argument
+

+ +

Release 2.23

+ +

Nov 02 2007 15:53 (local time)

+

+ - Added: PRIM_SCULPT_TYPE_* constants
+

+ +

Oct 30 2007 11:53 (local time)

+

+ - Added: Findwindow uses F3 for next find
+

+ +

Oct 26 2007 10:57 (local time)

+

+ - Fixed: Some menu items use online wiki (if available), others use offline wiki
+

+ +

Oct 24 2007 14:53 (local time)

+

+ - Fixed: clicking Errors located on last line looses control on edit window
+ - Added: Shortcut keys to solution explorer
+ - Fixed: New script in solution explorer does not use indent user setting
+

+ +

Oct 23 2007 20:13 (local time)

+

+ - Changed: Shift-End, does not select the newline char
+ - Changed: LSLEditor remembers workingdirectory
+ - Changed: 'View Solutionexplorer' made persistent
+

+ +

Release 2.22

+ +

Oct 23 2007 20:13 (local time)

+

+ - Changed: When importing script, make form active.
+ - Changed: combox box for listening channels set to first channel by default
+ - Fixed: llScaleTexture has wrong arguments (and description)
+ - Changed: Menu item, "File - New - File" changed to File - New - Script"
+ - Fixed: llResetScript has to go directly to state_entry (and resetting vars)
+

+ +

Oct 22 2007 04:00 (local time)

+

+ - Changed: vars don't have to be initialised before usage
+

+ +

Oct 21 2007 20:18 (local time)

+

+ - Changed: Solution explorer, files are opened only once at a time
+ - Changed: Solution explorer, changed Prim entity to Object
+ - Changed: Solution explorer, Objects can be added to Objects
+ - Added: llMessageLinked can use linknum in solution explorer(needs testing)
+

    +
  • LINK_ROOT
  • +
  • LINK_SET
  • +
  • LINK_ALL_OTHERS
  • +
  • LINK_ALL_CHILDREN
  • +
  • LINK_THIS
  • +
+ Relationship is defined by place in solution explorer tree (no need to use llCreateLink)

+ - Fixed: the dialog is missing several buttons when using long text
+ - Changed: llDialog and llRequestPermissions removed topmost property
+

+ +

Oct 20 2007 12:09 (local time)

+

+ - Added: Contextmenu on error list, Copy or Copy Description only
+ - Fixed: plugin, lslint, possible crash on multiple line error output
+

+ +

Oct 18 2007 11:46 (local time)

+

+ - Fixed: possible crash on not initialized string
+ - Fixed: reading notecards outside solution explorer was broken
+ - Added: llGetObjectDetails (supported OBJECT_NAME, OBJECT_DESC)
+ - Added: llSensor / llSensorRepeat / llSensorRemove() / sensor (event)
+ (only simple event trigger, num_detected is always 1)
+ - Fixed: llRequestPermissions is broken
+

+ +

Oct 16 2007 23:29 (local time)

+

+ - Fixed: Old bug on multiple changed scripts saving using Ctrl-S shortcut only saves first script
+ - Fixed: Rename objects do not set object-name correctly
+

+ +

Release 2.21

+ +

Oct 16 2007 13:46 (local time)

+

+ - Changed: Find/Replace window hides when pressing Escape
+ - Changed: Find/Replace window keeps focus
+

+ +

Oct 15 2007 23:10 (local time)

+

+ - Changed: Tools menu, starts at top node
+ - Added: LSLEditor goes unicode
+ menu - tools - options - text editor - general - output format +

    +
  • ANSI (default)
  • +
  • Unicode
  • +
  • Unicode big endian
  • +
  • UTF-8
  • +
+ - Fixed: Save on new.lsl file crashes LSLEditor
+ - Changed: bugreport, Highlight entry in left pane (also when lost focus)
+ - Fixed: bugreport, 'check all / uncheck all' button has wrong initial state
+ - Changed: autocompletion on ll-functions having zero arguments (or single void argument) completes with ')' char
+ - Added: double-clicking on an error message after compile, line in edit window is highlighted
+

+ +

Oct 10 2007 10:59 (local time)

+

+ - Changed: In respect to solution explorer +

    +
  • llGetObjectDesc
  • +
  • llSetObjectDesc
  • +
  • llGetObjectName
  • +
  • llSetObjectName
  • +
+

+ +

Release 2.20

+ +

Oct 09 2007 16:12 (local time)

+

+ - Added: Plugin support
+ - Fixed: llList2Key crash
+

+ +

Oct 08 2007 23:55 (local time)

+

+ - Changed: Opened files in solution explorer are asked to save when closed
+ - Changed: bugreport, files to be included are unchecked by default
+

+ +

Oct 03 2007 19:22 (local time)

+

+ - Added: bool operators on list
+ - Fixed: Multiple 'if' indent (only on autoformat document)
+ - Added: integer operator + and - (overrides internal operators)
+ - Fixed: llParseStringKeepNulls last empty element is not added
+ - Fixed: llListSort on non string items
+ - Fixed: Sometimes scrolling is disabled when moving the cursor
+ - Fixed: Multiline comments on highlighted chars gives colored results
+ - Fixed: llList2XXX functions for negative index
+ - Added: explicit string operator on bool
+

+

Oct 02 2007 18:25 (local time)

+

+ - Added: Menu - Tools - Options - Text editor - warning on different indent scheme (on by default)
+ - Added: Menu - Tools - Options - Text editor - autocorrect indent on file loading (off by default)
+ - Fixed: changing guid on items in solutionexplorer reflects on opened script windows
+ - Changed: Wildcard autocompletion on argument, changed to show only pulldown menu (example llGetInventoryName)
+ - Added: llRot2Fwd / llRot2Up / llRot2Left
+

+ +

Release 2.19

+ +

Oct 01 2007 16:30 (local time)

+

+ - Changed: Make text bold on active tab
+ - Fixed: llUnescapeURL returns UTF8 strings, for example: llOwnerSay(llUnescapeURL("pr%c3%aate"));
+ - Fixed: Syntax errors are on column - 1
+ - Added: Command line option /run starts debugging after loading scripts (if any)
+ - Fixed: Syntax errors on scripts having same name are clickable
+ - Fixed: Copy / Paste gives wrong colors in editor
+

+ +

Sep 29 2007 21:35 (local time)

+

+ - Added: Changing Guid of any item in solution explorer
+ - Changed: manual listen event trigger, channel is combobox
+ (listen filter does only work on normal chat messages, not on manual event trigger)
+ - Added: Ctrl-C copies selected errors to clipboard
+ - Added: Ctrl-A selects all text errors list
+ - Added: Ctrl-A selects all text in debug and simulator console
+ - Added: Line, Column and Char position of cursor (added Column)
+ - Fixed: "There are 0 instances, replace them all?"
+ - Fixed: var names containing 'jump' are wrongly parsed
+ - Fixed: llAttachToAvatar wrong description
+

+ +

Sep 22 2007 19:29 (local time)

+

+ - Fixed: Selection from last line does not work
+

+ +

Release 2.18

+ +

Sep 21 2007 19:09 (local time)

+

+ - Fixed: SaveAs was broken
+ - Fixed: autocompletion on 'default', only when there is no default state
+ - Fixed: state change to same state, acts like a return
+ - Changed: Ctrl-D (format document) keeps cursor on line
+ - Changed: Ctrl-E (format selection) keeps text selected
+ - Added: Tools - Options - Debugging - General - Quoted strings in list output (default = none)
+ - Changed: Major change to the list object (needs testing)
+ - Fixed: Some minor indent bug on outermost braces when typing
+ - Changed: Verbose output gives more readable lists
+ - Fixed: llParseString2List and llParseStringKeepNulls (needs testing)
+

+ +

Sep 19 2007 16:47 (local time)

+

+ - Added: http 'ContentLength' on llHTTPRequest POST requests
+

+ +

Release 2.17

+ +

Sep 19 2007 12:47 (local time)

+

+ - Fixed: Closing LSLEditor saves (all) changed files using its own name, example files (new.lsl) shows dialog
+

+ +

Sep 18 2007 12:47 (local time)

+

+ - Fixed: Labels can have whitespace between @ and label name
+

+ +

Sep 17 2007 14:41 (local time)

+

+ - Added: Tools - Options - Debugging - General - Single Quote char allowed outside strings
+

+ +

Sep 16 2007 14:41 (local time)

+

+ - Fixed: Typing many '}' on same lines, gives weird autoformatting
+ - Fixed: Bracket highlighting when typing braces (curly brackets)
+ - Fixed: Rotation '/' operator
+

+ +

Sep 15 2007 17:45 (local time)

+

+ - Added: Update application supports 'gzip','zip' and 'bzip2'
+ - Changed: Richlabel has some extra right margin
+ - Fixed: 4-Spaces indent was broken on tools menu
+ - Fixed: Annoying scroll when bracket highligthing and code formatting
+ - Fixed: 'If you see this, something is wrong' on state change and llResetScript
+ - Fixed: Die button kills runaway processes like 'while(TRUE);'
+ - Added: Icons for errors and warnings
+ - Added: Compiler generates warnings (can be switched off in menu Tools - Options - Debugging - General)
+

+ +

Sep 14 2007 10:52 (local time)

+

+ - Fixed: llOwnerSay talks only to the owner, preventing possible loops
+

+ +

Sep 13 2007 16:39 (local time)

+

+ - Added: Date/time on printed output
+ - Changed: Case insensitive on ECC
+

+ +

Release 2.16

+ +

Sep 13 2007 12:10 (local time)

+

+ - Added: Experimental Code Completion (ECC) on user defined variable names, menu - tools - options - Text Editor - Code Completion
+ - Changed: Escape toggles on/off autocompletion and tooltips
+

+ +

Sep 12 2007 16:28 (local time)

+

+ - Added: Pagesetup margins on printed documents
+ - Added: header and footer on printed documents
+ - Added: Print selection
+ - Fixed: llList2ListStrided crashed for nonsense (<=0) strides
+

+ +

Sep 11 2007 17:07 (local time)

+

+ - Added: Ctrl-Del removes whitespace/word
+ - Fixed: llToUpper / llToLower gives wrong hint
+

+ +

Sep 06 2007 13:35 (local time)

+

+ - Fixed: First users see only a small window
+

+ +

Release 2.15

+ +

Sep 03 2007 17:00 (local time)

+

+ - Fixed: Renaming of non scripts and non notecards
+ - Added: Solution Explorer, changing filetype of items
+ - Changed: Solution Explorer, project and inventory paths are saved as a relative path to solution file (if possible)
+ - Changed: Solution Explorer, "Add New File -> Script" , have it use the default.lsl file, same as "new.lsl" when opening.
+ - Fixed: 0xFFFFFFFF parsed as integer
+ - Fixed: capitalization of 'string' and 'float'
+ - Added: PRIM_TYPE_SCULPT constant
+

+ +

Aug 31 2007 12:07 (local time)

+

+ - Fixed: Recent projects menu blocks when dirty script has to be saved
+ - Added: Menu - Tools - Options - Environment - General - delete old files after update
+

+ +

Release 2.14

+ +

Aug 27 2007 12:07 (local time)

+

+ - Fixed: Crash in Renaming files containing illegal chars in Solutionexplorer
+ - Fixed: Find / Replace broken
+ - Fixed: Labels are broken
+

+ +

Aug 24 2007 15:30 (local time)

+

+ - Added: Menu - Project - Add New File , add new file to active Prim in SolutionExplorer (if Any)
+ - Added: Check if solution file already exist when Create new solution
+ - Added: F3 shortcut for 'Find Next'
+ - Fixed: Pressing Ctrl-H twice crashes program
+ - Added: Multiline strings
+ - Fixed: String (capital S) can be used as a var
+ - Added: Explicit string operator on internal integer
+ - Added: File Association for .lsl and .sol files (Menu-Tools)
+

+ +

Aug 23 2007 23:02 (local time)

+

+ - Fixed: Linenumbers incorrect after scrolling
+ - Fixed: default state has not to be on column 0
+ - Fixed: When user clicks 'No' on llRequestPermissions, do trigger run_time_permissions
+ - Fixed: Brackets highlighting now skips comments
+ - Changed: Online Wiki Address can be changed
+ - Changed: Bugreport shows unique number and date/time
+ - Changed: Bugreport uploadservice can handle normal filenames, spaces included ;-)
+ - Added: llGetInventoryType (when using solution explorer)
+ - Changed: Blockcommenting Ctrl-K and Ctrl-L (also on non selected line)
+

+ +

Release 2.13

+ +

Aug 22 2007 17:57 (local time)

+

+ - Fixed: Crash on making default state
+ - Fixed: Linenumbers only appear when scrolling
+ - Fixed: Crash on some debug code, writing to D drive
+ - Fixed: float parsing on lists does Oops...
+ - Added: Experimental wildcard argument completion (for example llListStatistics)
+ - Fixed: Tooltip on codecompletion can not get outside client area
+ - Fixed: Coloring when typing strings
+ - Fixed: indenting fails on strings containing // chars
+

+ +

Aug 21 2007 19:28 (local time)

+

+ - Changed: Reading scripts using default codepage
+ - Added: llListStatistics (needs more testing)
+ - fixed: llCSV2List escapes angle brackets
+

+ +

Aug 20 2007 23:48 (local time)

+

+ - Fixed: Find / Find and Replace window mixes up settings
+ - Fixed: Sending bugreport crashes editor when offline
+

+ +

Aug 18 2007 21:19 (local time)

+

+ - Changed: new Tools Options menu
+ - Fixed: Single quotation char in comment breaks parsing
+

+ +

Aug 17 2007 19:22 (local time)

+

+ - Fixed: Quad and Vector parsing breaks at certain conditions
+ - Fixed: some changes to text do not set dirty flag
+

+ +

Aug 16 2007 23:57 (local time)

+

+ - Fixed: changing state into same state goes into loop
+ - Fixed: llCSV2List is not really inverse to llList2CSV (llCSV2List does not parse rotations and vectors, yet)
+ - Fixed: labels without ';' does not give syntax error
+ - Fixed: jump @label; does not give syntax error
+ - Fixed: floats getting truncated on non-English systems
+ - Changed: Position and Size of editor window are only restored when in workingarea of Primary screen
+ - Fixed: Script error on download HTML Help file
+

+ +

Aug 15 2007 17:51 (local time)

+

+ - Fixed: Don't compile nor syntax check notecards using solution explorer
+ - Added: llInsertString
+ - Fixed: llGiveInventoryList has wrong ref argument (syntax check breaks)
+ - Fixed: Tab and Shift Tab on selected text
+ - Added: Toggle button check / uncheck attached scripts on the bugreport form
+ - Fixed: Argument of event changed(integer change)
+ - Changed: Sending bugreports can be canceled
+ - Changed: implicit float to integer operator to explicit
+

+ +

Release 2.12

+ +

Aug 10 2007 13:13 (local time)

+

+ - Added: LSLEditorHelp offline wiki (Tools - Editor properties)
+ - Changed: Find window keeps search entries
+

+ +

Aug 05 2007 00:30 (local time)

+

+ - Fixed: Cursor position on backspace
+

+ +

Aug 03 2007 16:50 (local time)

+

+ - Added: Ctrl-F (find) uses keyword on cursor position
+ - Added: Ctrl-Up / Ctrl-Down history scrolling on chat box
+ - Fixed: llSetLinkTexture() do not take texture uuids
+ - Fixed: llParseString2List refuse to take keys as strings
+ - Added: Solution Explorer, F2 for rename
+ - Added: default.lsl in LSL-Editor directory will be used as 'new.lsl' template
+ - Fixed: llSetColor tooltip is wrong
+

+ +

Aug 02 2007 23:42 (local time)

+

+ - Added: Smtp Authentication for llEmail (Tools, Runtime Properties, External, Email)
+

+ +

Release 2.11

+ +

Jul 30 2007 16:19 (local time)

+

+ - Added: Home key works also on white-space lines
+ - Fixed: After sending two bugreports, button is disabled
+ - Added: POST method to llHttpRequest (untested)
+

+ +

Jul 28 2007 12:05 (local time)

+

+ - Fixed: Richtext label inserts spaces after color change
+ - Added: Sound support (simple) use llPlaySound and .wav file in solution explorer
+

+ +

Jul 26 2007 13:29 (local time)

+

+ - Added: PageUp and PageDown on intellisense dropdown menu
+ - Fixed: Editor crash when closing project having browser window open
+ - Added: llGetLocalPos()
+

+ +

Release 2.10

+ +

Jul 25 2007 14:30 (local time)

+

+ - Added: Solution Explorer (first look)
+

    +
  • llGetObjectName
  • +
  • llGetScriptName
  • +
  • llGetKey
  • +
  • llGetInventoryName
  • +
  • llGetInventoryKey
  • +
  • llGetInventoryNumber
  • +
  • llGetNumberOfNotecardLines
  • +
  • llGetNotecardLine
  • +
+ - Added: Reset option on Editor properties
+ - Added: mod operator (%) on integer
+

+ +

Jul 24 2007 11:55 (local time)

+

+ - Changed: Recent file list is clipped (showing ...)
+ - Fixed: Syntax error on negative line numbers (?!) breaks editor
+

+ +

Jul 20 2007 10:55 (local time)

+

+ - Added: Checkbox on Edit tab to Disable compile / syntaxcheck
+ - Added: Allow scripts to open by Drag and Drop on LSL-Editor
+ - Fixed: Indent on return when in middle of a line
+ - Added: llGetDate
+ - Fixed: llDie in script does not work, throws an error
+ - Changed: id in llMessageLinked / message_link accepts strings
+

+ +

Jul 19 2007 15:27 (local time)

+

+ - Added: Bugtracker to Menu Help , Bugreport
+ - Changed: Home button toggles between start of line, and first non whitespace
+

+ +

Release 2.9

+ +

Jul 16 2007 11:25 (local time)

+

+ - Changed: Autocompletion images scale on changing fonts
+ - Changed: Tab alignement on changing fonts
+

+ +

Jul 15 2007 23:51 (local time)

+

+ - Added: Editor Properties, Font selector for editor and tooltips
+ - Fixed: Ctrl-X does not have paste
+

+ +

Jul 13 2007 15:20 (local time)

+

+ - Changed: Bugreport name and email adres made sticky
+ - Fixed: Bugreport window looses focus when tooltip shows
+ - Added: Shift-Delete
+ - Fixed: Ctrl-X can not undo
+ - Fixed: Ctrl-Home does not go to line 1, column 1
+ - Fixed: Shift-Home does not appear to select text
+

+ +

Jul 12 2007 12:59 (local time)

+

+ - Fixed: Tooltip shows bold on some High-Resolution machines (David IOU1)
+

+ +

Release 2.8

+ +

Jul 10 2007 08:41 (local time)

+

+ - Fixed: Runtime properties, incorrect key from cache (xor)
+

+ +

Jul 9 2007 14:51 (local time)

+

+ - Added: Editor properties: Auto update frequency
+ - Added: Editor properties: Indent settings
+

+ +

Jul 8 2007 23:59 (local time)

+

+ - Changed: Tooltip font is SystemFonts.MessageBoxFont
+ - Fixed: llRot2Up returns void....
+

+ +

Jul 6 2007 13:13 (local time)

+

+ - Fixed: MD5 checksum on update function breaks
+ - Added: Boundary checks on list functions
+ - Fixed: jump statement gives error (_goto)
+

+ +

Release 2.7

+ +

Jul 4 2007 12:12 (local time)

+

+ - Added: Bitwise Xor operator on integer (^)
+

+ + +

Jul 3 2007 20:56 (local time)

+

+ - Fixed: XML-RPC server not closed when closing LSL-Editor
+

+ +

Jul 2 2007 14:41 (local time)

+

+ - Fixed: Size of Simulator resets to default
+ - Changed: Vector and Rotation parser
+ - Changed: Vector and Rotation fields changed from double to float
+ - Added: Preprocessor processes all internal reserved words
+ - Changed: llDialog / llRequestPermissions / link_message / llMessageLinked uses new TaskQueue
+

+ +

Jul 1 2007 23:55 (local time)

+

+ - Added: Smart indenting on closing parenthesis (experimental)
+ - Revised: (Needs testing!!) +

    +
  • llGetSubString
  • +
  • llDeleteSubString
  • +
  • llList2List
  • +
  • llDeleteSubList
  • +
+ - Added: +
    +
  • llIntegerToBase64
  • +
  • llBase64ToInteger
  • +
  • llStringToBase64
  • +
  • llBase64ToString
  • +
  • llXorBase64StringsCorrect
  • +
+

+ +

Jun 30 2007 11:41 (local time)

+

+ - Fixed: Can't close tabs when in Windows Classic mode
+ - Changed: Internal, state / event has its own TaskQueue (needs testing)
+

+ +

Jun 29 2007 16:38 (local time)

+

+ - Fixed: Integer '~' operator works only on TRUE/FALSE
+ - Added: Syntax checker button F6 (no compile / execute)
+ - Changed: Internal, Simulator / Compiler as usercontrols
+

+ +

Jun 28 2007 12:18 (local time)

+

+ - Added: Ctr-Shft-S to Save as...
+ - Added: AutoUpdate check (daily) / Manual update on Help menu
+ - Added: Double click on compiler error goes to error line / column
+ - Changed: Compiler errors shows on listview
+ - Changed: Tab / Shift Tab , toggles indent block of text
+ - Changed: Home button sets cursor to beginning of line, after whitespace
+

+ +

Release 2.6

+ +

Jun 27 2007 18:20 (local time)

+

+ - Fixed: Editor crashes on error in dataserver script
+ - Changed: synchronized llGetNumberOfNotecardLines / llGetNotecardLine dataserver requests
+

+ +

Jun 26 2007 11:49 (local time)

+

+ - Fixed: llDialog does not talk anymore
+

+ +

Jun 25 2007 21:08 (local time)

+

+ - Fixed: Indent adds tab on lines ending in comment or whitespace
+ - Added: XML-RPC listening base port 50888
+

    +
  • remote_data (event)
  • +
  • llOpenRemoteDataChannel
  • +
  • llCloseRemoteDataChannel
  • +
  • llRemoteDataReply
  • +
  • llSendRemoteData (untested)
  • +
+ - Fixed: Tooltips shows 'lt;' and 'gt;'
+ - Added: Bugreport to Menu Help
+ - Added: llLoadURL
+ - Added: listen callbacks are removed on state change
+ - Added: llListenControl
+

+

Jun 24 2007 13:11 (local time)

+

+ - Added: Print preview
+ - Fixed: Editor only prints 1 page
+ - Added: ReplaceAll
+ - Fixed: Find and Replace issues
+

+

Jun 22 2007 18:59 (local time)

+

+ - Added: The ~ (complement) operator to integer
+ - Fixed: global functions containing whitespace gives compile error
+ - Added: Keep user settings between LSLEditor updates
+ - Added: llGetNumberOfNotecardLines / llGetNotecardLine
+ - Added: Recent files list in the File menu
+

+ +

Jun 21 2007 13:41 (local time)

+

+ - Fixed: Compiles empty documents and/or absent default state
+

+ +

Release 2.5

+ +

Jun 20 2007 22:41 (local time)

+

+ - Fixed: Menu Tools does not work
+ - Added: llStringTrim
+

+ +

Jun 18 2007 14:50 (local time)

+

+ - Fixed: Backspace / Delete issues when brackets highlighted
+

+ +

Jun 14 2007 23:59 (local time)

+

+ - Fixed: Backspace unreliable when brackets highlighted
+ - Changed: Tab-characters have same width as 4 spaces
+ - Changed: auto indent on typing if/else
+ - Changed: format document indent if/else
+ - Fixed: timer stops after state change
+ - Fixed: llList2Integer broken
+ - Added: llMessageLinked / link_message
+ - Fixed: llListReplaceList gives wrong answer
+

+ +

Jun 13 2007 20:21 (local time)

+

+ - Fixed: key problem (breaks listen and more)
+

+ +

Release 2.4

+ +

Jun 13 2007 12:12 (local time)

+

+ - Release 2.4
+

+ +

Jun 12 2007 16:43 (local time)

+

+ - Fixed: llSetTimerEvent broken
+ - Added: Redo
+ - Changed: Linenumbers stops at and-of-document
+ - Fixed: Cursorposition shows on closed tab
+ - Changed: Close button on tab shows on mouse hover
+ - Fixed: Argument typing shows wrong color
+ - Fixed: Slow brackets matching
+ - Fixed: Slow editing large documents / long lines
+

+ +

Jun 11 2007 11:36 (local time)

+

+ - Fixed: Line numbers incorrect after delete all
+ - Fixed: Cursor position does not show on non primary script
+ - Fixed: Undo eats memory
+ - Fixed: Undo slow on large documents
+

+

Jun 09 2007 11:44 (local time)

+

+ - Added: brackets matching
+

    +
  • parentheses or round brackets: ( )
  • +
  • box brackets or square brackets: [ ]
  • +
  • curly brackets or braces: { }
  • +
  • angle brackets or chevrons: < >
  • +
+

+

Jun 08 2007 19:35 (local time)

+

+ - Fixed: Undo after find / replace
+ - Fixed: Undo does nothing
+ - Added: Color scheme for tooltips
+ - Fixed: Missing spaces in tooltips
+ - Fixed: Keyboard hint vertical position changes
+ - Fixed: Mouse Tooltip shows on EOL
+

+ +

Jun 07 2007 13:41 (local time)

+

+ - Added: Find and Replace
+

+ +

Release 2.3

+ +

Jun 06 2007 17:01 (local time)

+

+ - Fixed: Editor does not show on taskbar
+ - Added: bool operators on key
+ + - Added: Operator vector / rotation
+ - Fixed: Save Ctrl-S in debug session
+

+

Jun 05 2007 23:33 (local time)

+

+ - Fixed: A lot of operators
+ - Fixed: llDeleteSubString
+ - Added: Block commenting Ctrl-K Ctrl-L
+ - Fixed: Compiler errors hide internal types
+ - Improved: parsing strings, including escape chars
+ - Changed: No codecompletion nor hints typing within strings
+ - Changed: No codecompletion nor hints typing within comments
+ - Fixed: blind tabs showing again on XP without VisualStyles
+ - Added: Shortcutkeys for formatting
+

+

Jun 04 2007 21:52 (local time)

+

+ - Changed: replaced double by float
+ - Fixed: Parsing long files takes to much time
+ - Fixed: Line-numbers frozen
+ - Fixed: compile error on 'state' between quotes
+ - Fixed: AutoWordSelection problem appears to be an insolvable Microsoft bug, ... i solved it
+ - Added: Showing Line / Character position of cursor on statusbar
+

+

Jun 03 2007 20:54 (local time)

+

+ - Fixed: AutoWordSelection off, and stay off
+ - Fixed: indent whitespace can be a mix of tab and spaces
+ - Added: default / state to autocompletion ;-)
+ - Added: operators + and - for rotation / rotation
+ - Added: operators multiplication of vector / rotation
+ - Added: operators multiplication and division of rotation / rotation
+

+

Jun 02 2007 18:58 (local time)

+

+ - Added: llAxisAngle2Rot
+ - Added: some vector operators
+ - Fixed: codecompletion tooltip disappears when hitting arrow keys
+ - Fixed: blind tabs showing again on XP without VisualStyles
+

+

Jun 01 2007 23:34 (local time)

+

+ - Added: at_target, http_response and remote_data events
+ - Added: Goto form acts on return key
+ - Added: First implementation of llDialog
+ - Fixed: VisualStyleRenderer crash on startup
+ - Fixed: Indent was broken
+ - Added: implicit string operator on key
+ - Added: implicit bool operators to string class
+

+ +

May 31 2007 23:55 (local time)

+

+ - Added: llSleep
+ - Added: Editor Goto Line (Ctrl-G)
+ - Added: Ctrl-F4 closes active window/tab
+ - Added: Editor option Wiki-pages in Seperate browser
+ - Fixed: Linenumber drawing double-buffered in editor
+ - Added: Close button to Tab pages
+ - Fixed: 'Tab' key inserts a tab character or 4-space characters, depending on the Editor-settings
+ - Fixed: timer problem when changing states
+

+ +

May 29 2007 16:41 (local time)

+

+ - Improved: parenthesis indenting old 'C' style accepted
+ - Added Editor options: Auto Word Selection (off by default)
+ - Fixed: Linenumber drawing double-buffered in editor
+ - Added a 'Die' button to the compiler
+ - Added Editor options: SL (ugly) color-scheme / SL 4-spaces indent
+ - Fixed: crash on editing end-of-document
+ - Fixed: void argument on events
+

+ +

May 28 2007 23:34 (local time)

+

+ - Autocompletion including arguments on 'events'
+ - Fixed: incorrect color on pasting text
+ - Fixed: autoformatting on selected text
+ - Fixed: incorrect old argument list on non-functions
+

+ +

May 27 2007 13:15 (local time)

+

+ - llListFindList bug fixed
+ - added comparison operators for list,key,float,integer,vector and rotation
+ - when opening an existing document, the untouched 'new.lsl' example is destroyed
+

+ +

Release 2.2

+ +

May 26 2007 18:00 (local time)

+

+ - Tooltipping / Codecompletion hitting the boundaries of parent window
+

+ +

May 25 2007 11:28 (local time)

+

+ - Explicit cast 'list' implemented for string,integer,key,float,vector and rotation
+

+ +

May 24 2007 19:34 (local time)

+

+ - Compiler error shows correct line numbers
+ - Debug tab only visible when there are no compile errors
+ - Removed C# tab
+ - Small bug fixed, on empty information, when using codecompletion
+ - Codecompletion shows ALL keywords
+ - Shows '*' after filename when document is changed
+

+ +

May 23 2007 21:03 (local time)

+

+ - Compiler starts at Output tab, on error shows C# tab
+ - Tabbed documents!!
+ Thanks to Darek and Marco for their bug reports:
+ - Fixed: Operator '+' is ambiguous on operands of type 'LSLEditor.SecondLife.integer' and 'LSLEditor.SecondLife.integer'
+ - Fixed: Operator '+=' cannot be applied to operands of type 'LSLEditor.SecondLife.list' and 'double'
+ - Fixed: Operator '+=' cannot be applied to operands of type 'LSLEditor.SecondLife.list' and 'LSLEditor.SecondLife.key'
+ - Copy from the debug window enabled
+

+ +

May 22 2007 23:46 (local time)

+

+ - Bug fix on empty key in Sim properties
+ - Show function arguments while typing
+

+ + +

May 16 2007 13:07 (local time)

+

+ - Simulator docks at bottom
+

+ +

Release 2.1

+ +

May 14 2007 22:47 (local time)

+

+ - Release 2.1 (Multiple document interface)
+ - Running multiple LSL scripts concurrent
+ - Chat/listen implementation between LSL scripts
+ - First implementation of a 'find' (Ctrl-F) option
+

+

May 08 2007 16:37 (local time)

+

+ - llListRandomize
+ - llListSort
+ - llListReplaceList (to be tested)
+ - llParseString2List (todo spacers)
+ - llParseStringKeepNulls (todo spacers)
+

+ +

May 07 2007 19:53 (local time)

+

+ - llMD5String implemented + - Implemented a lot of list functions (see examples)
+ - Fixed state bug
+ - llResetScript()
+ - Tooltip improved
+

+ +

May 06 2007 13:03 (local time)

+

+ - Parser improved a lot!!
+

+ +

May 04 2007 17:15 (local time)

+

+ - LSL keywords updated 19 Dec 2006 for LSL 1.13
+

+

May 03 2007 18:49 (local time)

+

+ - Execution is more stable, and useful error reports :-)
+ - Implemented listen filter (llListen / llListenRemove)
+ - some minor bugfixes
+

+

May 02 2007 19:41 (local time)

+

+ - llListFindList implemented
+ - KEY_NULL implemented
+ - key compare
+ - llGetOwnerKey returns key in compiler properties
+ - llToLower / llToUpper
+ - llEuler2Rot / llRot2Euler
+ - Code completion shows function arguments when typing
+ - Cleaned the resource files
+ - Updated a lot more, can't remember ;-)
+

+ +

May 01 2007 13:47 (local time)

+

+ - Manual Chat works, on different channels (listen) +

+

Apr 30 2007 23:57 (local time)

+

+ - Format document (Edit -> Advanced -> Format Document)
+ - llFrand seeding
+ - casting bug fixed (parser)
+ - run_time_permissions event bug fixed
+ - llDialog shows messagebox (no buttons)
+ - Did some testing on "Shippou Oud - Fruit machine"
+ - Import Examples
+ - Timer bug fixed
+ - Al lot of internal base class changes
+

+ +

Apr 29 2007 15:29 (local time)

+

First implementation of linenumbers

+ +

Release 2.0

+ +

Apr 28 2007 14:01 (local time)

+

Changed project to .NET 2.0

+ +

Mar 30 2007 12:54 (local time)

+

- changed wiki adres

+ +

Jan 2007 - Mar 2007

+

- Sabbatical :-), doing nothing....

+ +

Dec 26 2006 12:54 (local time)

+

- first implementation of printing

+

Nov 21 2006 23:22 (local time)

+

- delete key bug fixed

+

Nov 08 2006 00:40 (local time)

+

- got Strife _double back in place
+ - some C# coloring

+

Nov 05 2006 14:54 (local time)

+

- Just some minor updates, lack of time at the moment

+

Oct 29 2006 01:00 (local time)

+

- State change fires state_exit and state_entry
+ - compiler on tabcontrole

+

Oct 28 2006 02:00 (local time)

+

- Float2Hex example compiles (thanx to Strife Onizuka)

+

Oct 27 2006 21:59 (local time)

+

- Global class compiles correctly on vars (static) and user defined + functions (void and non void)

+

Oct 26 2006 01:07 (local time)

+

- code completion, tab/return and contains icons for different types
+ - other type of tooltipping.... not nice.
+ - override & , to make it bool answer...

+

Oct 25 2006 01:46 (local time)

+

- http can use proxy
+ - smtp
+ - properties windows for compiler
+ - integer made out of struct, to override (string) explicit operator

+

Oct 22 2006 21:43 (local time)

+

- first implementation of llHTTPRequest / http_response
+ - made a lot of lists functions
+ - more lists on one line (not lists within lists)

+

Oct 20 2006 21:00 (local time)

+

- State change, shows correct events

+

Oct 20 2006 0:03 (local time)

+

- Implemented (almost) all Math functions
+ - Timer works

+

Oct 19 2006 03:00 (local time)

+

- some edit improvements
+ - states work!!

+

Oct 16 2006 23:50 (local time)

+

- Improvement parsing script, vector,rotation, simple list (one line)
+ - Global vars, wrapped in global class
+ - Checkupdate function in the program
+ - First attempt multiple state (only default state executes, have patients + my friends...)

+

Oct 14 2006 18:36 (local time)

+

- User argument input for events like touch_start (see picture above)

+

Oct 8, 2006 18:36 (local time)

+

- Code highlighting
+ - Code completion
+ - Code info, took the old LSLguide, and used Appendix, i can do better i + know
+ - F1 , on a keyword, does show up the LSLWiki page on the keyword
+ - Compile, the hello world example should work on state_entry event
+ - Open/Save and edit lsl script files

+

Oct 2, 2006 (local time)

+ +

Release 1.0

+ +

First idea and prototype

+ +

Oct 1, 2006 (local time)

+ +
diff --git a/Resource/Test.snk b/Resource/Test.snk new file mode 100644 index 0000000..a22325b Binary files /dev/null and b/Resource/Test.snk differ diff --git a/Resource/ToolsOptions.xml b/Resource/ToolsOptions.xml new file mode 100644 index 0000000..b5cbebe --- /dev/null +++ b/Resource/ToolsOptions.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resource/app.config b/Resource/app.config new file mode 100644 index 0000000..b8dd261 --- /dev/null +++ b/Resource/app.config @@ -0,0 +1,139 @@ + + + + + +
+ + +
+ + + + + + + http://www.lsleditor.org/UploadExampleService/Service1.asmx + + + + + // LSL-Editor by Alphons (Jano) van der Heijden + default + { + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } + } + + + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + + + http://www.lsleditor.org/examples/ + + + + + http://www.lsleditor.org/uploadscript/ + + + + Resource.ConfLSL.xml + + + + Resource.ConfCSharp.xml + + + + 25 + + + new.lsl + + + + res://LSLEditor.exe/ReleaseNotes.htm + + + + + + + + SecondLife Name + + + 2.0.1 + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + + youraddress@yourdomain.ext + + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 100 + + + 0, 0 + + + 254464, 255232 + + + + \ No newline at end of file diff --git a/Resource/thanks.gif b/Resource/thanks.gif new file mode 100644 index 0000000..e4b6c2a Binary files /dev/null and b/Resource/thanks.gif differ diff --git a/RuntimeConsole.Designer.cs b/RuntimeConsole.Designer.cs new file mode 100644 index 0000000..65bbad9 --- /dev/null +++ b/RuntimeConsole.Designer.cs @@ -0,0 +1,228 @@ +namespace LSLEditor +{ + partial class RuntimeConsole + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (this.SecondLifeHost != null) + { + this.SecondLifeHost.Dispose(); + this.SecondLifeHost = null; + } + if ((components != null)) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.button1 = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.panel2 = new System.Windows.Forms.Panel(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.panel1.SuspendLayout(); + this.panel3.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Controls.Add(this.panel4); + this.panel1.Controls.Add(this.panel3); + this.panel1.Dock = System.Windows.Forms.DockStyle.Right; + this.panel1.Location = new System.Drawing.Point(294, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(205, 300); + this.panel1.TabIndex = 0; + // + // panel4 + // + this.panel4.AutoScroll = true; + this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel4.Location = new System.Drawing.Point(0, 64); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(205, 236); + this.panel4.TabIndex = 1; + // + // panel3 + // + this.panel3.Controls.Add(this.button1); + this.panel3.Controls.Add(this.groupBox1); + this.panel3.Dock = System.Windows.Forms.DockStyle.Top; + this.panel3.Location = new System.Drawing.Point(0, 0); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(205, 64); + this.panel3.TabIndex = 0; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(168, 24); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(32, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Die"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.comboBox1); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(152, 48); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "state"; + // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point(8, 16); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(136, 21); + this.comboBox1.TabIndex = 0; + this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); + // + // panel2 + // + this.panel2.Controls.Add(this.groupBox2); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(294, 300); + this.panel2.TabIndex = 1; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.textBox2); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox2.Location = new System.Drawing.Point(0, 0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(294, 300); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Verbose"; + // + // textBox2 + // + this.textBox2.AcceptsReturn = true; + this.textBox2.AcceptsTab = true; + this.textBox2.ContextMenuStrip = this.contextMenuStrip1; + this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox2.Location = new System.Drawing.Point(3, 16); + this.textBox2.Multiline = true; + this.textBox2.Name = "textBox2"; + this.textBox2.ReadOnly = true; + this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox2.Size = new System.Drawing.Size(288, 281); + this.textBox2.TabIndex = 0; + this.textBox2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyDown); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.copyToolStripMenuItem, + this.selectAllToolStripMenuItem, + this.toolStripSeparator1, + this.clearToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(153, 98); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.selectAllToolStripMenuItem.Text = "Select All"; + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + // + // clearToolStripMenuItem + // + this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; + this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.clearToolStripMenuItem.Text = "Clear"; + this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + // + // RuntimeConsole + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Name = "RuntimeConsole"; + this.Size = new System.Drawing.Size(499, 300); + this.panel1.ResumeLayout(false); + this.panel3.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + } +} diff --git a/RuntimeConsole.cs b/RuntimeConsole.cs new file mode 100644 index 0000000..76e2182 --- /dev/null +++ b/RuntimeConsole.cs @@ -0,0 +1,412 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Drawing; +using System.Reflection; +using System.Windows.Forms; + +using System.Threading; +using LSLEditor.Helpers; + +namespace LSLEditor +{ + public partial class RuntimeConsole : UserControl + { + private LSLEditorForm mainForm; + + public RuntimeConsole(LSLEditorForm mainForm) + { + InitializeComponent(); + this.mainForm = mainForm; + this.Dock = DockStyle.Fill; + } + + private Thread ResetScriptWatcher; + private AutoResetEvent ResetScriptEvent; + public SecondLifeHost SecondLifeHost; + + private string CSharpCode; + private EditForm editForm; + + private bool GetNewHost() + { + Assembly assembly = CompilerHelper.CompileCSharp(editForm, CSharpCode); + if (assembly == null) + return false; + + if(SecondLifeHost!=null) + SecondLifeHost.Dispose(); + SecondLifeHost = null; + + SecondLifeHost = new SecondLifeHost(this.mainForm, assembly, editForm.FullPathName, editForm.guid); + SecondLifeHost.OnChat += editForm.ChatHandler; + SecondLifeHost.OnMessageLinked += editForm.MessageLinkedHandler; + SecondLifeHost.OnDie += new EventHandler(host_OnDie); + SecondLifeHost.OnReset += new EventHandler(SecondLifeHost_OnReset); + SecondLifeHost.OnListenChannelsChanged += new EventHandler(SecondLifeHost_OnListenChannelsChanged); + + SecondLifeHost.OnVerboseMessage += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnVerboseMessage); + SecondLifeHost.OnStateChange += new SecondLifeHost.SecondLifeHostMessageHandler(host_OnStateChange); + + SecondLifeHost.State("default", true); + + return true; + } + + public bool Compile(EditForm editForm) + { + this.editForm = editForm; + + ResetScriptEvent = new AutoResetEvent(false); + ResetScriptWatcher = new Thread(new ThreadStart(ResetScriptWatch)); + ResetScriptWatcher.Name = "ResetScriptWatch"; + ResetScriptWatcher.IsBackground = true; + ResetScriptWatcher.Start(); + + CSharpCode = MakeSharp(editForm.ConfLSL, editForm.SourceCode); + + return GetNewHost(); + } + + private void SecondLifeHost_OnReset(object sender, EventArgs e) + { + this.ResetScriptEvent.Set(); + } + + private void ResetScriptWatch() + { + while (true) + { + this.ResetScriptEvent.WaitOne(); + + SecondLifeHost.Dispose(); + GetNewHost(); + } + } + + private delegate void AddListenChannelsDelegate(ComboBox comboBox, string[] channels); + private void AddListenChannelsToComboxBox(ComboBox comboBox, string[] channels) + { + if (comboBox.InvokeRequired) + { + comboBox.Invoke(new AddListenChannelsDelegate(AddListenChannelsToComboxBox), + new object[] { comboBox , channels }); + } + else + { + comboBox.Items.Clear(); + comboBox.Items.AddRange(channels); + comboBox.SelectedIndex = 0; + } + } + private void SecondLifeHost_OnListenChannelsChanged(object sender, EventArgs e) + { + foreach (Control control in this.panel4.Controls) + { + GroupboxEvent gbe = control as GroupboxEvent; + if (gbe == null) + continue; + foreach (Control control1 in gbe.Controls) + { + GroupBox gb = control1 as GroupBox; + if (gb == null) + continue; + if (gb.Name!="listen_0") + continue; + ComboBox comboBox = gb.Controls[0] as ComboBox; + AddListenChannelsToComboxBox(comboBox, SecondLifeHost.GetListenChannels()); + } + } + } + + void host_OnDie(object sender, EventArgs e) + { + if(this.panel1.InvokeRequired) + { + // using Evenhandler definition as a delegate + this.panel1.Invoke(new EventHandler(host_OnDie)); + } + else + { + this.panel1.Enabled = false; + } + } + + private void host_OnStateChange(object sender, SecondLifeHostEventArgs e) + { + ShowLifeEvents(); + SetStateCombobox(e.Message); + } + + private delegate void SetStateComboboxDelegate(string strName); + public void SetStateCombobox(string strName) + { + if (this.comboBox1.InvokeRequired) + { + this.comboBox1.Invoke(new SetStateComboboxDelegate(SetStateCombobox), new object[] { strName }); + } + else + { + for (int intI = 0; intI < this.comboBox1.Items.Count; intI++) + { + if (this.comboBox1.Items[intI].ToString() == strName) + { + this.comboBox1.SelectedIndex = intI; + break; + } + } + } + } + + private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e) + { + if (SecondLifeHost == null) + return; + string strStateName = (string)this.comboBox1.Items[this.comboBox1.SelectedIndex]; + if (strStateName != "") + { + if (SecondLifeHost.CurrentStateName != strStateName) + SecondLifeHost.State(strStateName,true); + } + } + + private void host_OnVerboseMessage(object sender, SecondLifeHostEventArgs e) + { + VerboseConsole(e.Message); + } + + private string MakeSharp(XmlDocument xml, string strC) + { + this.comboBox1.Items.Clear(); + this.comboBox1.Items.Add(""); + this.comboBox1.SelectedIndex = 0; + + // xml is needed for making events buttons + LSL2CSharp translator = new LSL2CSharp(xml); + + strC = translator.Parse(strC); + + foreach (string strState in translator.States) + { + this.comboBox1.Items.Add(strState); + } + return strC; + } + + private delegate void ShowLifeEventsDelegate(); + private void ShowLifeEvents() + { + if (this.panel4.InvokeRequired) + { + this.panel4.Invoke(new ShowLifeEventsDelegate(ShowLifeEvents), null); + } + else + { + int intX = 8; + int intY = 0; + + this.panel4.Controls.Clear(); + foreach (string strEventName in SecondLifeHost.GetEvents()) + { + string strArgs = SecondLifeHost.GetArgumentsFromMethod(strEventName); + GroupboxEvent ge = new GroupboxEvent(new Point(intX, intY), strEventName, strArgs, new System.EventHandler(this.buttonEvent_Click)); + this.panel4.Controls.Add(ge); + intY += ge.Height; + } + } + } + + private delegate void AppendTextDelegate(string strLine); + + // Verbose + public void VerboseConsole(string strLine) + { + if (this.textBox2.IsDisposed) + return; + if (this.textBox2.InvokeRequired) + { + this.textBox2.Invoke(new AppendTextDelegate(VerboseConsole), new object[] { strLine }); + } + else + { + this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n"); + } + } + + private string GetArgumentValue(string strName) + { + foreach (Control parent in this.panel4.Controls) + { + if (parent.Name == "GroupboxTextbox") + { + foreach (Control c in parent.Controls) + { + if (c.Name == strName) + return c.Controls[0].Text; + } + } + } + return ""; + } + + private object[] GetArguments(string strName, string strArgs) + { + if (strArgs == "") + return new object[0]; + + try + { + string[] args = strArgs.Trim().Split(new char[] { ',' }); + object[] argobjects = new object[args.Length]; + for (int intI = 0; intI < argobjects.Length; intI++) + { + string[] argument = args[intI].Trim().Split(new char[] { ' ' }); + if (argument.Length == 2) + { + string[] arArgs; + string strArgumentValue = GetArgumentValue(strName + "_" + intI); + string strArgumentName = argument[1]; + string strArgumentType = argument[0]; + switch (strArgumentType) + { + case "System.String": + argobjects[intI] = strArgumentValue; + break; + case "System.Int32": + argobjects[intI] = int.Parse(strArgumentValue); + break; + case "LSLEditor.SecondLife+Float": + argobjects[intI] = new SecondLife.Float(strArgumentValue); + break; + case "LSLEditor.SecondLife+integer": + argobjects[intI] = new SecondLife.integer(int.Parse(strArgumentValue)); + break; + case "LSLEditor.SecondLife+String": + argobjects[intI] = new SecondLife.String(strArgumentValue); + break; + case "LSLEditor.SecondLife+key": + argobjects[intI] = new SecondLife.key(strArgumentValue); + break; + case "LSLEditor.SecondLife+list": + argobjects[intI] = new SecondLife.list(new string[] { strArgumentValue } ); + break; + case "LSLEditor.SecondLife+rotation": + arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); + argobjects[intI] = new SecondLife.rotation(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]), double.Parse(arArgs[3])); + break; + case "LSLEditor.SecondLife+vector": + arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); + argobjects[intI] = new SecondLife.vector(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2])); + break; + default: + MessageBox.Show("Compiler->GetArguments->[" + strArgumentType + "][" + strArgumentName + "]"); + argobjects[intI] = null; + break; + } + } + else + { + MessageBox.Show("Argument must be 'type name' [" + args[intI] + "]"); + break; + } + } + return argobjects; + } + catch + { + return new object[0]; + } + } + + private void buttonEvent_Click(object sender, System.EventArgs e) + { + Button button = (Button)sender; + string strName = button.Text; + string strArgs = SecondLifeHost.GetArgumentsFromMethod(strName); + object[] args = GetArguments(strName, strArgs); + //SecondLifeHost.VerboseEvent(strName, args); + SecondLifeHost.ExecuteSecondLife(strName, args); + } + + private void Die() + { + if (this.SecondLifeHost != null) + this.SecondLifeHost.Die(); + } + + // Die + private void button1_Click(object sender, EventArgs e) + { + Die(); + } + + private void textBox2_KeyDown(object sender, KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.A) + this.textBox2.SelectAll(); + } + + private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.SelectAll(); + } + + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.Copy(); + } + + private void clearToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.Clear(); + } + + } +} diff --git a/RuntimeConsole.resx b/RuntimeConsole.resx new file mode 100644 index 0000000..ee8866e --- /dev/null +++ b/RuntimeConsole.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/SecondLife/Float.cs b/SecondLife/Float.cs new file mode 100644 index 0000000..0be5190 --- /dev/null +++ b/SecondLife/Float.cs @@ -0,0 +1,272 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct Float + { + private object m_value; + private Double value + { + get + { + if (m_value == null) + m_value = (Double)0; + return (Double)m_value; + } + set + { + m_value = value; + } + } + public Float(Double a) + { + this.m_value = a; + } + + #region public Float(string s) + public Float(string s) + { + Regex r = new Regex(@"\A[ ]*(?[+-]?) + (?: + (?: + 0x + (?: + (?: + (?[0-9a-f]*) + (?: + (?:\. + (?[0-9a-f]*) + ) + | + ) + ) + (?: + (?:p + (?[-+]?[\d]*) + ) + | + ) + ) + ) + | + (? + [\d]*[.]?[\d]* + (?: + (?: + e[+-]?[\d]* + ) + | + ) + ) + )", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); + Match m = r.Match(s); + Double mantissa = 0.0; + if (r.Match(s).Groups["dec"].Value.Length > 0) + mantissa = Convert.ToDouble(r.Match(s).Groups["dec"].Value); + if (m.Groups["int"].Success) + { + if (m.Groups["int"].Value.Length > 0) + { + // System.Console.WriteLine("i:\t" + m.Groups["int"].Value); + mantissa = Convert.ToInt64(m.Groups["int"].Value, 16); + } + if (m.Groups["frac"].Value.Length > 0) + { + // System.Console.WriteLine("f:\t"+m.Groups["frac"].Value); + mantissa += Convert.ToInt64(m.Groups["frac"].Value, 16) / Math.Pow(16.0, m.Groups["frac"].Value.Length); + } + if (m.Groups["exp"].Value.Length > 0) + { + // System.Console.WriteLine("e:\t" + m.Groups["exp"].Value); + mantissa *= Math.Pow(2.0, Convert.ToInt64(m.Groups["exp"].Value, 10)); + } + } + if (m.Groups["sign"].Value == "-") + this.m_value = -mantissa; + else + this.m_value = mantissa; + } +#endregion + + public override int GetHashCode() + { + return (int)this.value % System.Int32.MaxValue; + } + + public override string ToString() + { + return string.Format("{0:0.000000}",this.value); + } + + public static explicit operator String(Float x) + { + return x.ToString(); + } + + public static implicit operator Double(Float x) + { + return x.value; + } + + //public static implicit operator integer(Float x) + //{ + // return (int)x.value; + //} + + public static explicit operator Float(string s) + { + return new Float(s); + } + + public static explicit operator Float(String s) + { + return new Float(s.ToString()); + } + + public static implicit operator Float(Int32 x) + { + return new Float((Double)x); + } + + // 6 jan 2008 , does this work???? + public static implicit operator Float(long x) + { + return new Float((int)(uint)x); + } + + public static implicit operator Float(Double x) + { + return new Float(x); + } + + public static implicit operator Float(integer x) + { + return new Float((Double)x); + } + + public static Float operator *(Float a, Float b) + { + return new Float(a.value * b.value); + } + + public static Float operator /(Float a, Float b) + { + return new Float(a.value / b.value); + } + + public static Float operator ++(Float a) + { + return new Float(a.value + 1.0); + } + + public static Float operator --(Float a) + { + return new Float(a.value - 1.0); + } + + public static Float operator +(Float a, Float b) + { + return new Float(a.value + b.value); + } + + public static Float operator -(Float a, Float b) + { + return new Float(a.value - b.value); + } + + public static explicit operator bool(Float a) + { + return (Math.Abs(a.value) >= Double.Epsilon); + } + + public static bool operator true(Float a) + { + return (Math.Abs(a.value) >= Double.Epsilon); + } + + public static bool operator false(Float a) + { + return (Math.Abs(a.value) < Double.Epsilon); + } + + public static bool operator ==(Float x, Float y) + { + return (Math.Abs(x.value - y.value) < Double.Epsilon); + } + + public static bool operator !=(Float x, Float y) + { + return !(x == y); + } + + public static int Compare(Float a, Float b) + { + if (a.value < b.value) + return -1; + if (a.value > b.value) + return 1; + return 0; + } + + + public override bool Equals(object o) + { + try + { + return (bool)(this == (Float)o); + } + catch + { + return false; + } + } + + } + } +} diff --git a/SecondLife/SecondLifeHst.cs b/SecondLife/SecondLifeHst.cs new file mode 100644 index 0000000..368956d --- /dev/null +++ b/SecondLife/SecondLifeHst.cs @@ -0,0 +1,948 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Reflection; +using System.Collections; +using System.Collections.Generic; + +using System.Windows.Forms; + +using LSLEditor.Helpers; + +namespace LSLEditor +{ + public class SecondLifeHostEventArgs : EventArgs + { + public string Message; + public SecondLifeHostEventArgs(string Message) + { + this.Message = Message; + } + } + + public class SecondLifeHostMessageLinkedEventArgs : EventArgs + { + public SecondLife.integer linknum; + public SecondLife.integer num; + public SecondLife.String str; + public SecondLife.key id; + + public SecondLifeHostMessageLinkedEventArgs(SecondLife.integer linknum, SecondLife.integer num, SecondLife.String str, SecondLife.key id) + { + this.linknum = linknum; + this.num = num; + this.str = str; + this.id = id; + } + } + + public class SecondLifeHostChatEventArgs : EventArgs + { + public SecondLife.integer channel; + public SecondLife.String name; + public SecondLife.key id; + public SecondLife.String message; + public CommunicationType how; + + public SecondLifeHostChatEventArgs(SecondLife.integer channel, SecondLife.String name, SecondLife.key id, SecondLife.String message, CommunicationType how) + { + this.channel = channel; + this.name = name; + this.id = id; + this.message = message; + this.how = how; + } + } + + public class SecondLifeHost : IDisposable + { + private List ListenFilterList; + + private List LinkList; + + private SecondLife secondLife; + private TaskQueue taskQueue; + private AutoResetEvent StateChanged; + private Thread StateWatcher; + + private LSLEditorForm mainForm; + private Assembly CompiledAssembly; + + public string FullPath; + public Guid guid; + + public delegate void SecondLifeHostMessageHandler(object sender, SecondLifeHostEventArgs e); + public event SecondLifeHostMessageHandler OnVerboseMessage; + public event SecondLifeHostMessageHandler OnStateChange; + + public delegate void SecondLifeHostChatHandler(object sender, SecondLifeHostChatEventArgs e); + public event SecondLifeHostChatHandler OnChat; + + public delegate void SecondLifeHostMessageLinkedHandler(object sender, SecondLifeHostMessageLinkedEventArgs e); + public event SecondLifeHostMessageLinkedHandler OnMessageLinked; + + public event EventHandler OnDie; + public event EventHandler OnReset; + + public event EventHandler OnListenChannelsChanged; + + public System.Timers.Timer timer; + + public System.Timers.Timer sensor_timer; + + public string CurrentStateName; + private string NewStateName; + + private string ObjectName; + private string ObjectDescription; + + public SecondLifeHost(LSLEditorForm mainForm, Assembly CompiledAssembly, string FullPath, Guid guid) + { + this.ListenFilterList = null; + this.LinkList = null; + this.secondLife = null; + this.taskQueue = new TaskQueue(); + this.StateChanged = new AutoResetEvent(false); + this.StateWatcher = new Thread(new ThreadStart(StateWatch)); + this.StateWatcher.Name = "StateWatch"; + this.StateWatcher.IsBackground = true; + this.StateWatcher.Start(); + + this.mainForm = mainForm; + this.CompiledAssembly = CompiledAssembly; + this.FullPath = FullPath; + this.guid = guid; + + this.ObjectName = Path.GetFileNameWithoutExtension(this.FullPath); + this.ObjectDescription = ""; + + this.timer = new System.Timers.Timer(); + this.timer.AutoReset = true; + this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); + + this.sensor_timer = new System.Timers.Timer(); + this.sensor_timer.AutoReset = true; + this.sensor_timer.Elapsed += new System.Timers.ElapsedEventHandler(sensor_timer_Elapsed); + + this.NewStateName = "default"; + this.CurrentStateName = ""; + } + + private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + { + ExecuteSecondLife("timer"); + } + + private void StateWatch() + { + while (true) + { + this.StateChanged.WaitOne(); + this.taskQueue.Start(); // is implicit Stop() old Queue + if (this.CurrentStateName != this.NewStateName) + { + this.CurrentStateName = this.NewStateName; + ExecuteSecondLife("state_exit"); + + // Changing to CurrentStateName on this thread! (not ExecuteSecondLife) + this.taskQueue.Invoke(this, "SetState"); + } + } + } + + public void State(string strStateName, bool blnForce) + { + if (this.CompiledAssembly == null) + return; + if (blnForce) + this.CurrentStateName = ""; + this.NewStateName = strStateName; + this.StateChanged.Set(); + } + + private void SetState() + { + if (CompiledAssembly == null) + return; + secondLife = CompiledAssembly.CreateInstance("LSLEditor.State_" + CurrentStateName) as SecondLife; + + if (secondLife == null) + { + MessageBox.Show("State " + CurrentStateName+" does not exist!"); + return; + } + + ListenFilterList = new List(); + + LinkList = new List(); + + // Make friends + secondLife.host = this; + + // Update runtime userinterface by calling event handler + if (OnStateChange != null) + OnStateChange(this, new SecondLifeHostEventArgs(CurrentStateName)); + + ExecuteSecondLife("state_entry"); + } + + public string GetArgumentsFromMethod(string strName) + { + if (this.secondLife == null) + return ""; + MethodInfo mi = secondLife.GetType().GetMethod(strName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); + if (mi == null) + return ""; + + int intI = 0; + string strArgs = ""; + foreach (ParameterInfo pi in mi.GetParameters()) + { + if (intI > 0) + strArgs += ","; + strArgs += pi.ParameterType.ToString() + " " + pi.Name; + intI++; + } + return strArgs; + } + + public void VerboseEvent(string strEventName, object[] args) + { + StringBuilder sb = new StringBuilder(); + sb.Append("*** "); + sb.Append(strEventName); + sb.Append('('); + for (int intI = 0; intI < args.Length; intI++) + { + if (intI > 0) + sb.Append(','); + sb.Append(args[intI].ToString()); + } + sb.Append(")"); + VerboseMessage(sb.ToString()); + } + + public void ExecuteSecondLife(string strName, params object[] args) + { + if (secondLife == null) + return; + + VerboseEvent(strName, args); + + this.taskQueue.Invoke(secondLife, strName, args); + } + + public ArrayList GetEvents() + { + ArrayList ar = new ArrayList(); + if (secondLife != null) + { + foreach (MethodInfo mi in secondLife.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + ar.Add(mi.Name); + } + } + ar.Sort(); + return ar; + } + + public void Reset() + { + if (OnReset != null) + OnReset(this, new EventArgs()); + } + + public void Die() + { + if (OnDie != null) + OnDie(this, new EventArgs()); + + if (secondLife != null) + { + // stop all timers + this.timer.Stop(); + this.sensor_timer.Stop(); + + this.taskQueue.Stop(); + this.taskQueue.Dispose(); + this.taskQueue = null; + + this.secondLife = null; + } + + } + + public void Dispose() + { + if (taskQueue != null) + { + this.taskQueue.Stop(); + this.taskQueue.Dispose(); + this.taskQueue = null; + } + if (listXmlRpc != null) + { + foreach (XMLRPC xmlRpc in listXmlRpc) + { + xmlRpc.CloseChannel(); + } + } + if (secondLife != null) + { + this.timer.Stop(); + this.sensor_timer.Stop(); + this.mainForm = null; + this.secondLife = null; + } + } + + + #region Link functions + private struct Link + { + public int number; + public string name; + public SecondLife.key id; + public SecondLife.key target; + public Link(int number, string name, SecondLife.key id, SecondLife.key target) + { + this.number = number; + this.name = name; + this.id = id; + this.target = target; + } + } + + public void llBreakAllLinks() + { + LinkList = new List(); + } + + public void llBreakLink(int linknum) + { + foreach (Link link in this.LinkList) + { + if (link.number == linknum) + { + this.LinkList.Remove(link); + break; + } + } + } + + #endregion + + #region Listen functions + + public string[] GetListenChannels() // for GroupboxEvent + { + List list = new List(); + foreach (ListenFilter lf in ListenFilterList) + { + list.Add(lf.channel.ToString()); + } + return list.ToArray(); + } + + private struct ListenFilter + { + public int channel; + public string name; + public SecondLife.key id; + public string message; + public bool active; + public ListenFilter(int channel, string name, SecondLife.key id, string message) + { + this.channel = channel; + this.name = name; + this.id = id; + this.message = message; + this.active = true; + } + } + + public void llListenControl(int number, int active) + { + for (int intI = 0; intI < ListenFilterList.Count; intI++) + { + ListenFilter lf = ListenFilterList[intI]; + if (lf.GetHashCode() == number) + { + lf.active = (active == 1); + ListenFilterList[intI] = lf; + break; + } + } + } + + public void llListenRemove(int intHandle) + { + for (int intI = 0; intI < ListenFilterList.Count; intI++) + { + ListenFilter lf = ListenFilterList[intI]; + if (lf.GetHashCode() == intHandle) + { + ListenFilterList.RemoveAt(intI); + break; + } + } + } + + public int llListen(int channel, string name, SecondLife.key id, string message) + { + if (ListenFilterList.Count >= 64) + { + Chat(this, 0, "LSLEditor", SecondLife.NULL_KEY, "Maximum of 64 listens!!!", CommunicationType.Shout); + return 0; + } + ListenFilter lf = new ListenFilter(channel, name, id, message); + ListenFilterList.Add(lf); + if (OnListenChannelsChanged != null) + OnListenChannelsChanged(this, null); + return lf.GetHashCode(); + } + + private bool CheckListenFilter(int channel, string name, SecondLife.key id, string message) + { + ListenFilter lfToCheck = new ListenFilter(channel, name, id, message); + + foreach (ListenFilter lf in ListenFilterList) + { + if (!lf.active) + continue; + if (lf.channel != lfToCheck.channel) + continue; + if (lf.name != "" && lf.name != lfToCheck.name) + continue; + if (lf.id != Guid.Empty.ToString() && lf.id!="" && lf.id != lfToCheck.id) + continue; + if (lf.message != "" && lf.message != lfToCheck.message) + continue; + return true; + } + return false; + } + + // sink listen + public void Listen(SecondLifeHostChatEventArgs e) + { + if (secondLife == null) + return; + if (CheckListenFilter(e.channel, e.name, e.id, e.message)) + ExecuteSecondLife("listen", e.channel, e.name, e.id, e.message); + } + + #endregion + + // raise + public void Chat(object sender, int channel, string name, SecondLife.key id, string message, CommunicationType how) + { + if (OnChat != null) + OnChat(sender, new SecondLifeHostChatEventArgs(channel, name, id, message, how)); + } + + // raise + public void MessageLinked(SecondLife.integer linknum, SecondLife.integer num, SecondLife.String str, SecondLife.key id) + { + if (OnMessageLinked != null) + OnMessageLinked(this, new SecondLifeHostMessageLinkedEventArgs(linknum, num, str, id)); + } + + // sink + public void LinkMessage(SecondLifeHostMessageLinkedEventArgs e) + { + ExecuteSecondLife("link_message", e.linknum, e.num, e.str, e.id); + } + + + public SecondLife.key Http(string Url, SecondLife.list Parameters, string Body) + { + if (secondLife == null) + return SecondLife.NULL_KEY; + + System.Net.WebProxy proxy = null; + if (Properties.Settings.Default.ProxyServer != "") + proxy = new System.Net.WebProxy(Properties.Settings.Default.ProxyServer.Replace("http://", "")); + + if (Properties.Settings.Default.ProxyUserid != "" && proxy != null) + proxy.Credentials = new System.Net.NetworkCredential(Properties.Settings.Default.ProxyUserid, Properties.Settings.Default.ProxyPassword); + + SecondLife.key Key = new SecondLife.key(Guid.NewGuid()); + //WebRequestClass a = new WebRequestClass(proxy, secondLife, Url, Parameters, Body, Key); + try + { + HTTPRequest.Request(proxy, secondLife, Url, Parameters, Body, Key); + } + catch(Exception exception) + { + VerboseMessage(exception.Message); + } + return Key; + } + + public void Email(string To, string Subject, string Body) + { + if (secondLife == null) + return; + + SmtpClient client = new SmtpClient(); + client.SmtpServer = Properties.Settings.Default.EmailServer; + + string strName = GetObjectName(); + string strObjectName = string.Format("Object-Name: {0}", strName); + + SecondLife.vector RegionCorner = secondLife.llGetRegionCorner(); + string strRegionName = secondLife.llGetRegionName(); + string strRegion = string.Format("Region: {0} ({1},{2})", strRegionName, RegionCorner.x, RegionCorner.y); + + SecondLife.vector pos = secondLife.llGetPos(); + string strPosition = string.Format("Local-Position: ({0},{1},{2})", (int)pos.x, (int)pos.y, (int)pos.z); + + string strPrefix = strObjectName + "\r\n"; + strPrefix += strRegion + "\r\n"; + strPrefix += strPosition + "\r\n\r\n"; + + MailMessage msg = new MailMessage(); + msg.To = To; + msg.Subject = Subject; + msg.Body = strPrefix + Body; + msg.From = Properties.Settings.Default.EmailAddress; + msg.Headers.Add("Reply-to", msg.From); + + //MailAttachment myAttachment = new MailAttachment(strAttachmentFile); + //msg.Attachments.Add(myAttachment); + + VerboseMessage(client.Send(msg)); + } + + public void VerboseMessage(string Message) + { + if (OnVerboseMessage != null) + OnVerboseMessage(this, new SecondLifeHostEventArgs(Message)); + } + + delegate void ShowDialogDelegate(SecondLifeHost host, + SecondLife.String objectName, + SecondLife.key k, + SecondLife.String name, + SecondLife.String message, + SecondLife.list buttons, + SecondLife.integer channel); + private void Dialog(SecondLifeHost host, + SecondLife.String objectName, + SecondLife.key k, + SecondLife.String name, + SecondLife.String message, + SecondLife.list buttons, + SecondLife.integer channel) + { + llDialogForm DialogForm = new llDialogForm(host, objectName, k, name, message, buttons, channel); + DialogForm.Left = this.mainForm.Right - DialogForm.Width - 5; + DialogForm.Top = this.mainForm.Top + 30; + DialogForm.Show(this.mainForm); + this.mainForm.llDialogForms.Add(DialogForm); + } + + public void llDialog(SecondLife.key avatar, SecondLife.String message, SecondLife.list buttons, SecondLife.integer channel) + { + if (message.ToString().Length >= 512) + { + VerboseMessage("llDialog: message too long, must be less than 512 characters"); + return; + } + if (message.ToString().Length == 0) + { + VerboseMessage("llDialog: must supply a message"); + return; + } + for (int intI = 0; intI < buttons.Count; intI++) + { + if (buttons[intI].ToString() == "") + { + VerboseMessage("llDialog: all buttons must have label strings"); + return; + } + if (buttons[intI].ToString().Length > 24) + { + VerboseMessage("llDialog:Button Labels can not have more than 24 characters"); + return; + } + } + + if (buttons.Count == 0) + buttons = new SecondLife.list(new string[] { "OK" }); + + this.mainForm.Invoke(new ShowDialogDelegate(Dialog), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, buttons, channel); + } + + public void SetPermissions(SecondLife.integer intPermissions) + { + ExecuteSecondLife("run_time_permissions", intPermissions); + } + + delegate void RequestPermissionsDelegate( + SecondLifeHost host, + SecondLife.String objectName, + SecondLife.key k, + SecondLife.String name, + SecondLife.key agent, + SecondLife.integer intPermissions); + private void RequestPermissions( + SecondLifeHost host, + SecondLife.String objectName, + SecondLife.key k, + SecondLife.String name, + SecondLife.key agent, + SecondLife.integer intPermissions) + { + PermissionsForm PermissionForm = new PermissionsForm(this, GetObjectName(), secondLife.llGetOwner(), Properties.Settings.Default.AvatarName, agent, intPermissions); + PermissionForm.Left = this.mainForm.Right - PermissionForm.Width - 5; + PermissionForm.Top = this.mainForm.Top + 30; + PermissionForm.Show(this.mainForm); + this.mainForm.PermissionForms.Add(PermissionForm); + } + + public void llRequestPermissions(SecondLife.key agent, SecondLife.integer intPermissions) + { + this.mainForm.Invoke(new RequestPermissionsDelegate(RequestPermissions), + this, + (SecondLife.String)GetObjectName(), + secondLife.llGetOwner(), + (SecondLife.String)Properties.Settings.Default.AvatarName, + agent, + intPermissions); + } + + private int m_intControls = -1; + + public void SendControl(Keys keys) + { + if (m_intControls < 0) + return; + if (this.secondLife == null) + return; + + // check againt m_intControls TODO!!!!! + + int held = 0; + int change = 0; + + if ((keys & Keys.Up) == Keys.Up) + held |= SecondLife.CONTROL_UP; + if ((keys & Keys.Down) == Keys.Down) + held |= SecondLife.CONTROL_DOWN; + if ((keys & Keys.Left) == Keys.Left) + held |= SecondLife.CONTROL_LEFT; + if ((keys & Keys.Right) == Keys.Right) + held |= SecondLife.CONTROL_RIGHT; + + ExecuteSecondLife("control", (SecondLife.key)Properties.Settings.Default.AvatarKey, (SecondLife.integer)held, (SecondLife.integer)change); + } + + public void TakeControls(int intControls, int accept, int pass_on) + { + this.m_intControls = intControls; + } + + public void ReleaseControls() + { + this.m_intControls = -1; + } + + #region Notecards + private void GetNotecardLineWorker(SecondLife.key k, string strPath, int line) + { + StreamReader sr = new StreamReader(strPath); + int intI = 0; + string strData = SecondLife.EOF; + while (!sr.EndOfStream) + { + string strLine = sr.ReadLine(); + if (intI == line) + { + strData = strLine; + break; + } + intI++; + } + sr.Close(); + ExecuteSecondLife("dataserver", k, (SecondLife.String)strData); + } + + public SecondLife.key GetNotecardLine(string name, int line) + { + string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name); + if(strPath == string.Empty) + strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name); + if (!File.Exists(strPath)) + { + VerboseMessage("Notecard: " + strPath + " not found"); + taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name)); + return SecondLife.NULL_KEY; + } + SecondLife.key k = new SecondLife.key(Guid.NewGuid()); + taskQueue.Invoke(this, "GetNotecardLineWorker", k, strPath, line); + return k; + } + + + private void GetNumberOfNotecardLinesWorker(SecondLife.key k, string strPath) + { + StreamReader sr = new StreamReader(strPath); + int intI = 0; + while (!sr.EndOfStream) + { + string strLine = sr.ReadLine(); + intI++; + } + sr.Close(); + ExecuteSecondLife("dataserver", k, (SecondLife.String)intI.ToString()); + } + + + public SecondLife.key GetNumberOfNotecardLines(string name) + { + string strPath = mainForm.SolutionExplorer.GetPath(this.guid, name); + if (strPath == string.Empty) + strPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), name); + + if (!File.Exists(strPath)) + { + VerboseMessage("Notecard: " + strPath + " not found"); + taskQueue.Invoke(secondLife, "llSay", (SecondLife.integer)0, (SecondLife.String)("Couldn't find notecard " + name)); + return SecondLife.NULL_KEY; + } + SecondLife.key k = new SecondLife.key(Guid.NewGuid()); + taskQueue.Invoke(this, "GetNumberOfNotecardLinesWorker", k, strPath); + return k; + } + #endregion + + #region XML-RPC + + private List listXmlRpc; + public void llOpenRemoteDataChannel() + { + if (listXmlRpc == null) + listXmlRpc = new List(); + XMLRPC xmlRpc = new XMLRPC(); + xmlRpc.OnRequest += new XMLRPC.RequestEventHandler(xmlRpc_OnRequest); + xmlRpc.OpenChannel(listXmlRpc.Count); + listXmlRpc.Add(xmlRpc); + ExecuteSecondLife("remote_data", + SecondLife.REMOTE_DATA_CHANNEL, + xmlRpc.guid, + new SecondLife.key(Guid.NewGuid()), + (SecondLife.String)("LSLEditor"), + (SecondLife.integer)(0), + (SecondLife.String)("Listening on " + xmlRpc.Prefix)); + } + + void xmlRpc_OnRequest(object sender, XmlRpcRequestEventArgs e) + { + XMLRPC xmlRpc = sender as XMLRPC; + + ExecuteSecondLife("remote_data", + SecondLife.REMOTE_DATA_REQUEST, + e.channel, + e.message_id, + e.sender, + e.iData, + e.sData); + } + + public void llCloseRemoteDataChannel(SecondLife.key channel) + { + if (listXmlRpc == null) + return; + foreach (XMLRPC xmlRpc in listXmlRpc) + { + if (xmlRpc.guid == channel.guid) + { + xmlRpc.CloseChannel(); + break; + } + } + } + public void llRemoteDataReply(SecondLife.key channel, SecondLife.key message_id, string sdata, int idata) + { + if (listXmlRpc == null) + return; + foreach (XMLRPC xmlRpc in listXmlRpc) + { + if (xmlRpc.guid == channel.guid) + { + xmlRpc.RemoteDataReply(channel.guid, message_id.guid, sdata, idata); + break; + } + } + } + + // Wiki sais this is not working in InWorld + public SecondLife.key llSendRemoteData(SecondLife.key channel, string dest, int idata, string sdata) + { + XMLRPC xmlRpc = new XMLRPC(); + xmlRpc.OnReply += new XMLRPC.RequestEventHandler(xmlRpc_OnReply); + SecondLife.key message_id = xmlRpc.SendRemoteData(channel, dest, idata, sdata); + return message_id; + } + + // Wiki sais currently disabled + void xmlRpc_OnReply(object sender, XmlRpcRequestEventArgs e) + { + ExecuteSecondLife("remote_data", + SecondLife.REMOTE_DATA_REPLY, + e.channel, + e.message_id, + (SecondLife.String)"", // Wiki + e.iData, + e.sData); + } + #endregion + + public string GetObjectName(Guid guid) + { + string strObjectName = mainForm.SolutionExplorer.GetObjectName(guid); + if (strObjectName != string.Empty) + return strObjectName; + else + return this.ObjectName; + } + + public string GetObjectName() + { + return GetObjectName(this.guid); + } + + public void SetObjectName(string name) + { + if (!mainForm.SolutionExplorer.SetObjectName(this.guid, name)) + ObjectName = name; + } + + public string GetObjectDescription(Guid guid) + { + string strObjectDescription = mainForm.SolutionExplorer.GetObjectDescription(guid); + if (strObjectDescription != string.Empty) + return strObjectDescription; + else + return this.ObjectDescription; + } + + public string GetObjectDescription() + { + return GetObjectDescription(this.guid); + } + + public void SetObjectDescription(string description) + { + if (!mainForm.SolutionExplorer.SetObjectDescription(this.guid, description)) + this.ObjectDescription = description; + } + + public string GetScriptName() + { + string strScriptName = mainForm.SolutionExplorer.GetScriptName(this.guid); + if (strScriptName == string.Empty) + strScriptName = this.FullPath; + if (Properties.Settings.Default.llGetScriptName) + strScriptName = Path.GetFileNameWithoutExtension(strScriptName); + else + strScriptName = Path.GetFileName(strScriptName); + return strScriptName; + } + + public SecondLife.key GetKey() + { + string strGuid = mainForm.SolutionExplorer.GetKey(this.guid); + if (strGuid == string.Empty) + return new SecondLife.key(this.guid); + return new SecondLife.key(strGuid); + } + + public SecondLife.String GetInventoryName(SecondLife.integer type, SecondLife.integer number) + { + string strInventoryName = mainForm.SolutionExplorer.GetInventoryName(this.guid, type, number); + if (strInventoryName == string.Empty) + return "**GetInventoryName only works in SolutionExplorer**"; + return strInventoryName; + } + + public SecondLife.key GetInventoryKey(SecondLife.String name) + { + string strInventoryKey = mainForm.SolutionExplorer.GetInventoryKey(this.guid, name); + if (strInventoryKey == string.Empty) + return new SecondLife.key(Guid.Empty); + return new SecondLife.key(strInventoryKey); + } + + public SecondLife.integer GetInventoryNumber(SecondLife.integer type) + { + return mainForm.SolutionExplorer.GetInventoryNumber(this.guid, type); + } + + public SecondLife.integer GetInventoryType(SecondLife.String name) + { + return mainForm.SolutionExplorer.GetInventoryType(this.guid, name); + } + + public System.Media.SoundPlayer GetSoundPlayer(string sound) + { + string strPath = mainForm.SolutionExplorer.GetPath(this.guid, sound); + if (strPath == string.Empty) + strPath = sound; + return new System.Media.SoundPlayer(strPath); + } + + private void sensor_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + { + SecondLife.integer total_number = 1; + ExecuteSecondLife("sensor", total_number); + } + + } +} diff --git a/SecondLife/SecondLifeMain.cs b/SecondLife/SecondLifeMain.cs new file mode 100644 index 0000000..874ae94 --- /dev/null +++ b/SecondLife/SecondLifeMain.cs @@ -0,0 +1,3800 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; + +// +// (C) 2006,2007 Alphons van der Heijden +// mail: alphons@heijden.com +// + +namespace LSLEditor +{ + public enum CommunicationType + { + Whisper, Say, Shout, OwnerSay, RegionSay + } + + public partial class SecondLife + { + // Make friends with my host + public SecondLifeHost host; + + #region members + // Random generator + private Random m_random; + + private DateTime m_DateTimeScriptStarted; + + private Hashtable m_LandPassList; + + private Hashtable m_LandBanList; + + private Float m_Volume; + + private String m_ObjectName; + private vector m_pos; + private rotation m_rot; + private rotation m_rotlocal; + private vector m_scale; + private String m_SitText; + private Float m_SoundRadius; + + private vector m_RegionCorner; + + private integer m_start_parameter; + + #endregion + + #region constructor + public SecondLife() + { + host = null; + m_random = new Random(); + m_DateTimeScriptStarted = DateTime.Now.ToUniversalTime(); + m_LandPassList = new Hashtable(); + m_LandBanList = new Hashtable(); + m_Volume = 0.0; + m_ObjectName = null; + m_pos = new vector(127, 128, 20); + m_rot = rotation.ZERO_ROTATION; + m_rotlocal = rotation.ZERO_ROTATION; + m_scale = vector.ZERO_VECTOR; + m_SitText = "sittext"; + m_SoundRadius = 1.0; + m_start_parameter = 0; + + m_RegionCorner = vector.ZERO_VECTOR; + } + #endregion + + #region internal routines + private void Verbose(string strLine, params object[] parameters) + { + if(parameters.Length == 0) + host.VerboseMessage(strLine); + else + host.VerboseMessage(string.Format(strLine, parameters)); + } + + private void Chat(integer channel, string message, CommunicationType how) + { + host.Chat(host, channel, host.GetObjectName(), host.GetKey(), message, how); + } + + public void state(string strStateName) + { + Verbose("state->" + strStateName); + host.State(strStateName,false); + System.Threading.Thread.Sleep(1000); + System.Windows.Forms.MessageBox.Show("If you see this, something is wrong", "Oops..."); + } + #endregion + + #region events as virtuals, if one is used, use override + virtual public void at_rot_target(integer number, rotation target_rotation, rotation our_rotation) { } + virtual public void attach(key attached) { } + virtual public void changed(integer changed) { } + virtual public void collision(integer total_number) { } + virtual public void collision_end(integer total_number) { } + virtual public void collision_start(integer total_number) { } + virtual public void control(key name, integer levels, integer edges) { } + virtual public void dataserver(key requested, String data) { } + virtual public void email(String time, String address, String subject, String body, integer remaining) { } + virtual public void land_collision(vector position) { } + virtual public void land_collision_end(vector position) { } + virtual public void land_collision_start(vector position) { } + virtual public void link_message(integer sender_number, integer number, String message, key id) { } + virtual public void listen(integer channel, String name, key id, String message) { } + virtual public void money(key giver, integer amount) { } + virtual public void moving_end() { } + virtual public void moving_start() { } + virtual public void no_sensor() { } + virtual public void not_at_rot_target() { } + virtual public void not_at_target() { } + virtual public void at_target(integer tnum, vector targetpos, vector ourpos) { } + virtual public void object_rez(key id) { } + virtual public void on_rez(integer start_param) { } + virtual public void run_time_permissions(integer permissions) { } + virtual public void sensor(integer total_number) { } + virtual public void state_entry() { } + virtual public void state_exit() { } + virtual public void timer() { } + virtual public void touch(integer total_number) { } + virtual public void touch_end(integer total_number) { } + virtual public void touch_start(integer total_number) { } + virtual public void remote_data(integer event_type, key channel, key message_id, String sender, integer idata, String sdata) { } + virtual public void http_response(key request_id, integer status, list metadata, String body) { } + #endregion + + #region all constants + public static readonly integer TRUE = 1; + public static readonly integer FALSE = 0; + + public static readonly integer STATUS_PHYSICS = 1; + public static readonly integer STATUS_ROTATE_X = 2; + public static readonly integer STATUS_ROTATE_Y = 4; + public static readonly integer STATUS_ROTATE_Z = 8; + public static readonly integer STATUS_PHANTOM = 16; + public static readonly integer STATUS_SANDBOX = 32; + public static readonly integer STATUS_BLOCK_GRAB = 64; + public static readonly integer STATUS_DIE_AT_EDGE = 128; + public static readonly integer STATUS_RETURN_AT_EDGE = 256; + public static readonly integer STATUS_CAST_SHADOWS = 512; + + + public static readonly integer AGENT = 1; + public static readonly integer ACTIVE = 2; + public static readonly integer PASSIVE = 4; + public static readonly integer SCRIPTED = 8; + + public static readonly integer PERMISSION_DEBIT = 2; + public static readonly integer PERMISSION_TAKE_CONTROLS = 4; + public static readonly integer PERMISSION_REMAP_CONTROLS = 8; + public static readonly integer PERMISSION_TRIGGER_ANIMATION = 16; + public static readonly integer PERMISSION_ATTACH = 32; + public static readonly integer PERMISSION_RELEASE_OWNERSHIP = 64; + public static readonly integer PERMISSION_CHANGE_LINKS = 128; + public static readonly integer PERMISSION_CHANGE_JOINTS = 256; + public static readonly integer PERMISSION_CHANGE_PERMISSIONS = 512; + public static readonly integer PERMISSION_TRACK_CAMERA = 1024; + public static readonly integer PERMISSION_CONTROL_CAMERA = 2048; + + public static readonly integer INVENTORY_ALL = -1; + public static readonly integer INVENTORY_NONE = -1; + public static readonly integer INVENTORY_TEXTURE = 0; + public static readonly integer INVENTORY_SOUND = 1; + public static readonly integer INVENTORY_LANDMARK = 3; + public static readonly integer INVENTORY_CLOTHING = 5; + public static readonly integer INVENTORY_OBJECT = 6; + public static readonly integer INVENTORY_NOTECARD = 7; + public static readonly integer INVENTORY_SCRIPT = 10; + public static readonly integer INVENTORY_BODYPART = 13; + public static readonly integer INVENTORY_ANIMATION = 20; + public static readonly integer INVENTORY_GESTURE = 21; + + public static readonly integer ATTACH_CHEST = 1; + public static readonly integer ATTACH_HEAD = 2; + public static readonly integer ATTACH_LSHOULDER = 3; + public static readonly integer ATTACH_RSHOULDER = 4; + public static readonly integer ATTACH_LHAND = 5; + public static readonly integer ATTACH_RHAND = 6; + public static readonly integer ATTACH_LFOOT = 7; + public static readonly integer ATTACH_RFOOT = 8; + public static readonly integer ATTACH_BACK = 9; + public static readonly integer ATTACH_PELVIS = 10; + public static readonly integer ATTACH_MOUTH = 11; + public static readonly integer ATTACH_CHIN = 12; + public static readonly integer ATTACH_LEAR = 13; + public static readonly integer ATTACH_REAR = 14; + public static readonly integer ATTACH_LEYE = 15; + public static readonly integer ATTACH_REYE = 16; + public static readonly integer ATTACH_NOSE = 17; + public static readonly integer ATTACH_RUARM = 18; + public static readonly integer ATTACH_RLARM = 19; + public static readonly integer ATTACH_LUARM = 20; + public static readonly integer ATTACH_LLARM = 21; + public static readonly integer ATTACH_RHIP = 22; + public static readonly integer ATTACH_RULEG = 23; + public static readonly integer ATTACH_RLLEG = 24; + public static readonly integer ATTACH_LHIP = 25; + public static readonly integer ATTACH_LULEG = 26; + public static readonly integer ATTACH_LLLEG = 27; + public static readonly integer ATTACH_BELLY = 28; + public static readonly integer ATTACH_RPEC = 29; + public static readonly integer ATTACH_LPEC = 30; + + public static readonly integer ATTACH_HUD_CENTER_2 = 31; + public static readonly integer ATTACH_HUD_TOP_RIGHT = 32; + public static readonly integer ATTACH_HUD_TOP_CENTER = 33; + public static readonly integer ATTACH_HUD_TOP_LEFT = 34; + public static readonly integer ATTACH_HUD_CENTER_1 = 35; + public static readonly integer ATTACH_HUD_BOTTOM_LEFT = 36; + public static readonly integer ATTACH_HUD_BOTTOM = 37; + public static readonly integer ATTACH_HUD_BOTTOM_RIGHT = 38; + + public static readonly integer LAND_LEVEL = 0; + public static readonly integer LAND_RAISE = 1; + public static readonly integer LAND_LOWER = 2; + public static readonly integer LAND_SMOOTH = 3; + public static readonly integer LAND_NOISE = 4; + public static readonly integer LAND_REVERT = 5; + + public static readonly integer LAND_SMALL_BRUSH = 1; + public static readonly integer LAND_MEDIUM_BRUSH = 2; + public static readonly integer LAND_LARGE_BRUSH = 3; + + public static readonly integer LINK_ROOT = 1; + public static readonly integer LINK_SET = -1; + public static readonly integer LINK_ALL_OTHERS = -2; + public static readonly integer LINK_ALL_CHILDREN = -3; + public static readonly integer LINK_THIS = -4; + + public static readonly integer CONTROL_FWD = 1; + public static readonly integer CONTROL_BACK = 2; + public static readonly integer CONTROL_LEFT = 4; + public static readonly integer CONTROL_RIGHT = 8; + public static readonly integer CONTROL_ROT_LEFT = 256; + public static readonly integer CONTROL_ROT_RIGHT = 512; + public static readonly integer CONTROL_UP = 16; + public static readonly integer CONTROL_DOWN = 32; + public static readonly integer CONTROL_LBUTTON = 268435456; + public static readonly integer CONTROL_ML_LBUTTON = 1073741824; + + public static readonly integer CHANGED_INVENTORY = 1; + public static readonly integer CHANGED_COLOR = 2; + public static readonly integer CHANGED_SHAPE = 4; + public static readonly integer CHANGED_SCALE = 8; + public static readonly integer CHANGED_TEXTURE = 16; + public static readonly integer CHANGED_LINK = 32; + public static readonly integer CHANGED_ALLOWED_DROP = 64; + public static readonly integer CHANGED_OWNER = 128; + public static readonly integer CHANGED_REGION = 256; + public static readonly integer CHANGED_TELEPORT = 512; + + public static readonly integer TYPE_INTEGER = 1; + public static readonly integer TYPE_FLOAT = 2; + public static readonly integer TYPE_STRING = 3; + public static readonly integer TYPE_KEY = 4; + public static readonly integer TYPE_VECTOR = 5; + public static readonly integer TYPE_ROTATION = 6; + public static readonly integer TYPE_INVALID = 0; + + public static readonly integer AGENT_FLYING = 1; + public static readonly integer AGENT_ATTACHMENTS = 2; + public static readonly integer AGENT_SCRIPTED = 4; + public static readonly integer AGENT_MOUSELOOK = 8; + public static readonly integer AGENT_SITTING = 16; + public static readonly integer AGENT_ON_OBJECT = 32; + public static readonly integer AGENT_AWAY = 64; + public static readonly integer AGENT_WALKING = 128; + public static readonly integer AGENT_IN_AIR = 256; + public static readonly integer AGENT_TYPING = 512; + public static readonly integer AGENT_CROUCHING = 1024; + public static readonly integer AGENT_BUSY = 2048; + public static readonly integer AGENT_ALWAYS_RUN = 4096; + + public static readonly integer ANIM_ON = 1; + public static readonly integer LOOP = 2; + public static readonly integer REVERSE = 4; + public static readonly integer PING_PONG = 8; + public static readonly integer SMOOTH = 16; + public static readonly integer ROTATE = 32; + public static readonly integer SCALE = 64; + + public static readonly integer PSYS_PART_START_COLOR = 1; + public static readonly integer PSYS_PART_START_ALPHA = 2; + public static readonly integer PSYS_PART_END_COLOR = 3; + public static readonly integer PSYS_PART_END_ALPHA = 4; + public static readonly integer PSYS_PART_START_SCALE = 5; + public static readonly integer PSYS_PART_END_SCALE = 6; + public static readonly integer PSYS_PART_MAX_AGE = 7; + + public static readonly integer PSYS_SRC_ACCEL = 8; + public static readonly integer PSYS_SRC_PATTERN = 9; + public static readonly integer PSYS_SRC_INNERANGLE = 10; + public static readonly integer PSYS_SRC_OUTERANGLE = 11; + public static readonly integer PSYS_SRC_TEXTURE = 12; + public static readonly integer PSYS_SRC_BURST_RATE = 13; + public static readonly integer PSYS_SRC_BURST_PART_COUNT = 15; + public static readonly integer PSYS_SRC_BURST_RADIUS = 16; + public static readonly integer PSYS_SRC_BURST_SPEED_MIN = 17; + public static readonly integer PSYS_SRC_BURST_SPEED_MAX = 18; + public static readonly integer PSYS_SRC_MAX_AGE = 19; + public static readonly integer PSYS_SRC_TARGET_KEY = 20; + public static readonly integer PSYS_SRC_OMEGA = 21; + public static readonly integer PSYS_SRC_ANGLE_BEGIN = 22; + public static readonly integer PSYS_SRC_ANGLE_END = 23; + + public static readonly integer PSYS_PART_FLAGS = 0; + public static readonly integer PSYS_PART_INTERP_COLOR_MASK = 1; + public static readonly integer PSYS_PART_INTERP_SCALE_MASK = 2; + public static readonly integer PSYS_PART_BOUNCE_MASK = 4; + public static readonly integer PSYS_PART_WIND_MASK = 8; + public static readonly integer PSYS_PART_FOLLOW_SRC_MASK = 16; + public static readonly integer PSYS_PART_FOLLOW_VELOCITY_MASK = 32; + public static readonly integer PSYS_PART_TARGET_POS_MASK = 64; + public static readonly integer PSYS_PART_TARGET_LINEAR_MASK = 128; + public static readonly integer PSYS_PART_EMISSIVE_MASK = 256; + + public static readonly integer PSYS_SRC_PATTERN_DROP = 1; + public static readonly integer PSYS_SRC_PATTERN_EXPLODE = 2; + public static readonly integer PSYS_SRC_PATTERN_ANGLE = 4; + public static readonly integer PSYS_SRC_PATTERN_ANGLE_CONE = 8; + public static readonly integer PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY = 16; + + public static readonly integer DATA_ONLINE = 1; + public static readonly integer DATA_NAME = 2; + public static readonly integer DATA_BORN = 3; + public static readonly integer DATA_RATING = 4; + + public static readonly integer DATA_SIM_POS = 5; + public static readonly integer DATA_SIM_STATUS = 6; + public static readonly integer DATA_SIM_RATING = 7; + + public static readonly integer DATA_PAYINFO = 8; + + public static readonly Float PI = 3.1415926535897932384626; + public static readonly Float TWO_PI = 2.0 * PI; + public static readonly Float PI_BY_TWO = 1.570796; + public static readonly Float DEG_TO_RAD = 0.017453; + public static readonly Float RAD_TO_DEG = 57.295780; + public static readonly Float SQRT2 = 1.414214; + + public static readonly integer VEHICLE_TYPE_NONE = 0; + + public static readonly integer VEHICLE_LINEAR_FRICTION_TIMESCALE = 16; + public static readonly integer VEHICLE_ANGULAR_FRICTION_TIMESCALE = 17; + public static readonly integer VEHICLE_LINEAR_MOTOR_DIRECTION = 18; + public static readonly integer VEHICLE_ANGULAR_MOTOR_DIRECTION = 19; + public static readonly integer VEHICLE_LINEAR_MOTOR_OFFSET = 20; + public static readonly integer VEHICLE_HOVER_HEIGHT = 24; + public static readonly integer VEHICLE_HOVER_EFFICIENCY = 25; + public static readonly integer VEHICLE_HOVER_TIMESCALE = 26; + public static readonly integer VEHICLE_BUOYANCY = 27; + public static readonly integer VEHICLE_LINEAR_DEFLECTION_EFFICIENCY = 28; + public static readonly integer VEHICLE_LINEAR_DEFLECTION_TIMESCALE = 29; + public static readonly integer VEHICLE_LINEAR_MOTOR_TIMESCALE = 30; + public static readonly integer VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE = 31; + public static readonly integer VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY = 32; + public static readonly integer VEHICLE_ANGULAR_DEFLECTION_TIMESCALE = 33; + public static readonly integer VEHICLE_ANGULAR_MOTOR_TIMESCALE = 34; + public static readonly integer VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE = 35; + public static readonly integer VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY = 36; + public static readonly integer VEHICLE_VERTICAL_ATTRACTION_TIMESCALE = 37; + public static readonly integer VEHICLE_BANKING_EFFICIENCY = 38; + public static readonly integer VEHICLE_BANKING_MIX = 39; + public static readonly integer VEHICLE_BANKING_TIMESCALE = 40; + public static readonly integer VEHICLE_REFERENCE_FRAME = 44; + + // depricaded + public static readonly integer VEHICLE_FLAG_NO_FLY_UP = 1; + + public static readonly integer VEHICLE_FLAG_NO_DEFLECTION_UP = 1; + public static readonly integer VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; + public static readonly integer VEHICLE_FLAG_HOVER_WATER_ONLY = 4; + public static readonly integer VEHICLE_FLAG_HOVER_TERRAIN_ONLY = 8; + public static readonly integer VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT = 16; + public static readonly integer VEHICLE_FLAG_HOVER_UP_ONLY = 32; + public static readonly integer VEHICLE_FLAG_LIMIT_MOTOR_UP = 64; + public static readonly integer VEHICLE_FLAG_MOUSELOOK_STEER = 128; + public static readonly integer VEHICLE_FLAG_MOUSELOOK_BANK = 256; + public static readonly integer VEHICLE_FLAG_CAMERA_DECOUPLED = 512; + + public static readonly integer VEHICLE_TYPE_SLED = 1; + public static readonly integer VEHICLE_TYPE_CAR = 2; + public static readonly integer VEHICLE_TYPE_BOAT = 3; + public static readonly integer VEHICLE_TYPE_AIRPLANE = 4; + public static readonly integer VEHICLE_TYPE_BALLOON = 5; + + public static readonly integer ALL_SIDES = -1; + + public static readonly integer CAMERA_PITCH = 0; + public static readonly integer CAMERA_FOCUS_OFFSET = 1; + public static readonly integer CAMERA_POSITION_LAG = 5; + public static readonly integer CAMERA_FOCUS_LAG = 6; + public static readonly integer CAMERA_DISTANCE = 7; + public static readonly integer CAMERA_BEHINDNESS_ANGLE = 8; + public static readonly integer CAMERA_BEHINDNESS_LAG = 9; + public static readonly integer CAMERA_POSITION_THRESHOLD = 10; + public static readonly integer CAMERA_FOCUS_THRESHOLD = 11; + public static readonly integer CAMERA_ACTIVE = 12; + public static readonly integer CAMERA_POSITION = 13; + public static readonly integer CAMERA_FOCUS = 17; + public static readonly integer CAMERA_FOCUS_LOCKED = 22; + public static readonly integer CAMERA_POSITION_LOCKED = 21; + + public static readonly integer DEBUG_CHANNEL = 2147483647; + public const string EOF = "\n\n\n"; + + public static readonly integer HTTP_METHOD = 0; + public static readonly integer HTTP_MIMETYPE = 1; + public static readonly integer HTTP_BODY_MAXLENGTH = 2; + + public static readonly integer HTTP_BODY_TRUNCATED = 0; + + public static readonly integer LIST_STAT_RANGE = 0; + public static readonly integer LIST_STAT_MIN = 1; + public static readonly integer LIST_STAT_MAX = 2; + public static readonly integer LIST_STAT_MEAN = 3; + public static readonly integer LIST_STAT_MEDIAN = 4; + public static readonly integer LIST_STAT_STD_DEV = 5; + public static readonly integer LIST_STAT_SUM = 6; + public static readonly integer LIST_STAT_SUM_SQUARES = 7; + public static readonly integer LIST_STAT_NUM_COUNT = 8; + public static readonly integer LIST_STAT_GEOMETRIC_MEAN = 9; + + public static readonly integer MASK_BASE = 0; + public static readonly integer MASK_EVERYONE = 3; + public static readonly integer MASK_GROUP = 2; + public static readonly integer MASK_NEXT = 4; + public static readonly integer MASK_OWNER = 1; + + public static readonly integer PARCEL_FLAG_ALLOW_FLY = 0x0000001; + public static readonly integer PARCEL_FLAG_ALLOW_SCRIPTS = 0x0000002; + public static readonly integer PARCEL_FLAG_ALLOW_LANDMARK = 0x0000008; + public static readonly integer PARCEL_FLAG_ALLOW_TERRAFORM = 0x0000010; + public static readonly integer PARCEL_FLAG_ALLOW_DAMAGE = 0x0000020; + public static readonly integer PARCEL_FLAG_ALLOW_CREATE_OBJECTS = 0x0000040; + public static readonly integer PARCEL_FLAG_USE_ACCESS_GROUP = 0x0000100; + public static readonly integer PARCEL_FLAG_USE_ACCESS_LIST = 0x0000200; + public static readonly integer PARCEL_FLAG_USE_BAN_LIST = 0x0000400; + public static readonly integer PARCEL_FLAG_USE_LAND_PASS_LIST = 0x0000800; + public static readonly integer PARCEL_FLAG_LOCAL_SOUND_ONLY = 0x0008000; + public static readonly integer PARCEL_FLAG_RESTRICT_PUSHOBJECT = 0x0200000; + public static readonly integer PARCEL_FLAG_ALLOW_GROUP_SCRIPTS = 0x2000000; + + public static readonly integer PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS = 0x4000000; + public static readonly integer PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY = 0x8000000; + public static readonly integer PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY = 0x10000000; + + //added 4 mei 2007 + //public static readonly integer DATA_PAYINFO=8; + public static readonly integer HTTP_VERIFY_CERT = 3; + + public static readonly integer PARCEL_COUNT_TOTAL = 0; + public static readonly integer PARCEL_COUNT_OWNER = 1; + public static readonly integer PARCEL_COUNT_GROUP = 2; + public static readonly integer PARCEL_COUNT_OTHER = 3; + public static readonly integer PARCEL_COUNT_SELECTED = 4; + public static readonly integer PARCEL_COUNT_TEMP = 5; + + public static readonly integer PARCEL_DETAILS_NAME = 0; + public static readonly integer PARCEL_DETAILS_DESC = 1; + public static readonly integer PARCEL_DETAILS_OWNER = 2; + public static readonly integer PARCEL_DETAILS_GROUP = 3; + public static readonly integer PARCEL_DETAILS_AREA = 4; + + public static readonly integer PAYMENT_INFO_ON_FILE = 1; + public static readonly integer PAYMENT_INFO_USED = 2; + //public static readonly integer REGION_FLAG_RESTRICT_PUSHOBJECT=4194304; + + + public static readonly integer PARCEL_MEDIA_COMMAND_STOP = 0; + public static readonly integer PARCEL_MEDIA_COMMAND_PAUSE = 1; + public static readonly integer PARCEL_MEDIA_COMMAND_PLAY = 2; + public static readonly integer PARCEL_MEDIA_COMMAND_LOOP = 3; + public static readonly integer PARCEL_MEDIA_COMMAND_TEXTURE = 4; + public static readonly integer PARCEL_MEDIA_COMMAND_URL = 5; + public static readonly integer PARCEL_MEDIA_COMMAND_TIME = 6; + public static readonly integer PARCEL_MEDIA_COMMAND_AGENT = 7; + public static readonly integer PARCEL_MEDIA_COMMAND_UNLOAD = 8; + public static readonly integer PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; + + public static readonly integer PARCEL_MEDIA_COMMAND_TYPE=10; + public static readonly integer PARCEL_MEDIA_COMMAND_SIZE=11; + public static readonly integer PARCEL_MEDIA_COMMAND_DESC=12; + public static readonly integer PARCEL_MEDIA_COMMAND_LOOP_SET = 13; + + public static readonly integer PAY_DEFAULT = -2; + public static readonly integer PAY_HIDE = -1; + + public static readonly integer PERM_ALL = 2147483647; + public static readonly integer PERM_COPY = 32768; + public static readonly integer PERM_MODIFY = 16384; + public static readonly integer PERM_MOVE = 524288; + public static readonly integer PERM_TRANSFER = 8192; + public static readonly integer PRIM_BUMP_BARK = 4; + public static readonly integer PRIM_BUMP_BLOBS = 12; + + public static readonly integer PRIM_BUMP_BRICKS = 5; + public static readonly integer PRIM_BUMP_BRIGHT = 1; + public static readonly integer PRIM_BUMP_CHECKER = 6; + public static readonly integer PRIM_BUMP_CONCRETE = 7; + public static readonly integer PRIM_BUMP_DARK = 2; + public static readonly integer PRIM_BUMP_DISKS = 10; + public static readonly integer PRIM_BUMP_GRAVEL = 11; + public static readonly integer PRIM_BUMP_LARGETILE = 14; + public static readonly integer PRIM_BUMP_NONE = 0; + public static readonly integer PRIM_BUMP_SHINY = 19; + public static readonly integer PRIM_BUMP_SIDING = 13; + public static readonly integer PRIM_BUMP_STONE = 9; + public static readonly integer PRIM_BUMP_STUCCO = 15; + public static readonly integer PRIM_BUMP_SUCTION = 16; + public static readonly integer PRIM_BUMP_TILE = 8; + public static readonly integer PRIM_BUMP_WEAVE = 17; + public static readonly integer PRIM_BUMP_WOOD = 3; + + public static readonly integer PRIM_CAST_SHADOWS = 24; + public static readonly integer PRIM_COLOR = 18; + public static readonly integer PRIM_FLEXIBLE = 21; + public static readonly integer PRIM_FULLBRIGHT = 20; + public static readonly integer PRIM_HOLE_CIRCLE = 16; + public static readonly integer PRIM_HOLE_DEFAULT = 0; + public static readonly integer PRIM_HOLE_SQUARE = 32; + public static readonly integer PRIM_HOLE_TRIANGLE = 48; + public static readonly integer PRIM_MATERIAL = 2; + public static readonly integer PRIM_MATERIAL_FLESH = 4; + public static readonly integer PRIM_MATERIAL_GLASS = 2; + public static readonly integer PRIM_MATERIAL_LIGHT = 7; + public static readonly integer PRIM_MATERIAL_METAL = 1; + public static readonly integer PRIM_MATERIAL_PLASTIC = 5; + public static readonly integer PRIM_MATERIAL_RUBBER = 6; + public static readonly integer PRIM_MATERIAL_STONE = 0; + public static readonly integer PRIM_MATERIAL_WOOD = 3; + + public static readonly integer PRIM_PHANTOM = 5; + public static readonly integer PRIM_PHYSICS = 3; + public static readonly integer PRIM_POINT_LIGHT = 23; + public static readonly integer PRIM_POSITION = 6; + public static readonly integer PRIM_ROTATION = 8; + public static readonly integer PRIM_SHINY_HIGH = 3; + public static readonly integer PRIM_SHINY_LOW = 1; + public static readonly integer PRIM_SHINY_MEDIUM = 2; + public static readonly integer PRIM_SHINY_NONE = 0; + public static readonly integer PRIM_SIZE = 7; + public static readonly integer PRIM_TEMP_ON_REZ = 4; + public static readonly integer PRIM_TEXGEN = 22; + public static readonly integer PRIM_TEXGEN_DEFAULT = 0; + public static readonly integer PRIM_TEXGEN_PLANAR = 1; + public static readonly integer PRIM_TEXTURE = 17; + public static readonly integer PRIM_TYPE = 9; + + public static readonly integer PRIM_TYPE_BOX = 0; + public static readonly integer PRIM_TYPE_CYLINDER = 1; + public static readonly integer PRIM_TYPE_PRISM = 2; + public static readonly integer PRIM_TYPE_SPHERE = 3; + public static readonly integer PRIM_TYPE_TORUS = 4; + public static readonly integer PRIM_TYPE_TUBE = 5; + public static readonly integer PRIM_TYPE_RING = 6; + public static readonly integer PRIM_TYPE_SCULPT = 7; + + public static readonly integer PRIM_GLOW = 25; + + + public static readonly integer PRIM_SCULPT_TYPE_SPHERE = 1; + public static readonly integer PRIM_SCULPT_TYPE_TORUS = 2; + public static readonly integer PRIM_SCULPT_TYPE_PLANE = 3; + public static readonly integer PRIM_SCULPT_TYPE_CYLINDER = 4; + + + public static readonly integer PUBLIC_CHANNEL = 0; + + public static readonly integer REGION_FLAG_ALLOW_DAMAGE = 1; + public static readonly integer REGION_FLAG_FIXED_SUN = 16; + public static readonly integer REGION_FLAG_BLOCK_TERRAFORM = 64; + public static readonly integer REGION_FLAG_SANDBOX = 256; + public static readonly integer REGION_FLAG_DISABLE_COLLISIONS = 4096; + public static readonly integer REGION_FLAG_DISABLE_PHYSICS = 16384; + public static readonly integer REGION_FLAG_BLOCK_FLY = 524288; + public static readonly integer REGION_FLAG_ALLOW_DIRECT_TELEPORT = 1048576; + public static readonly integer REGION_FLAG_RESTRICT_PUSHOBJECT = 4194304; + + public static readonly integer REMOTE_DATA_CHANNEL = 1; + public static readonly integer REMOTE_DATA_REQUEST = 2; + public static readonly integer REMOTE_DATA_REPLY = 3; + + public static readonly integer STRING_TRIM_HEAD = 1; + public static readonly integer STRING_TRIM_TAIL = 2; + public static readonly integer STRING_TRIM = 3; + + public static readonly integer OBJECT_NAME = 1; + public static readonly integer OBJECT_DESC = 2; + public static readonly integer OBJECT_POS = 3; + public static readonly integer OBJECT_ROT = 4; + public static readonly integer OBJECT_VELOCITY = 5; + public static readonly integer OBJECT_OWNER = 6; + public static readonly integer OBJECT_GROUP = 7; + public static readonly integer OBJECT_CREATOR = 8; + + public static readonly key NULL_KEY = key.NULL_KEY; + public static readonly rotation ZERO_ROTATION = rotation.ZERO_ROTATION; + public static readonly vector ZERO_VECTOR = vector.ZERO_VECTOR; + + public static readonly integer CLICK_ACTION_NONE = 0; + public static readonly integer CLICK_ACTION_TOUCH = 0; + public static readonly integer CLICK_ACTION_SIT = 1; + public static readonly integer CLICK_ACTION_BUY = 2; + public static readonly integer CLICK_ACTION_PAY = 3; + public static readonly integer CLICK_ACTION_OPEN = 4; + public static readonly integer CLICK_ACTION_PLAY = 5; + public static readonly integer CLICK_ACTION_OPEN_MEDIA = 6; + + public static readonly String URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED"; + public static readonly String URL_REQUEST_DENIED = "URL_REQUEST_DENIED"; + #endregion + + #region llFunctions + + #region List Functions + + public String llDumpList2String(list src, String separator) + { + StringBuilder result = new StringBuilder(); + for (int intI = 0; intI < src.Count; intI++) + { + if (intI > 0) + result.Append(separator.ToString()); + result.Append(src[intI].ToString()); + } + Verbose(@"DumpList2String({0},""{1}"")=""{2}""", src.ToVerboseString(), separator, result.ToString()); + return result.ToString(); + } + + public integer llGetListLength(list src) + { + integer result = src.Count; + Verbose("GetListLength({0})={1}", src.ToVerboseString(), result); + return result; + } + + public String llList2CSV(list src) + { + StringBuilder result = new StringBuilder(); + for (int intI = 0; intI < src.Count; intI++) + { + if (intI > 0) + result.Append(", "); + result.Append(src[intI].ToString()); + } + Verbose(@"List2CSV({0})=""{1}""", src.ToVerboseString(), result.ToString()); + return result.ToString(); + } + + public list llCSV2List(String _src) + { + string src = _src; + list result = new list(); + StringBuilder sb = new StringBuilder(); + int WithinAngelBracket = 0; + for (int intI = 0; intI < src.Length; intI++) + { + char chrC = src[intI]; + if (chrC == '<') + WithinAngelBracket++; + else if (chrC == '>') + WithinAngelBracket--; + + if (WithinAngelBracket == 0 && chrC == ',') + { + result.Add(sb.ToString()); + sb = new StringBuilder(); + } + else + { + sb.Append(src[intI]); + } + } + // dont forget the last one + result.Add(sb.ToString()); + + // remove the first space, if any + for (int intI = 0; intI < result.Count; intI++) + { + string strValue = result[intI].ToString(); + if (strValue == "") + continue; + if (strValue[0] == ' ') + result[intI] = strValue.Substring(1); + } + + Verbose(@"CSV2List(""{0}"")={1}", src,result.ToVerboseString()); + + return result; + } + + public integer llGetListEntryType(list src, integer index) + { + integer intReturn; + + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + intReturn = 0; + else + { + switch (src[index].GetType().ToString().Replace("LSLEditor.SecondLife+", "")) + { + case "System.Double": + case "Float": + intReturn = TYPE_FLOAT; + break; + case "System.String": + case "String": + intReturn = TYPE_STRING; + break; + case "System.Int32": + case "integer": + intReturn = TYPE_INTEGER; + break; + case "key": + intReturn = TYPE_KEY; + break; + case "vector": + intReturn = TYPE_VECTOR; + break; + case "rotation": + intReturn = TYPE_ROTATION; + break; + default: + intReturn = TYPE_INVALID; + break; + } + } + Verbose("GetListEntryType({0},{1})={2}",src.ToVerboseString(),index,intReturn); + return intReturn; + } + + public String llList2String(list src, integer index) + { + String result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = ""; + else + result = (String)src[index].ToString(); + Verbose("List2String({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + public rotation llList2Rot(list src, integer index) + { + rotation result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = ZERO_ROTATION; + else + { + if (src[index] is rotation) + result = (rotation)src[index]; + else + result = ZERO_ROTATION; + } + Verbose("List2Rot({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + public vector llList2Vector(list src, integer index) + { + vector result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = ZERO_VECTOR; + else + { + if (src[index] is vector) + result = (vector)src[index]; + else + result = ZERO_VECTOR; + } + Verbose("List2Vector({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + public Float llList2Float(list src, integer index) + { + Float result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = 0.0; + else + result = (Float)src[index].ToString(); + Verbose("List2Float({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + public integer llList2Integer(list src, integer index) + { + integer result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = 0; + else + result = (integer)src[index].ToString(); + Verbose("List2Integer({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + public key llList2Key(list src, integer index) + { + key result; + if (index < 0) + index = src.Count + index; + if (index >= src.Count || index < 0) + result = NULL_KEY; + else + result = (key)src[index].ToString(); + Verbose("List2Key({0},{1})={2}", src.ToVerboseString(), index, result); + return result; + } + + private bool CorrectIt(int length, ref int start, ref int end) + { + if (start < 0) + start = length + start; + + if (end < 0) + end = length + end; + + if (start <= end) + { + if (start >= length) + return false; + if (end < 0) + return false; + } + + start = Math.Max(0, start); + end = Math.Min(length-1, end); + + return true; + } + + // ok + public list llList2List(list src, integer _start, integer _end) + { + int intLength = src.Count; + + int start = _start; + int end = _end; + + list result = new list(); + + if (CorrectIt(intLength, ref start, ref end)) + { + if (start <= end) + { + for (int intI = start; intI <= end; intI++) + result.Add(src[intI]); + } + else // excluding + { + for (int intI = 0; intI <= end; intI++) + result.Add(src[intI]); + for (int intI = start; intI < intLength; intI++) + result.Add(src[intI]); + } + } + + Verbose(string.Format(@"List2List(""{0}"",{1},{2})=""{3}""", src, _start, _end, result)); + return result; + } + + // ok + public list llList2ListStrided(list src, integer _start, integer _end, integer stride) + { + int intLength = src.Count; + + int start = _start; + int end = _end; + + list temp = new list(); + + if (CorrectIt(intLength, ref start, ref end)) + { + if (start <= end) + { + for (int intI = start; intI <= end; intI++) + temp.Add(src[intI]); + } + else // excluding + { + for (int intI = 0; intI <= end; intI++) + temp.Add(src[intI]); + for (int intI = start; intI < intLength; intI++) + temp.Add(src[intI]); + } + } + list result = new list(); + string remark = ""; + if (stride <= 0) + { + remark = " ** stride must be > 0 **"; + } + else + { + if (start == 0) + for (int intI = 0; intI < temp.Count; intI += stride) + result.Add(temp[intI]); + else + for (int intI = stride - 1; intI < temp.Count; intI += stride) + result.Add(temp[intI]); + } + Verbose(@"List2ListStrided({0},{1},{2},{3})={4}{5}",src.ToVerboseString(),start,end,stride,result.ToVerboseString(),remark); + return result; + } + + public list llDeleteSubList(list _src, integer _start, integer _end) + { + int intLength = _src.Count; + + int start = _start; + int end = _end; + + list src = new list(_src); + + if (CorrectIt(intLength, ref start, ref end)) + { + if (start <= end) + { + for (int intI = start; intI <= end; intI++) + src[intI] = null; + } + else // excluding + { + for (int intI = 0; intI <= end; intI++) + src[intI] = null; + for (int intI = start; intI < intLength; intI++) + src[intI] = null; + } + } + list result = new list(); + for(int intI=0;intI src.Count) + return -1; + + int intReturn = -1; + for (int intI = 0; intI <= (src.Count - test.Count); intI++) + { + if (test[0].Equals(src[intI])) + { + bool blnOkay = true; + for (int intJ = 1; intJ < test.Count; intJ++) + { + if (!test[intJ].Equals(src[intI + intJ])) + { + blnOkay = false; + break; + } + } + if (blnOkay) + { + intReturn = intI; + break; + } + } + } + Verbose("ListFindList({0},{1}={2}",src.ToVerboseString(),test.ToVerboseString(),intReturn); + return intReturn; + } + + // ok + public list llListInsertList(list dest, list src, int pos) + { + int intLength = dest.Count; + list result = new list(); + if (pos < 0) + pos = dest.Count + pos; + + for (int intI = 0; intI < Math.Min(pos, intLength); intI++) + result.Add(dest[intI]); + + result.AddRange(src); + + for (int intI = Math.Max(0, pos); intI < intLength; intI++) + result.Add(dest[intI]); + + Verbose("ListInsertList({0},{1},{2})={3}",dest.ToVerboseString(),src.ToVerboseString(),pos,result.ToVerboseString()); + return result; + } + + public ArrayList RandomShuffle(ArrayList collection) + { + // We have to copy all items anyway, and there isn't a way to produce the items + // on the fly that is linear. So copying to an array and shuffling it is an efficient as we can get. + + if (collection == null) + throw new ArgumentNullException("collection"); + + int count = collection.Count; + for (int i = count - 1; i >= 1; --i) + { + // Pick an random number 0 through i inclusive. + int j = m_random.Next(i + 1); + + // Swap array[i] and array[j] + object temp = collection[i]; + collection[i] = collection[j]; + collection[j] = temp; + } + return collection; + } + + private ArrayList List2Buckets(list src, int stride) + { + ArrayList buckets = null; + if ((src.Count % stride) == 0 && stride <= src.Count) + { + buckets = new ArrayList(); + for (int intI = 0; intI < src.Count; intI += stride) + { + object[] bucket = new object[stride]; + for (int intJ = 0; intJ < stride; intJ++) + bucket[intJ] = src[intI + intJ]; + buckets.Add(bucket); + } + } + return buckets; + } + + private list Buckets2List(ArrayList buckets, int stride) + { + object[] items = new object[buckets.Count * stride]; + for (int intI = 0; intI < buckets.Count; intI++) + { + for (int intJ = 0; intJ < stride; intJ++) + items[intI * stride + intJ] = ((object[])buckets[intI])[intJ]; + } + return new list(items); + } + + + // ok + public list llListRandomize(list src, int stride) + { + list l; + ArrayList buckets = List2Buckets(src, stride); + if (buckets == null) + l = new list(src); + else + l = Buckets2List(RandomShuffle(buckets), stride); + Verbose("ListRandomize({0},{1})={2}",src.ToVerboseString(),stride,l.ToVerboseString()); + return l; + } + + private class BucketComparer : IComparer + { + private integer ascending; + public BucketComparer(integer ascending) + { + this.ascending = ascending; + } + public int Compare(object x, object y) + { + object[] xx = x as object[]; + object[] yy = y as object[]; + + object A,B; + + if (ascending == TRUE) + { + A = xx[0]; + B = yy[0]; + } + else + { + B = xx[0]; + A = yy[0]; + } + + string strType = A.GetType().ToString(); + + if(((A is string) && (B is string)) || + ((A is SecondLife.String) && (B is SecondLife.String))) + return string.Compare(A.ToString(), B.ToString()); + + if ((A is SecondLife.integer) && (B is SecondLife.integer)) + return SecondLife.integer.Compare((SecondLife.integer)A, (SecondLife.integer)B); + + if ((A is SecondLife.Float) && (B is SecondLife.Float)) + return SecondLife.Float.Compare((SecondLife.Float)A, (SecondLife.Float)B); + + return 0; + } + } + + + // ok + public list llListSort(list src, int stride, int ascending) + { + list result; + ArrayList buckets = List2Buckets(src, stride); + if (buckets == null) + result = new list(src); + else + { + buckets.Sort(new BucketComparer(ascending)); + result = Buckets2List(buckets, stride); + } + Verbose("ListSort({0},{1},{2})={3}", src.ToVerboseString(), stride, ascending, result.ToVerboseString()); + return result; + } + + // TODO check this!!! + public list llListReplaceList(list dest, list src, int start, int end) + { + int intLength = dest.Count; + + CorrectIt(intLength, ref start, ref end); + + list result = new list(); + if (start <= end) + { + for (int intI = 0; intI < start; intI++) + result.Add(dest[intI]); + result.AddRange(src); + for (int intI = end + 1; intI < intLength; intI++) + result.Add(dest[intI]); + } + else + { + // where to add src????? + for (int intI = end; intI <= start; intI++) + result.Add(dest[intI]); + } + Verbose("ListReplaceList({0},{1},{2},{3}={4}",dest.ToVerboseString(),src.ToVerboseString(),start,end,result.ToVerboseString()); + return result; + } + + // 21 sep 2007, check this + public list llParseString2List(String src, list separators, list spacers) + { + list result = ParseString(src, separators, spacers, false); + Verbose("llParseString2List({0},{1},{2})={3}",src,separators.ToVerboseString(),spacers.ToVerboseString(),result.ToVerboseString()); + return result; + } + + // 21 sep 2007, check this, first check 3 oct 2007, last element=="" is added also + public list llParseStringKeepNulls(String src, list separators, list spacers) + { + list result = ParseString(src, separators, spacers, true); + Verbose("llParseStringKeepNulls({0},{1},{2})={3}", src, separators.ToVerboseString(), spacers.ToVerboseString(), result.ToVerboseString()); + return result; + } + + private list ParseString(String src, list separators, list spacers, bool blnKeepNulls) + { + list result = new list(); + int intFrom = 0; + string s = src; + for (int intI = 0; intI < s.Length; intI++) + { + string strTmp = s.Substring(intI); + bool blnFound = false; + for (int intJ = 0; intJ < separators.Count; intJ++) + { + string strSeparator = separators[intJ].ToString(); + if (strSeparator.Length == 0) + continue; // check this + if (strTmp.IndexOf(strSeparator) == 0) + { + string strBefore = s.Substring(intFrom, intI - intFrom); + if (strBefore != "" || blnKeepNulls) + result.Add(strBefore); + intI += strSeparator.Length - 1; + intFrom = intI + 1; + blnFound = true; + break; + } + } + + if (blnFound) + continue; + + for (int intJ = 0; intJ < spacers.Count; intJ++) + { + string strSpacer = spacers[intJ].ToString(); + if (strSpacer.Length == 0) + continue; // check this + if (strTmp.IndexOf(strSpacer) == 0) + { + string strBefore = s.Substring(intFrom, intI - intFrom); + if (strBefore != "" || blnKeepNulls) + result.Add(strBefore); + result.Add(strSpacer); + intI += strSpacer.Length - 1; + intFrom = intI + 1; + break; + } + } + } + string strLast = s.Substring(intFrom); + if (strLast != "" || blnKeepNulls) + result.Add(strLast); + return result; + } + + #endregion + + #region Time Functions + + public void llResetTime() + { + Verbose("ResetTime()"); + m_DateTimeScriptStarted = DateTime.Now.ToUniversalTime(); + } + + public Float llGetAndResetTime() + { + // get time + double time = llGetTime(); + Verbose("GetAndResetTime()=" + time); + // reset time + llResetTime(); + return time; + } + + public string llGetTimestamp() + { + string strTimestamp = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.ffffffZ", System.Globalization.DateTimeFormatInfo.InvariantInfo); + Verbose("GetTimestamp()=" + strTimestamp); + return strTimestamp; + } + public integer llGetUnixTime() + { + DateTime date_time_base = new DateTime(1970, 1, 1, 0, 0, 0, 0); + TimeSpan span = DateTime.Now.ToUniversalTime() - date_time_base; + Verbose("GetUnixTime()=" + span.TotalSeconds); + return (int)span.TotalSeconds; + } + + public Float llGetTime() + { + TimeSpan span = DateTime.Now.ToUniversalTime() - m_DateTimeScriptStarted; + Verbose("GetTime()=" + span.TotalSeconds); + return span.TotalSeconds; + } + + public Float llGetTimeOfDay() + { + Verbose("GetTimeOfDay()"); + // dummy + return llGetTime(); + } + #endregion + + #region RemoteData Functions + public key llSendRemoteData(key channel, String dest, integer idata, String sdata) + { + key k = host.llSendRemoteData(channel, dest, idata, sdata); + Verbose("SendRemoteData({0},{1},{2},{3})={4}",channel,dest,idata,sdata,k); + return k; + } + + public void llRemoteDataReply(key channel, key message_id, String sdata, integer idata) + { + host.llRemoteDataReply(channel, message_id, sdata, idata); + Verbose("RemoteDataReply({0},{1},{2},{3})",channel,message_id,sdata,idata); + } + + public void llCloseRemoteDataChannel(key channel) + { + host.llCloseRemoteDataChannel(channel); + Verbose("CloseRemoteDataChannel({0})",channel); + } + + public void llOpenRemoteDataChannel() + { + host.llOpenRemoteDataChannel(); + Verbose("OpenRemoteDataChannel()"); + } + #endregion RemoteData Functions + + #region Math Functions + public rotation llEuler2Rot(vector v) + { + v /= 2.0; + double ax = Math.Sin(v.x); + double aw = Math.Cos(v.x); + double by = Math.Sin(v.y); + double bw = Math.Cos(v.y); + double cz = Math.Sin(v.z); + double cw = Math.Cos(v.z); + rotation rot = new rotation(aw * by * cz + ax * bw * cw, + aw * by * cw - ax * bw * cz, + aw * bw * cz + ax * by * cw, + aw * bw * cw - ax * by * cz); + Verbose("Euler2Rot(" + v + ")=" + rot); + return rot; + } + + public Float llTan(Float theta) + { + double dblA = Math.Tan(theta); + Verbose("Tan(" + theta + ")=" + dblA); + return dblA; + } + + public Float llSin(Float theta) + { + double dblA = Math.Sin(theta); + Verbose("Sin(" + theta + ")=" + dblA); + return dblA; + } + + public Float llCos(Float theta) + { + double dblA = Math.Cos(theta); + Verbose("Cos(" + theta + ")=" + dblA); + return dblA; + } + + public Float llSqrt(Float val) + { + double dblA = Math.Sqrt(val); + Verbose("Sqrt(" + val + ")=" + dblA); + return dblA; + } + + public Float llAsin(Float val) + { + double dblA = Math.Asin(val); + Verbose("Asin(" + val + ")=" + dblA); + return dblA; + } + + public Float llAtan2(Float y, Float x) + { + double dblA = Math.Atan2(y, x); + Verbose("Atan2(" + y + "," + x + ")=" + dblA); + return dblA; + } + + public Float llAcos(Float val) + { + double dblA = Math.Acos(val); + Verbose("Acos(" + val + ")=" + dblA); + return dblA; + } + + public Float llPow(Float baze, Float exp) + { + double dblA = Math.Pow(baze, exp); + Verbose("Pow(" + baze + "," + exp + ")=" + dblA); + return dblA; + } + + + private integer ModPow1(integer a, integer b, integer c) + { + return (int)Math.Pow((int)a, (int)b & (int)0xffff) % (int)c; + } + + private integer ModPow2(integer x, integer y, integer m) + { + if (!x) return 0; + integer k = 1 + (int)Math.Ceiling(Math.Log(Math.Abs(x)) / 0.69314718055994530941723212145818);//ceil(log2(x)) + integer w = 32; + integer p = w / k; + integer r = y / p; + integer f = y % p; + integer z = 1; + if (r) z = ModPow2(ModPow1(x, p, m), r, m); + if (f) z = (z * ModPow1(x, f, m)) % m; + return z; + } + + public integer llModPow(integer x, integer y, integer m) + { + integer result = ModPow2(x, y, m); + Verbose("llModPow({0},{1},{2})={3}", x, y, m, result); + return result; + } + + public Float llLog(Float val) + { + double dblA = 0.0; + if(val>0.0) + dblA = Math.Log(val); + Verbose("llLog({0})={1}", val, dblA); + return dblA; + } + + public Float llLog10(Float val) + { + double dblA = 0.0; + if(val>0.0) + dblA = Math.Log10(val); + Verbose("llLog10({0})={1}",val,dblA); + return dblA; + } + + public integer llRound(Float val) + { + int intA = (int)Math.Round(val); + Verbose("Round(" + val + ")=" + intA); + return intA; + } + + public integer llCeil(Float val) + { + int intA = (int)Math.Ceiling(val); + Verbose("Ceiling(" + val + ")=" + intA); + return intA; + } + + public integer llAbs(integer val) + { + int intA = (int)Math.Abs((long)val); + Verbose("Abs(" + val + ")=" + intA); + return intA; + } + + public Float llFabs(Float val) + { + double dblA = Math.Abs(val); + Verbose("Fabs(" + val + ")=" + dblA); + return dblA; + } + + public integer llFloor(Float val) + { + int intA = (int)Math.Floor(val); + Verbose("Floor(" + val + ")=" + intA); + return intA; + } + + public Float llFrand(Float max) + { + double dblValue = max * m_random.NextDouble(); + Verbose("Frand(" + max + ")=" + dblValue); + return dblValue; + } + + #endregion Math Functions + + #region Sound + public void llPreloadSound(String sound) + { + Verbose("PreloadSound(" + sound + ")"); + } + + public void llSetSoundQueueing(integer queue) + { + Verbose("SetSoundQueueing(" + queue + ")"); + } + + public void llStopSound() + { + Verbose("StopSound()"); + } + + public void llTriggerSound(String sound, Float volume) + { + Verbose("TriggerSound(" + sound + "," + volume + ")"); + } + + public void llTriggerSoundLimited(String sound, Float volume, vector tne, vector bsw) + { + Verbose("TriggerSoundLimited(" + sound + "," + volume + "," + tne + "," + bsw + ")"); + } + + public void llSetSoundRadius(Float radius) + { + m_SoundRadius = radius; + Verbose("SetSoundRadius(" + m_SoundRadius + ")"); + } + + public void llAdjustSoundVolume(Float volume) + { + Verbose("AdjustSoundVolume(" + volume + ")"); + m_Volume = volume; + } + + public void llPlaySound(String sound, Float volume) + { + try + { + System.Media.SoundPlayer sp = host.GetSoundPlayer(sound); + sp.Play(); + Verbose("PlaySound(" + sound + "," + volume + ")"); + } + catch(Exception exception) + { + Verbose("PlaySound(" + sound + "," + volume + ") **"+exception.Message); + } + } + + public void llPlaySoundSlave(String sound, Float volume) + { + try + { + System.Media.SoundPlayer sp = host.GetSoundPlayer(sound); + sp.Play(); + } + catch + { + } + Verbose("PlaySoundSlave(" + sound + "," + volume + ")"); + } + + public void llLoopSound(String sound, Float volume) + { + try + { + System.Media.SoundPlayer sp = host.GetSoundPlayer(sound); + sp.PlayLooping(); + } + catch + { + } + Verbose("LoopSound(" + sound + "," + volume + ")"); + } + + public void llLoopSoundMaster(String sound, Float volume) + { + try + { + System.Media.SoundPlayer sp = host.GetSoundPlayer(sound); + sp.PlayLooping(); + } + catch + { + } + Verbose("LoopSoundMaster(" + sound + "," + volume + ")"); + } + + public void llLoopSoundSlave(String sound, Float volume) + { + try + { + System.Media.SoundPlayer sp = host.GetSoundPlayer(sound); + sp.PlayLooping(); + } + catch + { + } + Verbose("LoopSoundSlave(" + sound + "," + volume + ")"); + } + #endregion Sound + + public void llAddToLandPassList(key avatar, Float hours) + { + Verbose("AddToLandPassList(" + avatar + "," + hours + ")"); + if (m_LandPassList.ContainsKey(avatar)) + m_LandPassList.Remove(avatar); + m_LandPassList.Add(avatar, hours); + } + public void llRemoveFromLandPassList(key avatar) + { + Verbose("RemoveFromLandPassList(" + avatar + ")"); + if (m_LandPassList.ContainsKey(avatar)) + m_LandPassList.Remove(avatar); + } + + public void llResetLandPassList() + { + m_LandPassList = new Hashtable(); + Verbose("llResetLandPassList()"); + } + + public void llAddToLandBanList(key agent, Float hours) + { + Verbose("AddToLandBanList(" + agent + "," + hours + ")"); + if (m_LandBanList.ContainsKey(agent)) + m_LandBanList.Remove(agent); + m_LandBanList.Add(agent, hours); + } + public void llRemoveFromLandBanList(key avatar) + { + Verbose("RemoveFromLandBanList(" + avatar + ")"); + if (m_LandBanList.ContainsKey(avatar)) + m_LandBanList.Remove(avatar); + } + + public void llResetLandBanList() + { + m_LandBanList = new Hashtable(); + Verbose("llResetLandBanList()"); + } + + public void llAllowInventoryDrop(integer add) + { + Verbose("AllowInventoryDrop(" + add + ")"); + } + + public Float llAngleBetween(rotation a, rotation b) + { + double Angle = 2 * Math.Acos((a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) + / Math.Sqrt((a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s) * + (b.x * b.x + b.y * b.y + b.z * b.z + b.s * b.s))); + Verbose("AngleBetween(" + a + "," + b + ")=" + Angle); + return Angle; + } + + public void llApplyImpulse(vector force, integer local) + { + Verbose("ApplyImpulse(" + force + "," + local + ")"); + } + + public void llApplyRotationalImpulse(vector force, integer local) + { + Verbose("ApplyRotationalImpulse(" + force + "," + local + ")"); + } + + public void llAttachToAvatar(integer attachment) + { + Verbose("AttachToAvatar(" + attachment + ")"); + } + + public void llAttachToAvatar(key avatar, integer attachment) + { + Verbose("AttachToAvatar(" + avatar + "," + attachment + ")"); + } + + public key llAvatarOnSitTarget() + { + Verbose("AvatarOnSitTarget()"); + return new key(Guid.NewGuid()); + } + + public rotation llAxes2Rot(vector fwd, vector left, vector up) + { + Verbose("Axes2Rot(" + fwd + "," + left + "," + up + ")"); + return rotation.ZERO_ROTATION; + } + + public rotation llAxisAngle2Rot(vector axis, Float angle) + { + vector unit_axis = llVecNorm(axis); + double sine_half_angle = Math.Sin(angle / 2); + double cosine_half_angle = Math.Cos(angle / 2); + + rotation result = new rotation( + sine_half_angle * unit_axis.x, + sine_half_angle * unit_axis.y, + sine_half_angle * unit_axis.z, + cosine_half_angle); + + Verbose("AxisAngle2Rot({0},{1})={2}",axis,angle,result); + return result; + } + + public void llBreakAllLinks() + { + host.llBreakAllLinks(); + Verbose("BreakAllLinks()"); + } + + public void llBreakLink(integer linknum) + { + host.llBreakLink(linknum); + Verbose("BreakLink({0})",linknum); + } + + public Float llCloud(vector offset) + { + Verbose("Cloud({0})",offset); + return 0.0; + } + + public void llCollisionFilter(String name, key id, integer accept) + { + Verbose("CollisionFilter(" + name + "," + id + "," + accept + ")"); + } + + public void llCollisionSound(String impact_sound, Float impact_volume) + { + Verbose("CollisionSound(" + impact_sound + "," + impact_volume + ")"); + } + + public void llCollisionSprite(String impact_sprite) + { + Verbose("CollisionSprite(" + impact_sprite + ")"); + } + + public void llCreateLink(key target, integer simulator) + { + Verbose("CreateLink(" + target + "," + simulator + ")"); + } + + public void llDetachFromAvatar() + { + Verbose("DetachFromAvatar()"); + } + + public void llDetachFromAvatar(key avatar) + { + Verbose("DetachFromAvatar({0})",avatar); + } + + public vector llDetectedGrab(integer number) + { + Verbose("DetectedGrab(" + number + ")"); + return vector.ZERO_VECTOR; + } + + public key llDetectedKey(integer number) + { + key k = new key(Properties.Settings.Default.AvatarKey); + Verbose("DetectedKey({0})={1}",number,k); + return k; + } + + public integer llDetectedLinkNumber(integer number) + { + integer result = 0; + Verbose("DetectedLinkNumber({0})={1}",number,result); + return result; + } + + public String llDetectedName(integer number) + { + string result = Properties.Settings.Default.AvatarName; + Verbose("DetectedName({0})={1}", number, result); + return result; + } + + public key llDetectedOwner(integer number) + { + key result = new key(Properties.Settings.Default.AvatarKey); + Verbose("DetectedOwner({0})={1}",number,result); + return result; + } + + public vector llDetectedPos(integer number) + { + Verbose("DetectedPos(" + number + ")"); + return vector.ZERO_VECTOR; + } + + public rotation llDetectedRot(integer number) + { + Verbose("DetectedRot(" + number + ")"); + return rotation.ZERO_ROTATION; + } + + public integer llDetectedType(integer number) + { + integer result = AGENT; + Verbose("DetectedType({0})={1}",number,result); + return result; + } + + public vector llDetectedVel(integer number) + { + Verbose("DetectedVel(" + number + ")"); + return vector.ZERO_VECTOR; + } + + public void llDialog(key avatar, String message, list buttons, integer channel) + { + Verbose("Dialog({0},{1},{2},{3})",avatar,message,buttons.ToString(),channel); + host.llDialog(avatar, message, buttons, channel); + } + + public void llDie() + { + Verbose("llDie()"); + host.Die(); + } + + public integer llEdgeOfWorld(vector pos, vector dir) + { + Verbose("EdgeOfWorld(" + pos + "," + dir + ")"); + return 0; + } + + public void llEjectFromLand(key pest) + { + Verbose("EjectFromLand(" + pest + ")"); + } + + public void llEmail(String address, String subject, String message) + { + Verbose("Email(" + address + "," + subject + "," + message + ")"); + host.Email(address, subject, message); + } + + public vector llGetAccel() + { + Verbose("GetAccel()"); + return vector.ZERO_VECTOR; + } + + public integer llGetAttached() + { + Verbose("GetAttached()"); + return 0; + } + + public integer llGetAgentInfo(key id) + { + Verbose("GetAgentInfo(" + id + ")"); + return 0; + } + + public vector llGetAgentSize(key id) + { + Verbose("GetAgentSize(" + id + ")"); + return vector.ZERO_VECTOR; + } + + public Float llGetAlpha(integer face) + { + Verbose("GetAlpha(" + face + ")"); + return 0F; + } + + public String llGetAnimation(key id) + { + Verbose("GetAnimation(" + id + ")"); + return ""; + } + + public vector llGetCenterOfMass() + { + Verbose("GetCenterOfMass()"); + return vector.ZERO_VECTOR; + } + + public vector llGetColor(integer face) + { + Verbose("GetColor(" + face + ")"); + return vector.ZERO_VECTOR; + } + + public String llGetDate() + { + string result = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd"); + Verbose("GetDate()=" + result); + return result; + } + + public Float llGetEnergy() + { + Float result = 1.23; + Verbose("GetEnergy()={0}", result); + return result; + } + + public vector llGetForce() + { + Verbose("GetForce()"); + return vector.ZERO_VECTOR; + } + + public integer llGetFreeMemory() + { + Verbose("GetFreeMemory()"); + return 16000; + } + + public key llGetInventoryKey(String name) + { + key result = host.GetInventoryKey(name); + Verbose("GetInventoryKey({0})={1}",name,result); + return result; + } + + public String llGetInventoryName(integer type, integer number) + { + string result = host.GetInventoryName(type, number); + Verbose("GetInventoryName({0},{1})={2}", type, number, result); + return result; + } + + public integer llGetInventoryNumber(integer type) + { + int result = host.GetInventoryNumber(type); + Verbose("GetInventoryNumber({0})={1}",type,result); + return result; + } + + public key llGetInventoryCreator(String item) + { + key result = Properties.Settings.Default.AvatarKey; + Verbose(@"GetInventoryCreator(""{0}"")={1}", item, result); + return result; + } + public integer llGetInventoryType(String name) + { + integer result = host.GetInventoryType(name); + Verbose("GetInventoryType({0})={1}", name, result); + return result; + } + public integer llGetInventoryPermMask(String item, integer mask) + { + Verbose("GetInventoryPermMask(" + item + "," + mask + ")"); + return 0; + } + + + public key llGetKey() + { + key result = host.GetKey(); + Verbose("GetKey()="+result.ToString()); + return result; + } + + public key llGetLandOwnerAt(vector pos) + { + Verbose("GetLandOwnerAt(" + pos + ")"); + return new key(Guid.NewGuid()); + } + + public key llGetLinkKey(integer linknum) + { + Verbose("GetLinkKey(" + linknum + ")"); + return new key(Guid.NewGuid()); + } + + public String llGetLinkName(integer linknum) + { + Verbose("GetLinkName(" + linknum + ")"); + return ""; + } + + public integer llGetLinkNumber() + { + Verbose("GetLinkNumber()"); + return 0; + } + + public vector GetLocalPos() + { + // no verbose + return m_pos; + } + public vector llGetLocalPos() + { + Verbose("GetLocalPos()={0}",m_pos); + return m_pos; + } + + public rotation llGetLocalRot() + { + Verbose("GetLocalRot()={0}",m_rotlocal); + return m_rotlocal; + } + + public void llGetNextEmail(String address, String subject) + { + Verbose("GetNextEmail(" + address + "," + subject + ")"); + } + + public key llGetNumberOfNotecardLines(String name) + { + key k = host.GetNumberOfNotecardLines(name); + Verbose(@"GetNumberOfNotecardLines(""{0}"")={1}",name,k); + return k; + } + + public key llGetNotecardLine(String name, integer line) + { + key k = host.GetNotecardLine(name, line); + Verbose(@"GetNotecardLine(""{0}"",{1})={2}",name,line,k); + return k; + } + + public integer llGetNumberOfSides() + { + integer result = 6; + Verbose("GetNumberOfSides()={0}",result); + return result; + } + + public String llGetObjectName() + { + string result = host.GetObjectName(); + Verbose("llGetObjectName()={0}", result); + return result; + } + + public void llSetObjectName(String name) + { + Verbose("llSetObjectName({0})", name); + host.SetObjectName(name); + } + + public String llGetObjectDesc() + { + string result = host.GetObjectDescription(); + Verbose("llGetObjectDesc()={0}", result); + return result; + } + + public void llSetObjectDesc(String description) + { + Verbose("llSetObjectDesc({0})", description); + host.SetObjectDescription(description); + } + + + public vector llGetOmega() + { + Verbose("GetOmega()"); + return vector.ZERO_VECTOR; + } + + public key llGetOwner() + { + key k = new key(Properties.Settings.Default.AvatarKey); + Verbose("GetOwner()=" + k); + return k; + } + + public key llGetOwnerKey(key id) + { + key k = llGetOwner(); + Verbose("GetOwnerKey(" + id + ")=" + k); + return k; + } + + public integer llGetPermissions() + { + integer perm = + PERMISSION_DEBIT + | PERMISSION_TAKE_CONTROLS + | PERMISSION_TRIGGER_ANIMATION + | PERMISSION_ATTACH + | PERMISSION_CHANGE_LINKS + | PERMISSION_TRACK_CAMERA + | PERMISSION_CONTROL_CAMERA; + + Verbose("GetPermissions()=" + perm); + return perm; + } + + public key llGetPermissionsKey() + { + Verbose("GetPermissionsKey()"); + return new key(Guid.NewGuid()); + } + + public vector llGetPos() + { + Verbose("GetPos()=" + m_pos); + return m_pos; + } + + public Float llGetRegionFPS() + { + Verbose("GetRegionFPS()=" + Properties.Settings.Default.RegionFPS); + return Properties.Settings.Default.RegionFPS; + } + + public String llGetRegionName() + { + Verbose("GetRegionName()=" + Properties.Settings.Default.RegionName); + return Properties.Settings.Default.RegionName; + } + + public vector llGetRegionCorner() + { + System.Drawing.Point point = Properties.Settings.Default.RegionCorner; + vector RegionCorner = new vector(point.X, point.Y, 0); + Verbose("GetRegionCorner()" + RegionCorner); + return RegionCorner; + } + public integer llGetRegionFlags() + { + Verbose("GetRegionFlags()"); + return 0; + } + + + public Float llGetRegionTimeDilation() + { + Verbose("GetRegionTimeDilation()"); + return 0.9; + } + + public rotation llGetRot() + { + Verbose("GetRot()=" + m_rot); + return m_rot; + } + + public vector llGetScale() + { + Verbose("GetScale()=" + m_scale); + return m_scale; + } + + public String llGetScriptName() + { + string result = host.GetScriptName(); + Verbose("GetScriptName()=" + result); + return result; + } + + public integer llGetStartParameter() + { + Verbose("GetStartParameter()=" + m_start_parameter); + return m_start_parameter; + } + + public integer llGetScriptState(String name) + { + Verbose("GetScriptState(" + name + ")"); + return 0; + } + + public integer llGetStatus(integer status) + { + Verbose("GetStatus(" + status + ")"); + return 0; + } + + public String llGetSubString(String _src, integer _start, integer _end) + { + string src = _src; + int start = _start; + int end = _end; + + StringBuilder result = new StringBuilder(); + + int intLength = src.Length; + + if (CorrectIt(intLength, ref start, ref end)) + { + if (start <= end) + { + for (int intI = start; intI <= end; intI++) + result.Append(src[intI]); + } + else // excluding + { + for (int intI = 0; intI <= end; intI++) + result.Append(src[intI]); + for (int intI = start; intI < intLength; intI++) + result.Append(src[intI]); + } + } + Verbose(string.Format(@"GetSubString(""{0}"",{1},{2})=""{3}""", _src, _start, _end, result)); + return result.ToString(); + } + + public String llDeleteSubString(String _src, integer _start, integer _end) + { + char[] src = _src.ToString().ToCharArray(); + int start = _start; + int end = _end; + + int intLength = src.Length; + + if (CorrectIt(intLength, ref start, ref end)) + { + if (start <= end) + { + for (int intI = start; intI <= end; intI++) + src[intI] = '\0'; + } + else // excluding + { + for (int intI = 0; intI <= end; intI++) + src[intI] = '\0'; + for (int intI = start; intI < intLength; intI++) + src[intI] = '\0'; + } + } + StringBuilder result = new StringBuilder(); + for (int intI = 0; intI < src.Length; intI++) + { + if (src[intI] != '\0') + result.Append(src[intI]); + } + + Verbose(string.Format(@"DeleteSubString(""{0}"",{1},{2})=""{3}""",_src,_start,_end,result)); + return result.ToString(); + } + + public vector llGetSunDirection() + { + Verbose("GetSunDirection()"); + return vector.ZERO_VECTOR; + } + + public String llGetTexture(integer face) + { + Verbose("GetTexture(" + face + ")"); + return ""; + } + + public vector llGetTextureOffset(integer side) + { + Verbose("GetTextureOffset(" + side + ")"); + return vector.ZERO_VECTOR; + } + + public Float llGetTextureRot(integer side) + { + Verbose("GetTextureRot(" + side + ")"); + return 0.0; + } + + public vector llGetTextureScale(integer side) + { + Verbose("GetTextureScale(" + side + ")"); + return vector.ZERO_VECTOR; + } + + public vector llGetTorque() + { + Verbose("GetTorque()"); + return vector.ZERO_VECTOR; + } + + public vector llGetVel() + { + Verbose("GetVel()"); + return vector.ZERO_VECTOR; + } + public void llGiveInventory(key destination, String inventory) + { + Verbose("GiveInventory(" + destination + "," + inventory + ")"); + } + + public void llGiveInventoryList(key destination, String category, list inventory) + { + Verbose("GiveInventoryList(" + destination + "," + category + "," + inventory.ToString() + ")"); + } + + public integer llGiveMoney(key destination, integer amount) + { + Verbose("GiveMoney(" + destination + "," + amount + ")"); + return 0; + } + + public Float llGround(vector offset) + { + Float ground = 25.0; + Verbose("Ground(" + offset + ")=" + ground); + return ground; + } + + public vector llGroundContour(vector offset) + { + Verbose("GroundContour(" + offset + ")"); + return vector.ZERO_VECTOR; + } + + public vector llGroundNormal(vector offset) + { + vector GroundNormal = new vector(0, 0, 1); + Verbose("GroundNormal(" + offset + ")=" + GroundNormal); + return GroundNormal; + } + + public void llGroundRepel(Float height, integer water, Float tau) + { + Verbose("GroundRepel(" + height + "," + water + "," + tau + ")"); + } + + public vector llGroundSlope(vector offset) + { + Verbose("GroundSlope:" + offset); + return vector.ZERO_VECTOR; + } + + public String llInsertString(String _dst, integer _position, String _src) + { + string dst = _dst; + string src = _src; + int position = _position; + string result; + + if (position < 0) + position = 0; + + if (position < dst.Length) + result = dst.Substring(0, position) + src + dst.Substring(position); + else + result = dst + src; + Verbose(@"InsertString(""{0}"",{1},""{2}"")=""{3}""",dst,position,src,result); + return result; + } + + public void llInstantMessage(key user, String message) + { + Verbose("InstantMessage(" + user + "," + message + ")"); + } + + public String llKey2Name(key id) + { + string strName = "*unknown*"; + if (Properties.Settings.Default.AvatarKey == id) + strName = Properties.Settings.Default.AvatarName; + Verbose("Key2Name(" + id + ")=" + strName); + return strName; + } + + public integer llListen(integer channel, String name, key id, String msg) + { + int intHandle = host.llListen(channel, name, id, msg); + Verbose(@"Listen(" + channel + @",""" + name + @"""," + id + @",""" + msg + @""")=" + intHandle); + return intHandle; + } + + public void llListenControl(integer number, integer active) + { + Verbose("ListenControl(" + number + "," + active + ")"); + host.llListenControl(number, active); + } + + public void llListenRemove(integer number) + { + Verbose("ListenRemove(" + number + ")"); + host.llListenRemove(number); + } + + public void llLookAt(vector target, Float strength, Float damping) + { + Verbose("LookAt(" + target + "," + strength + "," + damping + ")"); + } + + public void llMakeExplosion(integer particles, Float scale, Float velocity, Float lifetime, Float arc, String texture, vector offset) + { + Verbose("MakeExplosion(" + particles + "," + scale + "," + velocity + "," + lifetime + "," + arc + "," + texture + "," + offset + ")"); + } + + public void llMakeFire(integer particles, Float scale, Float velocity, Float lifetime, Float arc, String texture, vector offset) + { + Verbose("MakeFire(" + particles + "," + scale + "," + velocity + "," + lifetime + "," + arc + "," + texture + "," + offset + ")"); + } + + public void llMakeFountain(integer particles, Float scale, Float velocity, Float lifetime, Float arc, String texture, vector offset) + { + Verbose("MakeFountain(" + particles + "," + scale + "," + velocity + "," + lifetime + "," + arc + "," + texture + "," + offset + ")"); + } + + public void llMakeSmoke(integer particles, Float scale, Float velocity, Float lifetime, Float arc, String texture, vector offset) + { + Verbose("MakeSmoke(" + particles + "," + scale + "," + velocity + "," + lifetime + "," + arc + "," + texture + "," + offset + ")"); + } + + public void llMessageLinked(integer linknum, integer num, String str, key id) + { + Verbose("MessageLinked(" + linknum + "," + num + "," + str + "," + id + ")"); + host.MessageLinked(linknum, num, str, id); + } + + public void llMinEventDelay(Float delay) + { + Verbose("MinEventDelay(" + delay + ")"); + } + + public void llModifyLand(integer action, integer size) + { + Verbose("ModifyLand(" + action + "," + size + ")"); + } + + public void llMoveToTarget(vector target, Float tau) + { + Verbose("MoveToTarget(" + target + "," + tau + ")"); + } + + public void llOffsetTexture(Float offset_s, Float offset_t, integer face) + { + Verbose("OffsetTexture(" + offset_s + "," + offset_t + "," + face + ")"); + } + + public integer llOverMyLand(key id) + { + Verbose("OverMyLand(" + id + ")"); + return integer.TRUE; + } + + public void llParticleSystem(list parameters) + { + Verbose("ParticleSystem(" + parameters.ToString() + ")"); + } + + public void llPassCollisions(integer pass) + { + Verbose("PassCollisions(" + pass + ")"); + } + + public void llPassTouches(integer pass) + { + Verbose("PassTouches(" + pass + ")"); + } + + public void llPointAt(vector pos) + { + Verbose("PointAt(" + pos + ")"); + } + + public void llPushObject(key id, vector impulse, vector angular_impulse, integer local) + { + Verbose("PushObject(" + id + "," + impulse + "," + angular_impulse + "," + local + ")"); + } + + public void llReleaseControls() + { + Verbose("ReleaseControls()"); + this.host.ReleaseControls(); + } + + public void llReleaseControls(key avatar) + { + Verbose("ReleaseControls(" + avatar + ")"); + } + + public void llRemoteLoadScript(key target, String name, integer running, integer param) + { + Verbose("RemoteLoadScript(" + target + "," + name + "," + running + "," + param + ")"); + } + + public void llRemoveInventory(String inventory) + { + Verbose("RemoveInventory(" + inventory + ")"); + } + + public void llRemoveVehicleFlags(integer flags) + { + Verbose("RemoveVehicleFlags(" + flags + ")"); + } + + public key llRequestAgentData(key id, integer data) + { + key k = new key(Guid.NewGuid()); + + string strData = "***"; + switch ((int)data) + { + case 1: // DATA_ONLINE + break; + case 2: // DATA_NAME + strData = Properties.Settings.Default.AvatarName; + break; + case 3: // DATA_BORN + strData = DateTime.Now.ToString("yyyy-MM-dd"); + break; + case 4: // DATA_RATING + break; + case 8: // DATA_PAYINFO + break; + default: + break; + } + host.ExecuteSecondLife("dataserver", k, (SecondLife.String)strData); + return k; + } + + public key llRequestInventoryData(String name) + { + Verbose("RequestInventoryData(" + name + ")"); + return new key(Guid.NewGuid()); + } + + public void llRequestPermissions(key avatar, integer perm) + { + Verbose("RequestPermissions(" + avatar + "," + perm + ")"); + this.host.llRequestPermissions(avatar, perm); + } + + public void llResetScript() + { + Verbose("ResetScript()"); + host.Reset(); + System.Threading.Thread.Sleep(1000); + System.Windows.Forms.MessageBox.Show("If you see this, something wrong in llResetScript()", "Oops..."); + } + + public void llResetOtherScript(String name) + { + Verbose("ResetOtherScript(" + name + ")"); + } + + public void llRezObject(String inventory, vector pos, vector vel, rotation rot, integer param) + { + Verbose("RezObject(" + inventory + "," + pos + "," + vel + "," + rot + "," + param + ")"); + object_rez(new key(Guid.NewGuid())); + on_rez(param); + } + + public Float llRot2Angle(rotation rot) + { + Verbose("Rot2Angle(" + rot + ")"); + return 0F; + } + + public vector llRot2Axis(rotation rot) + { + Verbose("Rot2Axis(" + rot + ")"); + return ZERO_VECTOR; + } + + public vector llRot2Euler(rotation r) + { + // http://rpgstats.com/wiki/index.php?title=LibraryRotationFunctions + rotation t = new rotation(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s); + double m = (t.x + t.y + t.z + t.s); + vector v = new vector(0, 0, 0); + if (m != 0) + { + double n = 2 * (r.y * r.s + r.x * r.z); + double p = m * m - n * n; + if (p > 0) + v = new vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)), + Math.Atan2(n, Math.Sqrt(p)), Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); + else if (n > 0) + v = new vector(0, PI_BY_TWO, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); + else + v = new vector(0, -PI_BY_TWO, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); + } + Verbose("Rot2Euler(" + r + ")=" + v); + return v; + } + + public vector llRot2Fwd(rotation rot) + { + vector v = new vector(1.0 / (rot.x * rot.x + rot.y * rot.y + rot.z * rot.z + rot.s * rot.s) , 0 , 0); + vector result = v * rot; + Verbose("Rot2Fwd({0})={1}",rot,result); + return result; + } + + public vector llRot2Left(rotation rot) + { + vector v = new vector(0 , 1.0 / (rot.x * rot.x + rot.y * rot.y + rot.z * rot.z + rot.s * rot.s ) , 0); + vector result = v * rot; + Verbose("llRot2Left({0})={1}",rot,result); + return result; + } + + public vector llRot2Up(rotation rot) + { + vector v = new vector(0 , 0 , 1.0 / (rot.x * rot.x + rot.y * rot.y + rot.z * rot.z + rot.s * rot.s)); + vector result = v * rot; + Verbose("llRot2Left({0})={1}",rot,result); + return result; + } + + public rotation llRotBetween(vector a, vector b) + { + Verbose("RotBetween(" + a + "," + b + ")"); + return ZERO_ROTATION; + } + + public void llRotLookAt(rotation rot, Float strength, Float damping) + { + Verbose("RotLookAt(" + rot + "," + strength + "," + damping + ")"); + } + + public integer llRotTarget(rotation rot, Float error) + { + Verbose("RotTarget(" + rot + "," + error + ")"); + return 0; + } + + public void llRotTargetRemove(integer number) + { + Verbose("RotTargetRemove(" + number + ")"); + } + + public void llRotateTexture(Float radians, integer face) + { + Verbose("RotateTexture(" + radians + "," + face + ")"); + } + + public integer llSameGroup(key id) + { + Verbose("SameGroup(" + id + ")"); + return 0; + } + + public void llSay(integer channel, String text) + { + Chat(channel, text, CommunicationType.Say); + } + + public void llOwnerSay(String message) + { + Chat(0, message, CommunicationType.OwnerSay); + } + + public void llWhisper(integer channel, String text) + { + Chat(channel, text, CommunicationType.Whisper); + } + + public void llShout(integer channel, String text) + { + Chat(channel, text, CommunicationType.Shout); + } + + public void llRegionSay(integer channel, String text) + { + if (channel != 0) + Chat(channel, text, CommunicationType.RegionSay); + } + + + public void llScaleTexture(Float scale_s, Float scale_t, integer face) + { + Verbose("ScaleTexture(" + scale_s + "," + scale_t + "," + face + ")"); + } + + public integer llScriptDanger(vector pos) + { + Verbose("ScriptDanger(" + pos + ")"); + return 0; + } + + public void llSensor(String name, key id, integer type, Float range, Float arc) + { + Verbose("llSensor()"); + host.sensor_timer.Stop(); + integer total_number = 1; + host.ExecuteSecondLife("sensor", total_number); + } + + public void llSensorRemove() + { + Verbose("SensorRemove()"); + host.sensor_timer.Stop(); + } + + public void llSensorRepeat(String name, key id, integer type, Float range, Float arc, Float rate) + { + Verbose("SensorRepeat(" + name + "," + id + "," + type + "," + range + "," + arc + "," + rate + ")"); + host.sensor_timer.Stop(); + if (rate > 0) + { + host.sensor_timer.Interval = (int)Math.Round(rate * 1000); + host.sensor_timer.Start(); + } + } + + public void llSetAlpha(Float alpha, integer face) + { + Verbose("SetAlpha(" + alpha + "," + face + ")"); + } + + public void llSetBuoyancy(Float buoyancy) + { + Verbose("SetBuoyancy(" + buoyancy + ")"); + } + + public void llSetCameraAtOffset(vector offset) + { + Verbose("SetCameraAtOffset(" + offset + ")"); + } + + public void llSetCameraEyeOffset(vector offset) + { + Verbose("SetCameraEyeOffset(" + offset + ")"); + } + + public void llSetColor(vector color, integer face) + { + Verbose("SetColor(" + color + "," + face + ")"); + } + + public void llSetDamage(Float damage) + { + Verbose("SetDamage(" + damage + ")"); + } + + public void llSetForce(vector force, integer local) + { + Verbose("SetForce(" + force + "," + local + ")"); + } + + public void llSetForceAndTorque(vector force, vector torque, integer local) + { + Verbose("SetForceAndTorque(" + force + "," + torque + "," + local + ")"); + } + + public void llSetHoverHeight(Float height, Float water, Float tau) + { + Verbose("SetHoverHeight(" + height + "," + water + "," + tau + ")"); + } + + public void llSetLinkColor(integer linknumber, vector color, integer face) + { + Verbose("SetLinkColor(" + linknumber + "," + color + "," + face + ")"); + } + + public void llSetPos(vector pos) + { + Verbose("SetPos(" + pos + ")"); + m_pos = pos; + } + + public void llSetRot(rotation rot) + { + Verbose("SetRot(" + rot + ")"); + m_rot = rot; + } + + public void llSetScale(vector scale) + { + Verbose("SetScale(" + scale + ")"); + m_scale = scale; + } + + public void llSetScriptState(String name, integer run) + { + Verbose("SetScriptState(" + name + "," + run + ")"); + } + + public void llSetSitText(String text) + { + Verbose("SetSitText(" + text + ")"); + m_SitText = text; + } + + public void llSetStatus(integer status, integer value) + { + Verbose("SetStatus(" + status + "," + value + ")"); + } + + public void llSetText(String text, vector color, Float alpha) + { + Verbose("SetText(" + text + "," + color + "," + alpha + ")"); + } + + public void llSetTexture(String texture, integer face) + { + Verbose("SetTexture(" + texture + "," + face + ")"); + } + + public void llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, Float start, Float length, Float rate) + { + Verbose("SetTextureAnim(" + mode + "," + face + "," + sizex + "," + sizey + "," + start + "," + length + "," + rate + ")"); + } + + public void llSetTimerEvent(Float sec) + { + Verbose("SetTimerEvent(" + sec + ")"); + host.timer.Stop(); + if (sec > 0) + { + host.timer.Interval = (int)Math.Round(sec * 1000); + host.timer.Start(); + } + } + + public void llSetTorque(vector torque, integer local) + { + Verbose("SetTorque(" + torque + "," + local + ")"); + } + + public void llSetTouchText(String text) + { + Verbose("SetTouchText(" + text + ")"); + } + + public void llSetVehicleFlags(integer flags) + { + Verbose("SetVehicleFlags(" + flags + ")"); + } + + public void llSetVehicleFloatParam(integer param_name, Float param_value) + { + Verbose("SetVehicledoubleParam(" + param_name + "," + param_value + ")"); + } + + public void llSetVehicleType(integer type) + { + Verbose("SetVehicleType(" + type + ")"); + } + + public void llSetVehicleRotationParam(integer param_name, rotation param_value) + { + Verbose("SetVehicleRotationParam(" + param_name + "," + param_value + ")"); + } + + public void llSetVehicleVectorParam(integer param_name, vector param_value) + { + Verbose("SetVehicleVectorParam(" + param_name + "," + param_value + ")"); + } + + public void llSitTarget(vector offset, rotation rot) + { + Verbose("SitTarget(" + offset + "," + rot + ")"); + } + + public void llSleep(Float sec) + { + Verbose("Sleep(" + sec + ")"); + System.Threading.Thread.Sleep((int)Math.Round(sec * 1000)); + } + + public void llStartAnimation(String anim) + { + Verbose("StartAnimation(" + anim + ")"); + } + + public void llStopAnimation(String anim) + { + Verbose("StopAnimation(" + anim + ")"); + } + + public void llStopHover() + { + Verbose("StopHover()"); + } + + public void llStopLookAt() + { + Verbose("StopLookAt()"); + } + + public void llStopMoveToTarget() + { + Verbose("StopMoveToTarget()"); + } + + public void llStopPointAt() + { + Verbose("StopPointAt()"); + } + + public integer llStringLength(String src) + { + int intLength = ((string)src).Length; + Verbose(@"StringLength(""{0}"")={1}",src,intLength); + return intLength; + } + + public integer llSubStringIndex(String source, String pattern) + { + int intIndexOf = ((string)source).IndexOf((string)pattern); + Verbose("SubStringIndex({0},{1})={2}",source,pattern,intIndexOf); + return intIndexOf; + } + + public void llTakeControls(integer controls, integer accept, integer pass_on) + { + Verbose("TakeControls(" + controls + "," + accept + "," + pass_on + ")"); + this.host.TakeControls(controls, accept, pass_on); + } + + public integer llTarget(vector position, Float range) + { + Verbose("Target(" + position + "," + range + ")"); + return 0; + } + + public void llTargetOmega(vector axis, Float spinrate, Float gain) + { + Verbose("TargetOmega(" + axis + "," + spinrate + "," + gain + ")"); + } + + public void llTargetRemove(integer tnumber) + { + Verbose("TargetRemove(" + tnumber + ")"); + } + + public void llTeleportAgentHome(key id) + { + Verbose("TeleportAgentHome(" + id + ")"); + } + + public String llToLower(String src) + { + string strTemp = ((string)src).ToLower(); + Verbose("ToLower(" + src + ")=" + strTemp); + return strTemp; + } + + public String llToUpper(String src) + { + string strTemp = ((string)src).ToUpper(); + Verbose("ToUpper(" + src + ")=" + strTemp); + return strTemp; + } + + public void llUnSit(key id) + { + Verbose("UnSit(" + id + ")"); + } + + public Float llVecDist(vector a, vector b) + { + vector vecValue = new vector(a.x - b.x, a.y - b.y, a.z - b.z); + double dblMag = llVecMag(vecValue); + Verbose("VecDist(" + a + "," + b + ")=" + dblMag); + return dblMag; + } + + public Float llVecMag(vector vec) + { + double dblValue = Math.Sqrt(vec.x * vec.x + vec.y * vec.y + vec.z * vec.z); + Verbose("VecMag(" + vec + ")=" + dblValue); + return dblValue; + } + + public vector llVecNorm(vector vec) + { + double dblMag = llVecMag(vec); + vector vecValue = new vector(vec.x / dblMag, vec.y / dblMag, vec.z / dblMag); + Verbose("VecNorm(" + vec + ")=" + vecValue); + return vecValue; + } + + public void llVolumeDetect(integer detect) + { + Verbose("VolumeDetect(" + detect + ")"); + } + + public Float llWater(vector offset) + { + Verbose("Water(" + offset + ")"); + return 0F; + } + + public vector llWind(vector offset) + { + Verbose("Wind(" + offset + ")"); + return vector.ZERO_VECTOR; + } + public void llSetPrimitiveParams(list rule) + { + Verbose("SetPrimitiveParams(" + rule.ToString() + ")"); + } + public void llClearCameraParams() + { + Verbose("ClearCameraParams()"); + } + public integer llDetectedGroup(integer number) + { + Verbose("DetectedGroup(" + number + ")"); + return 0; + } + public void llForceMouselook(integer mouselook) + { + Verbose("ForceMouselook(" + mouselook + ")"); + } + public list llGetAnimationList(key id) + { + Verbose("GetAnimationList(" + id + ")"); + return new list(); + } + public list llGetBoundingBox(key mobject) + { + Verbose("GetBoundingBox(" + mobject + ")"); + return new list(); + } + public vector llGetCameraPos() + { + Verbose("GetCameraPos()"); + return vector.ZERO_VECTOR; + } + public rotation llGetCameraRot() + { + Verbose("GetCameraRot()"); + return rotation.ZERO_ROTATION; + } + public key llGetCreator() + { + key result = Properties.Settings.Default.AvatarKey; + Verbose("GetCreator()={0}",result); + return result; + } + public vector llGetGeometricCenter() + { + vector result = ZERO_VECTOR; + Verbose("GetGeometricCenter()={0}",result); + return result; + } + + public Float llGetWallclock() + { + Float result = (int)DateTime.Now.AddHours(-9.0).TimeOfDay.TotalSeconds; + Verbose("GetWallclock()={0}", result); + return result; + } + + public Float llGetGMTclock() + { + Float result = DateTime.Now.ToUniversalTime().TimeOfDay.TotalSeconds; + Verbose("GetGMTclock()={0}", result); + return result; + } + + public Float llGetMass() + { + Float result = 1.23; + Verbose("GetMass()={0}", result); + return result; + } + + public integer llGetNumberOfPrims() + { + integer result = 10; + Verbose("GetNumberOfPrims()={0}", result); + return result; + } + + public Float llGetObjectMass(key id) + { + Verbose("GetObjectMass(" + id + ")"); + return 0.0F; + } + public integer llGetObjectPermMask(integer mask) + { + Verbose("GetObjectPermMask(" + mask + ")"); + return 0; + } + public integer llGetParcelFlags(vector pos) + { + Verbose("GetParcelFlags(" + pos + ")"); + return 0; + } + public list llGetPrimitiveParams(list myparams) + { + Verbose("GetPrimitiveParams(" + myparams.ToString() + ")"); + return new list(); + } + + public vector llGetRootPosition() + { + Verbose("GetRootPosition()"); + return vector.ZERO_VECTOR; + } + public rotation llGetRootRotation() + { + Verbose("GetRootRotation()"); + return rotation.ZERO_ROTATION; + } + public String llGetSimulatorHostname() + { + Verbose("GetSimulatorHostname()"); + return ""; + } + public key llHTTPRequest(String url, list parameters, String body) + { + key result = host.Http(url, parameters, body); + Verbose(@"HTTPRequest(""{0}"",{1},""{2}"")=""{3}""",url,parameters.ToVerboseString(),body,result); + return result; + } + + public String llXorBase64StringsCorrect(String s1, String s2) + { + string S1 = Base64ToString(s1.ToString()); + string S2 = Base64ToString(s2.ToString()); + int intLength = S1.Length; + if (S2.Length == 0) + S2 = " "; + while(S2.Length < intLength) + S2 += S2; + S2 = S2.Substring(0, intLength); + StringBuilder sb = new StringBuilder(); + for (int intI = 0; intI < intLength; intI++) + sb.Append((char)(S1[intI] ^ S2[intI])); + string result = StringToBase64(sb.ToString()); + Verbose(@"XorBase64StringsCorrect(""{0}"",""{1}"")=""{2}""",s1,s2,result); + return result; + } + + private string StringToBase64(string str) + { + byte[] data = Encoding.UTF8.GetBytes(str); + return Convert.ToBase64String(data); + } + + public String llStringToBase64(String str) + { + string result = StringToBase64(str.ToString()); + Verbose(@"StringToBase64(""{0}"")=""{1}""", str, result); + return result; + } + + private string Base64ToString(string str) + { + byte[] data = Convert.FromBase64String(str); + int intLen = Array.IndexOf(data, (byte)0x00); + if (intLen < 0) + intLen = data.Length; + return Encoding.UTF8.GetString(data,0,intLen); + } + + public String llBase64ToString(String str) + { + string result = Base64ToString(str.ToString()); + Verbose(@"Base64ToString(""{0}"")=""{1}""",str,result); + return result; + } + + public String llIntegerToBase64(integer number) + { + byte[] data = new byte[4]; + data[3] = (byte)(number & 0xff); + data[2] = (byte)((number >> 8) & 0xff); + data[1] = (byte)((number >> 16) & 0xff); + data[0] = (byte)((number >> 24) & 0xff); + string result = Convert.ToBase64String(data); + Verbose(@"IntegerToBase64({0})=""{1}""", number, result); + return result; + } + + + static readonly int[] FastLookupBase64 = + {// 0 1 2 3 4 5 6 7 8 9 A B C D E F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 10 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,62, 0, 0, 0,63, // 20 + 52,53,54,55,56,57,58,59,60,61, 0, 0, 0, 0, 0, 0, // 30 + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, // 40 + 15,16,17,18,19,20,21,22,23,24,25, 0, 0, 0, 0, 0, // 50 + 0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, // 60 + 41,42,43,44,45,46,47,48,49,50,51, 0, 0, 0, 0, 0, // 70 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 90 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // F0 + + private int LookupBase64(string s, int intIndex) + { + if (intIndex < s.Length) + { + int intReturn = FastLookupBase64[s[intIndex]]; + if (intReturn == 0) + if (s[intIndex] != 'A') + throw new Exception(); + return intReturn; + } + else + return 0; + } + + public integer llBase64ToInteger(String _str) + { + int result; + + try + { + string s = _str; + byte[] data = new byte[4]; + + if (s.Length > 1) + { + data[3] = (byte)( LookupBase64(s, 0) << 2); + data[3] |= (byte)( LookupBase64(s, 1) >> 4); + } + + if (s.Length > 2) + { + data[2] = (byte)((LookupBase64(s, 1) & 0xf) << 4); + data[2] |= (byte)( LookupBase64(s, 2) >> 2); + } + + if (s.Length > 3) + { + data[1] = (byte)((LookupBase64(s, 2) & 0x7) << 6); + data[1] |= (byte)( LookupBase64(s, 3)); + } + + if (s.Length > 5) + { + data[0] = (byte)( LookupBase64(s, 4) << 2); + data[0] |= (byte)( LookupBase64(s, 5) >> 4); + } + + result = BitConverter.ToInt32(data, 0); + + //0 12 34 56 + //1 78 12 34 + //2 56 78 12 + //3 34 56 78 + + //4 12 34 56 + //5 78 12 34 + //6 56 78 12 + //7 34 56 78 + } + catch + { + result = (new Random()).Next(); + } + Verbose(@"Base64ToInteger(""{0}"")={1}", _str, result); + return result; + } + + /* +0 LIST_STAT_RANGE Returns the range. +1 LIST_STAT_MIN Retrieves the smallest number. +2 LIST_STAT_MAX Retrieves the largest number. +3 LIST_STAT_MEAN Retrieves the mean (average). +4 LIST_STAT_MEDIAN Retrieves the median number. +5 LIST_STAT_STD_DEV Calculates the standard deviation. +6 LIST_STAT_SUM Calculates the sum. +7 LIST_STAT_SUM_SQUARES Calculates the sum of the squares. +8 LIST_STAT_NUM_COUNT Retrieves the amount of float and integer elements. Theoretically similar to llGetListLength, except LL states that this function ignores all non-integer and non-float elements. Therefore, this is a useful tool for mixed lists of numbers and non-numbers. +9 LIST_STAT_GEOMETRIC_MEAN Calculates the geometric mean. All numbers must be greater than zero for this to work, according to LL. + */ + + private List GetListOfNumbers(list input) + { + List result = new List(); + for (int intI = 0; intI < input.Count; intI++) + { + object objI = input[intI]; + string strType = objI.GetType().ToString().Replace("LSLEditor.SecondLife+", ""); + switch (strType) + { + case "Float": + result.Add(Convert.ToDouble((Float)objI)); + break; + case "System.Int32": + result.Add(Convert.ToDouble((int)objI)); + break; + case "System.Double": + result.Add(Convert.ToDouble((double)objI)); + break; + case "integer": + result.Add(Convert.ToDouble((integer)objI)); + break; + default: + break; + } + } + return result; + } + + private double GetAverage(double[] data) + { + try + { + double DataTotal = 0; + for (int i = 0; i < data.Length; i++) + { + DataTotal += data[i]; + } + return SafeDivide(DataTotal, data.Length); + } + catch (Exception) { throw; } + } + + public double GetStandardDeviation(double[] num) + { + double Sum = 0.0, SumOfSqrs = 0.0; + for (int i = 0; i < num.Length; i++) + { + Sum += num[i]; + SumOfSqrs += Math.Pow(num[i], 2); + } + double topSum = (num.Length * SumOfSqrs) - (Math.Pow(Sum, 2)); + double n = (double)num.Length; + return Math.Sqrt(topSum / (n * (n - 1))); + } + + + private double SafeDivide(double value1, double value2) + { + double ret = 0; + try + { + if ((value1 == 0) || (value2 == 0)) { return ret; } + ret = value1 / value2; + } + catch { } + return ret; + } + + public Float llListStatistics(integer _operation, list _input) + { + double result = 0.0; + double rmin, rmax; + int operation = _operation; + List input = GetListOfNumbers(_input); + if (input.Count > 0) + { + switch (operation) + { + case 0: // LIST_STAT_RANGE: + rmin = double.MaxValue; + rmax = double.MinValue; + for (int intI = 0; intI < input.Count; intI++) + { + if (input[intI] < rmin) + rmin = input[intI]; + if (input[intI] > rmax) + rmax = input[intI]; + } + result = rmax - rmin; + break; + case 1: //LIST_STAT_MIN: + result = double.MaxValue; + for (int intI = 0; intI < input.Count; intI++) + if (input[intI] < result) + result = input[intI]; + break; + case 2: //LIST_STAT_MAX: + result = double.MinValue; + for (int intI = 0; intI < input.Count; intI++) + if (input[intI] > result) + result = input[intI]; + break; + case 3: //LIST_STAT_MEAN: + for (int intI = 0; intI < input.Count; intI++) + result += input[intI]; + result = result / input.Count; + break; + case 4: //LIST_STAT_MEDIAN: + input.Sort(); + if (Math.Ceiling(input.Count * 0.5) == input.Count * 0.5) + result = (input[(int)(input.Count * 0.5 - 1)] + input[(int)(input.Count * 0.5)]) / 2; + else + result = input[((int)(Math.Ceiling(input.Count * 0.5))) - 1]; + break; + case 5: //LIST_STAT_STD_DEV: + result = GetStandardDeviation(input.ToArray()); + break; + case 6: //LIST_STAT_SUM: + for (int intI = 0; intI < input.Count; intI++) + result += input[intI]; + break; + case 7: //LIST_STAT_SUM_SQUARES: + for (int intI = 0; intI < input.Count; intI++) + result += input[intI] * input[intI]; + //double av = GetAverage(input.ToArray()); + //for (int intI = 0; intI < input.Count; intI++) + // result += (av - input[intI]) * (av - input[intI]); + break; + case 8: //LIST_STAT_NUM_COUNT: + result = input.Count; + break; + case 9: //LIST_STAT_GEOMETRIC_MEAN: + for (int intI = 0; intI < input.Count; intI++) + input[intI] = Math.Log(input[intI]); + result = Math.Exp(GetAverage(input.ToArray())); + break; + default: + break; + } + } + Verbose("ListStatistics({0},{1})={2}",_operation,_input.ToString(),result); + return result; + } + public void llLoadURL(key avatar_id, String message, String url) + { + Verbose("LoadURL(" + avatar_id + "," + message + "," + url + ")"); + string strUrl = url.ToString(); + if(strUrl.StartsWith("http://")) + System.Diagnostics.Process.Start(strUrl); + } + + public void llMapDestination(String simname, vector position, vector lookat) + { + Verbose("MapDestination(" + simname + "," + position + "," + lookat + ")"); + } + + // ok + public String llMD5String(String src, integer nonce) + { + System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); + byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes(src + ":" + nonce.ToString())); + StringBuilder sb = new StringBuilder(); + foreach (byte hex in hash) + sb.Append(hex.ToString("x2")); //convert to standard MD5 form + Verbose("MD5String({0},{1})={2}",src,nonce,sb); + return sb.ToString(); + } + + public void llParcelMediaCommandList(list command_list) + { + Verbose("ParcelMediaCommandList(" + command_list.ToString() + ")"); + } + public list llParcelMediaQuery(list query_list) + { + Verbose("ParcelMediaQuery(" + query_list.ToString() + ")"); + return new list(); + } + public void llReleaseCamera(key agent) + { + Verbose("ReleaseCamera(" + agent + ")"); + } + public void llRemoteDataSetRegion() + { + Verbose("RemoteDataSetRegion()"); + } + public void llRemoteLoadScriptPin(key target, String name, integer pin, integer running, integer start_param) + { + Verbose("RemoteLoadScriptPin(" + target + "," + name + "," + pin + "," + running + "," + start_param + ")"); + } + public key llRequestSimulatorData(String simulator, integer data) + { + Verbose("RequestSimulatorData(" + simulator + "," + data + ")"); + return NULL_KEY; + } + public void llRezAtRoot(String inventory, vector pos, vector vel, rotation rot, integer param) + { + Verbose("RezAtRoot(" + inventory + "," + pos + "," + vel + "," + rot + "," + param + ")"); + } + public void llSetCameraParams(list rules) + { + Verbose("SetCameraParams(" + rules.ToString() + ")"); + } + public void llSetLinkAlpha(integer linknumber, Float alpha, integer face) + { + Verbose("SetLinkAlpha(" + linknumber + "," + alpha + "," + face + ")"); + } + public void llSetLocalRot(rotation rot) + { + this.m_rotlocal = rot; + Verbose("SetLocalRot(" + rot + ")"); + } + + public void llSetParcelMusicURL(String url) + { + Verbose("SetParcelMusicURL(" + url + ")"); + } + + public void llSetPayPrice(integer price, list quick_pay_buttons) + { + Verbose("SetPayPrice(" + price + "," + quick_pay_buttons.ToString() + ")"); + } + + public void llSetRemoteScriptAccessPin(integer pin) + { + Verbose("SetRemoteScriptAccessPin(" + pin + ")"); + } + + public String llStringTrim(String text, integer trim_type) + { + string strResult = text.ToString(); + + if ((trim_type & STRING_TRIM_HEAD) != 0) + strResult = strResult.TrimStart(); + + if ((trim_type & STRING_TRIM_TAIL) != 0) + strResult = strResult.TrimEnd(); + + Verbose(@"llStringTrim(""{0}"",{1})=""{2}""", text, trim_type, strResult); + return strResult; + } + + public String llEscapeURL(String url) + { + StringBuilder sb = new StringBuilder(); + byte[] data = Encoding.UTF8.GetBytes(url.ToString()); + for (int intI = 0; intI < data.Length; intI++) + { + byte chrC = data[intI]; + if( (chrC>='a' && chrC<='z') || + (chrC>='A' && chrC<='Z') || + (chrC>='0' && chrC<='9')) + sb.Append((char)chrC); + else + sb.AppendFormat("%{0:X2}", (int)chrC); + } + Verbose(string.Format(@"EscapeURL(""{0}"")=""{1}""", url, sb.ToString())); + return sb.ToString(); + } + + private byte HexToInt(byte b) + { + if (b >= '0' && b <= '9') + return (byte)(b - '0'); + else if ((b >= 'a' && b <= 'f') || (b >= 'A' && b <= 'F')) + return (byte)((b & 0x5f) - 0x37); + else + return 0; // error + } + + public String llUnescapeURL(String url) + { + byte[] data = Encoding.UTF8.GetBytes(url.ToString()); + List list = new List(); + for (int intI = 0; intI < data.Length; intI++) + { + byte chrC = data[intI]; + if (chrC == (byte)'%') + { + if(intI<(data.Length-2)) + list.Add((byte) + ( HexToInt(data[intI + 1])<<4 + | HexToInt(data[intI + 2]))); + intI += 2; + } + else + { + list.Add(chrC); + } + } + data = list.ToArray(); + int intLen = Array.IndexOf(data, (byte)0x0); + if (intLen < 0) + intLen = data.Length; + string strTmp = Encoding.UTF8.GetString(data,0,intLen); + Verbose(string.Format(@"llUnescapeURL(""{0}"")=""{1}""", url, strTmp)); + return strTmp; + } + + public void llSetInventoryPermMask(String item, integer mask, integer value) + { + Verbose("SetInventoryPermMask(" + item + "," + mask + "," + value + ")"); + } + + public void llSetObjectPermMask(integer mask, integer value) + { + Verbose("SetObjectPermMask(" + mask + "," + value + ")"); + } + + public void llTakeCamera(key avatar) + { + Verbose("TakeCamera(" + avatar + ")"); + } + + + // added 4 mei 2007 + public integer llGetObjectPrimCount(key id) + { + Verbose("llGetObjectPrimCount(" + id + ")"); + return 0; + } +/* +PARCEL_DETAILS_NAME 0 The name of the parcel. 63 Characters string +PARCEL_DETAILS_DESC 1 The description of the parcel. 127 Characters string +PARCEL_DETAILS_OWNER 2 The parcel owner's key. (36 Characters) key +PARCEL_DETAILS_GROUP 3 The parcel group's key. (36 Characters) key +PARCEL_DETAILS_AREA 4 The parcel's area, in sqm. (5 Characters) integer +*/ + public list llGetParcelDetails(vector pos, list details) + { + list result = new list(); + for (int intI = 0; intI < details.Count; intI++) + { + if (details[intI] is integer) + { + switch ((int)(integer)details[intI]) + { + case 0: // PARCEL_DETAILS_NAME: + result.Add(Properties.Settings.Default.ParcelName); + break; + case 1: // PARCEL_DETAILS_DESC: + result.Add(Properties.Settings.Default.ParcelDescription); + break; + case 2: //PARCEL_DETAILS_OWNER: + result.Add(new key(Properties.Settings.Default.ParcelOwner)); + break; + case 3: //PARCEL_DETAILS_GROUP: + result.Add(new key(Properties.Settings.Default.ParcelGroup)); + break; + case 4: // PARCEL_DETAILS_AREA: + result.Add(new integer(Properties.Settings.Default.ParcelArea)); + break; + default: + break; + } + } + } + Verbose("llGetParcelDetails({0},{1})={2}", pos, details.ToVerboseString(), result.ToVerboseString()); + return result; + } + public integer llGetParcelMaxPrims(vector pos, integer sim_wide) + { + Verbose("llGetParcelMaxPrims(" + pos + "," + sim_wide + ")"); + return 0; + } + public integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide) + { + Verbose("llGetParcelPrimCount(" + pos + "," + category + "," + sim_wide + ")"); + return 0; + } + public list llGetParcelPrimOwners(vector pos) + { + list result = new list(new object[] { Properties.Settings.Default.AvatarKey, 10 }); + Verbose("llGetParcelPrimOwners({0})={1}", pos, result); + return result; + } + + public void llSetLinkPrimitiveParams(integer linknumber, list rules) + { + Verbose("llSetLinkPrimitiveParams({0},[{1}])",linknumber,rules); + } + + public void llSetLinkTexture(integer linknumber, String texture, integer face) + { + Verbose(@"llSetLinkTexture({0},""{1}"",{2})",linknumber,texture,face); + } + + public list llGetObjectDetails(key id, list _params) + { + list result = new list(); + for (int intI = 0; intI < _params.Count; intI++) + { + if (!(_params[intI] is integer)) + continue; + switch ((int)(integer)_params[intI]) + { + case 1: //OBJECT_NAME: + result.Add((SecondLife.String)host.GetObjectName(new Guid(id.guid))); + break; + case 2: //OBJECT_DESC: + result.Add((SecondLife.String)host.GetObjectDescription(new Guid(id.guid))); + break; + case 3://OBJECT_POS: + break; + case 4://OBJECT_ROT: + break; + case 5://OBJECT_VELOCITY: + break; + case 6://OBJECT_OWNER: + break; + case 7://OBJECT_GROUP: + break; + case 8://OBJECT_CREATOR: + break; + default: + break; + } + } + Verbose(@"llGetObjectDetails({0},{1})={2}", id, _params, result); + return result; + } + + public void llSetClickAction(integer action) + { + Verbose("llSetClickAction({0})", action); + } + #endregion + + // 334 + public integer llGetRegionAgentCount() + { + Verbose("llGetRegionAgentCount()"); + return 0; + } + + // 335 + public void llTextBox(key avatar, String message, integer chat_channel) + { + Verbose("llTextBox({0},\"{1}\",{2})",avatar,message,chat_channel); + } + + // 336 + public String llGetAgentLanguage(key avatar) + { + string strLan = "en-us"; + Verbose("llGetAgentLanguage({0})=\"{1}\"", avatar, strLan); + return strLan; + } + + // 337 + public vector llDetectedTouchUV(integer index) + { + Verbose("llDetectedTouchUV({0})", index); + return new vector(); + } + + // 338 + public integer llDetectedTouchFace(integer index) + { + Verbose("llDetectedTouchFace({0})", index); + return 0; + } + + // 339 + public vector llDetectedTouchPos(integer index) + { + Verbose("llDetectedTouchPos({0})", index); + return new vector(); + } + + // 340 + public vector llDetectedTouchNormal(integer index) + { + Verbose("llDetectedTouchNormal({0})", index); + return new vector(); + } + + // 341 + public vector llDetectedTouchBinormal(integer index) + { + Verbose("llDetectedTouchBinormal({0})", index); + return new vector(); + } + + // 342 + public vector llDetectedTouchST(integer index) + { + Verbose("llDetectedTouchST({0})", index); + return new vector(); + } + + // 343 + public String llSHA1String(String src) + { + byte[] buffer = System.Text.Encoding.UTF8.GetBytes(src.ToString()); + System.Security.Cryptography.SHA1CryptoServiceProvider cryptoTransformSHA1 = new System.Security.Cryptography.SHA1CryptoServiceProvider(); + string hash = BitConverter.ToString(cryptoTransformSHA1.ComputeHash(buffer)).Replace("-", ""); + Verbose("llSHA1String(\"{0}\")=\"{1}\"", src, hash); + return hash; + } + //344 + public integer llGetFreeURLs() + { + return 0; + } + //345 + public key llRequestURL() + { + return new key(); + } + //346 + public key llRequestSecureURL( ) + { + return new key(); + } + //347 + public void llReleaseURL( string url ) + { + } + //348 + public void llHTTPResponse( key request_id, integer status, String body ) + { + } + //349 + public String llGetHTTPHeader(key request_id, String header) + { + return "not-implemented"; + } + + } +} diff --git a/SecondLife/String.cs b/SecondLife/String.cs new file mode 100644 index 0000000..613b6fe --- /dev/null +++ b/SecondLife/String.cs @@ -0,0 +1,140 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct String + { + private string value; + + public String(string s) + { + this.value = s; + } + + public static implicit operator String(string s) + { + return new String(s); + } + + // 3 oct 2007 + public static explicit operator String(bool a) + { + if (a) + return "1"; + else + return "0"; + } + + // 24 augustus 2007 + public static explicit operator String(int i) + { + return new String(i.ToString()); + } + + public static explicit operator String(long i) + { + return new String(((int)(uint)i).ToString()); + } + + public static explicit operator String(float i) + { + return new String(string.Format("{0:0.000000}",i)); + } + + public static implicit operator string(String s) + { + return s.ToString(); + } + + public static implicit operator bool(String s) + { + if (s.value == null) + return false; + else + return (s.value.Length != 0); + } + + public static bool operator ==(String x, String y) + { + return (x.ToString() == y.ToString()); + } + + public static bool operator !=(String x, String y) + { + return !(x==y); + } + + // Public overrides + + public override bool Equals(object o) + { + try + { + return (bool)(this.value == o.ToString()); + } + catch + { + return false; + } + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override string ToString() + { + if (this.value == null) + this.value = ""; + return this.value; + } + + } + } +} diff --git a/SecondLife/integer.cs b/SecondLife/integer.cs new file mode 100644 index 0000000..2a8e3f0 --- /dev/null +++ b/SecondLife/integer.cs @@ -0,0 +1,294 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct integer + { + public static readonly integer FALSE = new integer(0); + public static readonly integer TRUE = new integer(1); + + private object m_value; + private Int32 value + { + get + { + if (m_value == null) + m_value = (Int32)0; + return (Int32)m_value; + } + set + { + m_value = value; + } + } + + // Constructor. + public integer(Int32 value) + { + this.m_value = value; + } + + public integer(string s) + { + Float f = new Float(s); + this.m_value = (Int32)f; + } + + // Implicit conversion from bool to integer. Maps true to + // integer.TRUE and false to integer.FALSE: + public static implicit operator integer(Boolean x) + { + return x ? TRUE : FALSE; + } + + public static implicit operator integer(int x) + { + return new integer(x); + } + + public static implicit operator integer(uint x) + { + return new integer((int)x); + } + + // 3 oct 2007 + public static implicit operator integer(long x) + { + return new integer((int)(uint)x); + } + + // 15 aug 2007 made explicit + public static explicit operator integer(Double x) + { + return new integer((int)x); + } + + // 15 aug 2007 made explicit + public static explicit operator integer(Float x) + { + return new integer((int)x); + } + + public static explicit operator integer(String x) + { + return new integer(x.ToString()); + } + + // 6 jan 2008, BlandWanderer thingy + public static explicit operator integer(string x) + { + Float f = new Float(x); + return new integer((int)(uint)f); + } + + + // Explicit conversion from integer to bool. + // returns true when non zero else false + public static explicit operator bool(integer x) + { + return (x.value != 0); + } + + // Logical negation (NOT) operator + public static integer operator !(integer x) + { + if (x.value == 0) + return TRUE; + else + return FALSE; + } + + // Bitwise AND operator + public static integer operator &(integer x, integer y) + { + return new integer(x.value & y.value); + } + + // Bitwise OR operator + public static integer operator |(integer x, integer y) + { + return new integer(x.value | y.value); + } + + // Bitwise Not operator + public static integer operator ~(integer a) + { + return new integer(~a.value); + } + + // Bitwise Xor operator + public static integer operator ^(integer a, integer b) + { + return new integer(a.value ^ b.value); + } + + // Bitwise Shift right (b must be int) + public static integer operator >>(integer a, int b) + { + return new integer(a.value >> b); + } + + // Bitwise Shift left (b must be int) + public static integer operator <<(integer a, int b) + { + return new integer(a.value << b); + } + + public static integer operator %(integer a, integer b) + { + return new integer(a.value % b.value); + } + + + // Definitely true operator. Returns true if the operand is + // !=0, false otherwise: + public static bool operator true(integer x) + { + return (x.value != 0); + } + + // Definitely false operator. Returns true if the operand is + // ==0, false otherwise: + public static bool operator false(integer x) + { + return (x.value == 0); + } + + public static explicit operator String(integer x) + { + return x.value.ToString(); + } + + // this one is needed by the compiler + public static implicit operator Int32(integer x) + { + return x.value; + } + + public static integer operator +(integer a, integer b) + { + return new integer(a.value + b.value); + } + + public static integer operator -(integer a, integer b) + { + return new integer(a.value - b.value); + } + + public static integer operator -(integer a, bool b) + { + return a - (integer)b; + } + + public static integer operator +(integer a, bool b) + { + return a + (integer)b; + } + + // 6 jan 2008 + public static integer operator *(integer a, integer b) + { + return new integer(a.value * b.value); + } + + // 23 feb 2008 + public static integer operator *(integer a, Float b) + { + Float result = (Float)a.value * b; + return new integer((int)result); + } + + // 6 jan 2008 + public static bool operator ==(integer a, integer b) + { + return (a.value == b.value); + } + + // 6 jan 2008 + public static bool operator !=(integer a, integer b) + { + return (a.value != b.value); + } + + public static int Compare(integer a, integer b) + { + if (a.value < b.value) + return -1; + if (a.value > b.value) + return 1; + return 0; + } + + // Override the Object.Equals(object o) method: + public override bool Equals(object o) + { + try + { + return (bool)(this == (integer)o); + } + catch + { + return false; + } + } + + // Override the Object.GetHashCode() method: + public override int GetHashCode() + { + return value; + } + + // Override the ToString method to convert integer to a string: + public override string ToString() + { + return value.ToString(); + } + + } + } +} diff --git a/SecondLife/key.cs b/SecondLife/key.cs new file mode 100644 index 0000000..d957998 --- /dev/null +++ b/SecondLife/key.cs @@ -0,0 +1,170 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct key + { + private string m_value; + + public string guid + { + get + { + if (m_value == null) + m_value = ""; + return m_value; + } + set + { + m_value = value; + } + } + + public key(Guid guid) + { + this.m_value = guid.ToString(); + } + + public key(string strGuid) + { + this.m_value = strGuid; + } + + public static readonly key NULL_KEY; + static key() + { + NULL_KEY = new key("00000000-0000-0000-0000-000000000000"); + } + + // This is the one-and-only implicit typecasting in SecondLife + public static implicit operator key(string strGuid) + { + if (strGuid == null) + return new key(""); + else + return new key(strGuid); + } + + public static implicit operator key(String _strGuid) + { + string strGuid = _strGuid; + if (strGuid == null) + return new key(""); + else + return new key(strGuid); + } + + public override string ToString() + { + if (this.guid == null) + this.guid = ""; + return this.guid.ToString(); + } + + //public static explicit operator String(key k) + //{ + // return k.ToString(); + //} + + // Check this!!!! + public static implicit operator String(key k) + { + return k.ToString(); + } + + public static bool operator ==(key key1, key key2) + { + return (key1.guid == key2.guid); + } + + public static bool operator !=(key key1, key key2) + { + return !(key1.guid == key2.guid); + } + + public static bool operator true(key k) + { + if ((object)k == null) + return false; + if (k.guid == NULL_KEY) + return false; + if (k.guid == "") + return false; + return true; + } + + public static bool operator false(key k) + { + if ((object)k == null) + return true; + if (k.guid == NULL_KEY) + return true; + if (k.guid == "") + return true; + return false; + } + + public override bool Equals(object obj) + { + try + { + return (this == (key)obj); + } + catch + { + return false; + } + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + } +} diff --git a/SecondLife/list.cs b/SecondLife/list.cs new file mode 100644 index 0000000..f9409aa --- /dev/null +++ b/SecondLife/list.cs @@ -0,0 +1,349 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using System.Collections; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct list + { + private System.Collections.ArrayList value; + + public list(object[] args) + { + this.value = new ArrayList(); + foreach (object objA in args) + this.Add(objA); + } + + public list(list a) + { + this.value = new ArrayList(); + this.value.AddRange(a.ToArray()); + } + + public int Count + { + get + { + if (this.value == null) + this.value = new ArrayList(); + return this.value.Count; + } + } + + public void AddRange(list c) + { + if(this.value == null) + this.value = new ArrayList(); + this.value.AddRange(c.ToArray()); + } + + public void Add(object value) + { + if (this.value == null) + this.value = new ArrayList(); + string strType = value.GetType().ToString(); + if (value is string) + this.value.Add((String)value.ToString()); + else if (value is int) + this.value.Add(new integer((int)value)); + else if (value is uint) + this.value.Add(new integer((int)(uint)value)); + else if (value is double) + this.value.Add(new Float((double)value)); + else + this.value.Add(value); + } + + public object this[int index] + { + get + { + if (this.value == null) + this.value = new ArrayList(); + return this.value[index]; + } + set + { + if (this.value == null) + this.value = new ArrayList(); + this.value[index] = value; + } + } + + public void Insert(int index, object value) + { + if (this.value == null) + this.value = new ArrayList(); + + if (this.value == null) + this.value = new ArrayList(); + string strType = value.GetType().ToString(); + if (value is string) + this.value.Insert(index, (String)value.ToString()); + else if (value is int) + this.value.Insert(index, new integer((int)value)); + else if (value is uint) + this.value.Insert(index, new integer((int)(uint)value)); + else if (value is double) + this.value.Insert(index, new Float((double)value)); + else + this.value.Insert(index, value); + } + + public object[] ToArray() + { + if (this.value == null) + this.value = new ArrayList(); + return this.value.ToArray(); + } + + public static list operator +(list a, list b) + { + list l = new list(); + if((object)a != null) + l.AddRange(a); + if ((object)b != null) + l.AddRange(b); + return l; + } + + public static list operator +(object b, list a) + { + list l = new list(); + if ((object)a != null) + l.AddRange(a); + l.Insert(0, b); + return l; + } + + public static list operator +(list a, object b) + { + list l = new list(); + if ((object)a != null) + l.AddRange(a); + l.Add(b); + return l; + } + + public static explicit operator list(string a) + { + list l = new list(); + l.Add(a); + return l; + } + public static explicit operator list(String a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(integer a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(key a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(vector a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(rotation a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(uint a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(int a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static explicit operator list(double a) + { + list l = new list(); + l.Add(a); + return l; + } + + public static integer operator ==(list l, list m) + { + if (l.Count != m.Count) + return FALSE; + for (int intI = 0; intI < l.Count; intI++) + if (!l[intI].Equals(m[intI])) + return FALSE; + return TRUE; + } + + public static integer operator !=(list l, list m) + { + int intDifferent=0; + if (m.Count == 0) // shortcut + return l.Count; + for (int intI = 0; intI < l.Count; intI++) + { + bool blnFound = false; + for (int intJ = 0; intJ < m.Count; intJ++) + { + if (l[intI].Equals(m[intJ])) + { + blnFound = true; + break; + } + } + if(!blnFound) + intDifferent++; + } + return intDifferent; + } + + public static bool operator true(list x) + { + if ((object)x == null) + return false; + return (x.value.Count != 0); + } + + // Definitely false operator. Returns true if the operand is + // ==0, false otherwise: + public static bool operator false(list x) + { + if ((object)x == null) + return true; + return (x.value.Count == 0); + } + + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override bool Equals(object obj) + { + int intResult = (this == (list)obj); + return (intResult == 1); + } + + public string ToVerboseString() + { + if (this.value == null) + this.value = new ArrayList(); + + StringBuilder sb = new StringBuilder(); + sb.Append('['); + for (int intI = 0; intI < this.value.Count; intI++) + { + if(intI>0) + sb.Append(','); + if((this.value[intI] is string) && Properties.Settings.Default.QuotesListVerbose) + sb.Append("\""+this.value[intI].ToString()+"\""); + else + sb.Append(this.value[intI].ToString()); + } + sb.Append(']'); + return sb.ToString(); + } + + public override string ToString() + { + if (this.value == null) + this.value = new ArrayList(); + StringBuilder sb = new StringBuilder(); + for (int intI = 0; intI < this.value.Count; intI++) + { + if (this.value[intI] is vector) + { + vector v = (vector)this.value[intI]; + sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}>", (double)v.x, (double)v.y, (double)v.z); + } + else if (this.value[intI] is rotation) + { + rotation r = (rotation)this.value[intI]; + sb.AppendFormat(new System.Globalization.CultureInfo("en-us"), "<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", (double)r.x, (double)r.y, (double)r.z, (double)r.s); + } + else + sb.Append(this.value[intI].ToString()); + } + return sb.ToString(); + } + + public static explicit operator String(list l) + { + if ((object)l == null) + return ""; + else + return l.ToString(); + } + + } + } +} diff --git a/SecondLife/rotation.cs b/SecondLife/rotation.cs new file mode 100644 index 0000000..982cab2 --- /dev/null +++ b/SecondLife/rotation.cs @@ -0,0 +1,281 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct rotation + { + private object m_x, m_y, m_z, m_s; + + public Float x + { + get + { + if (m_x == null) + m_x = (Float)0; + return (Float)m_x; + } + set + { + m_x = value; + } + } + + public Float y + { + get + { + if (m_y == null) + m_y = (Float)0; + return (Float)m_y; + } + set + { + m_y = value; + } + } + + public Float z + { + get + { + if (m_z == null) + m_z = (Float)0; + return (Float)m_z; + } + set + { + m_z = value; + } + } + + public Float s + { + get + { + if (m_s == null) + m_s = (Float)0; + return (Float)m_s; + } + set + { + m_s = value; + } + } + public static readonly rotation ZERO_ROTATION; + public rotation(double x, double y, double z, double s) + { + this.m_x = (Float)x; + this.m_y = (Float)y; + this.m_z = (Float)z; + this.m_s = (Float)s; + } + + public static explicit operator rotation(String s) + { + return new rotation(s.ToString()); + } + + public static explicit operator rotation(string s) + { + return new rotation(s); + } + + public rotation(string a) + { + this.m_x = (Float)0; + this.m_y = (Float)0; + this.m_z = (Float)0; + this.m_s = (Float)0; + Regex regex = new Regex( + @"<(?[^,]*),(?[^,]*),(?[^,]*),(?[^,]*)>", + RegexOptions.IgnorePatternWhitespace | + RegexOptions.Compiled); + Match m = regex.Match(a); + if (m.Success) + { + this.m_x = new Float(m.Groups["x"].Value); + this.m_y = new Float(m.Groups["y"].Value); + this.m_z = new Float(m.Groups["z"].Value); + this.m_s = new Float(m.Groups["s"].Value); + } + } + + static rotation() + { + ZERO_ROTATION = new rotation(0, 0, 0, 1); + } + + public override string ToString() + { + return string.Format(new System.Globalization.CultureInfo("en-us"), "<{0:0.00000}, {1:0.00000}, {2:0.00000}, {3:0.00000}>", (double)this.x, (double)this.y, (double)this.z, (double)this.s); + } + + public static explicit operator String(rotation rot) + { + if ((object)rot == null) + return ZERO_ROTATION.ToString(); + else + return rot.ToString(); + } + + // 23 feb 2008 + public static rotation operator -(rotation r) + { + return new rotation(-r.x, -r.y, -r.z, -r.s); + } + // 23 feb 2008 + public static rotation operator +(rotation r) + { + return new rotation(r.x, r.y, r.z, r.s); + } + + + public static rotation operator *(rotation q, rotation r) + { + rotation rot = new rotation( + r.s * q.x - r.z * q.y + r.y * q.z + r.x * q.s, + r.s * q.y + r.z * q.x + r.y * q.s - r.x * q.z, + r.s * q.z + r.z * q.s - r.y * q.x + r.x * q.y, + r.s * q.s - r.z * q.z - r.y * q.y - r.x * q.x); + return rot; + } + + public static rotation operator /(rotation q, rotation r) + { // 23 feb 2008 + rotation rot = new rotation( + r.s * q.x + r.z * q.y - r.y * q.z - r.x * q.s, + r.s * q.y - r.z * q.x - r.y * q.s + r.x * q.z, + r.s * q.z - r.z * q.s + r.y * q.x - r.x * q.y, + r.s * q.s + r.z * q.z + r.y * q.y + r.x * q.x); + return rot; + } + + public static rotation operator +(rotation q, rotation r) + { + return new rotation( + q.x + r.x, + q.y + r.y, + q.z + r.z, + q.s + r.s + ); + } + + public static rotation operator -(rotation q, rotation r) + { + return new rotation( + q.x - r.x, + q.y - r.y, + q.z - r.z, + q.s - r.s + ); + } + + public const double EqualityTolerence = 1e-14; //Double.Epsilon; + + public static bool operator ==(rotation r1, rotation r2) + { + if ((object)r1 == null) + r1 = ZERO_ROTATION; + if ((object)r2 == null) + r2 = ZERO_ROTATION; + if (Math.Abs(r1.x - r2.x) > EqualityTolerence) + return false; + if (Math.Abs(r1.y - r2.y) > EqualityTolerence) + return false; + if (Math.Abs(r1.z - r2.z) > EqualityTolerence) + return false; + if (Math.Abs(r1.s - r2.s) > EqualityTolerence) + return false; + return true; + } + + public static bool operator !=(rotation r, rotation s) + { + return !(r == s); + } + + public static bool operator true(rotation r) + { + if ((object)r == null) + return false; + if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) + return false; + return true; + } + + public static bool operator false(rotation r) + { + if ((object)r == null) + return true; + if (r.x == 0 && r.y == 0 && r.z == 0 && r.s == 1) + return true; + return false; + } + + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override bool Equals(object obj) + { + try + { + return (this == (rotation)obj); + } + catch + { + return false; + } + } + + } + } +} diff --git a/SecondLife/vector.cs b/SecondLife/vector.cs new file mode 100644 index 0000000..1850572 --- /dev/null +++ b/SecondLife/vector.cs @@ -0,0 +1,292 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text.RegularExpressions; + +namespace LSLEditor +{ + public partial class SecondLife + { + public struct vector + { + private object m_x, m_y, m_z; + + public Float x + { + get + { + if (m_x == null) + m_x = (Float)0; + return (Float)m_x; + } + set + { + m_x = value; + } + } + + public Float y + { + get + { + if (m_y == null) + m_y = (Float)0; + return (Float)m_y; + } + set + { + m_y = value; + } + } + + public Float z + { + get + { + if (m_z == null) + m_z = (Float)0; + return (Float)m_z; + } + set + { + m_z = value; + } + } + + public static readonly vector ZERO_VECTOR; + public vector(double x, double y, double z) + { + this.m_x = (Float)x; + this.m_y = (Float)y; + this.m_z = (Float)z; + } + public vector(string a) + { + this.m_x = (Float)0; + this.m_y = (Float)0; + this.m_z = (Float)0; + Regex regex = new Regex( + @"<(?[^,]*),(?[^,]*),(?[^,]*)>", + RegexOptions.IgnorePatternWhitespace | + RegexOptions.Compiled); + Match m = regex.Match(a); + if (m.Success) + { + this.m_x = new Float(m.Groups["x"].Value); + this.m_y = new Float(m.Groups["y"].Value); + this.m_z = new Float(m.Groups["z"].Value); + } + } + static vector() + { + ZERO_VECTOR = new vector(0, 0, 0); + } + + public static explicit operator vector(string s) + { + return new vector(s); + } + + public static explicit operator vector(String s) + { + return new vector(s.ToString()); + } + + private double SumSqrs() + { + return x * x + y * y + z * z; + } + + public static vector operator +(vector vector1, vector vector2) + { + return new vector(vector1.x + vector2.x, vector1.y + vector2.y, vector1.z + vector2.z); + } + public static vector operator -(vector vector1, vector vector2) + { + return new vector(vector1.x - vector2.x, vector1.y - vector2.y, vector1.z - vector2.z); + } + // 2 jun 2007 + public static vector operator -(vector vector1) + { + return new vector(-vector1.x, -vector1.y, -vector1.z); + } + // 2 jun 2007 + public static vector operator +(vector vector1) + { + return new vector(vector1.x, vector1.y, vector1.z); + } + public static double operator *(vector vector1, vector vector2) + { + return vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z; + } + + public static vector operator /(vector v1, double dbl1) + { + return new vector(v1.x / dbl1, v1.y / dbl1, v1.z / dbl1); + } + public static vector operator *(vector v1, double dbl1) + { + return new vector(v1.x * dbl1, v1.y * dbl1, v1.z * dbl1); + } + public static vector operator *(double dbl1, vector v1) + { + return v1 * dbl1; + } + public static vector operator %(vector vector1, vector vector2) + { + return new vector( + vector1.y * vector2.z - vector1.z * vector2.y, + vector1.z * vector2.x - vector1.x * vector2.z, + vector1.x * vector2.y - vector1.y * vector2.x); + } + + // checked 3 jun 2007 + public static vector operator *(vector v, rotation r) + { + return new vector( +(r.s * r.s + r.x * r.x - r.y * r.y - r.z * r.z) * v.x + 2 * (r.x * r.y - r.s * r.z) * v.y + 2 * (r.s * r.y + r.x * r.z) * v.z, +2 * (r.s * r.z + r.x * r.y) * v.x + (r.s * r.s - r.x * r.x + r.y * r.y - r.z * r.z) * v.y + 2 * (r.y * r.z - r.s * r.x) * v.z, +2 * (r.x * r.z - r.s * r.y) * v.x + 2 * (r.s * r.x + r.y * r.z) * v.y + (r.s * r.s - r.x * r.x - r.y * r.y + r.z * r.z) * v.z + ); + } + + public static vector operator /(vector v, rotation r) + { + rotation inverseR = new rotation(-r.x,-r.y,-r.z,r.s); + return (v * inverseR); + } + + // 2 jun 2007 + public static bool operator <(vector v1, vector v2) + { + return v1.SumSqrs() < v2.SumSqrs(); + } + // 2 jun 2007 + public static bool operator <=(vector v1, vector v2) + { + return v1.SumSqrs() <= v2.SumSqrs(); + } + // 2 jun 2007 + public static bool operator >(vector v1, vector v2) + { + return v1.SumSqrs() > v2.SumSqrs(); + } + public static bool operator >=(vector v1, vector v2) + { + return v1.SumSqrs() >= v2.SumSqrs(); + } + + public const double EqualityTolerence = 1e-14; + + public static bool operator ==(vector v1, vector v2) + { + if ((object)v1 == null) + v1 = ZERO_VECTOR; + if ((object)v2 == null) + v2 = ZERO_VECTOR; + + if (Math.Abs(v1.x - v2.x) > EqualityTolerence) + return false; + if (Math.Abs(v1.y - v2.y) > EqualityTolerence) + return false; + if (Math.Abs(v1.z - v2.z) > EqualityTolerence) + return false; + return true; + } + + public static bool operator !=(vector v1, vector v2) + { + return !(v1 == v2); + } + + public static bool operator true(vector v) + { + if ((object)v == null) + return false; + if (v.x == 0 && v.y == 0 && v.z == 0) + return false; + return true; + } + + public static bool operator false(vector v) + { + if ((object)v == null) + return true; + if (v.x == 0 && v.y == 0 && v.z == 0) + return true; + return false; + } + + public override string ToString() + { + return string.Format(new System.Globalization.CultureInfo("en-us"), "<{0:0.00000}, {1:0.00000}, {2:0.00000}>", (double)this.x, (double)this.y, (double)this.z); + } + + public static explicit operator String(vector v) + { + if ((object)v == null) + return ZERO_VECTOR.ToString(); + else + return v.ToString(); + } + + public override int GetHashCode() + { + return (int)((x + y + z) % Int32.MaxValue); + } + + public override bool Equals(object obj) + { + try + { + return (this == (vector)obj); + } + catch + { + return false; + } + } + } + } +} \ No newline at end of file diff --git a/SimulatorConsole.Designer.cs b/SimulatorConsole.Designer.cs new file mode 100644 index 0000000..eddd954 --- /dev/null +++ b/SimulatorConsole.Designer.cs @@ -0,0 +1,181 @@ +namespace LSLEditor +{ + partial class SimulatorConsole + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.buttonShout = new System.Windows.Forms.Button(); + this.buttonSay = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.panel1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Controls.Add(this.buttonShout); + this.panel1.Controls.Add(this.buttonSay); + this.panel1.Controls.Add(this.textBox1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(4, 180); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(507, 35); + this.panel1.TabIndex = 0; + // + // buttonShout + // + this.buttonShout.Location = new System.Drawing.Point(312, 8); + this.buttonShout.Name = "buttonShout"; + this.buttonShout.Size = new System.Drawing.Size(48, 23); + this.buttonShout.TabIndex = 2; + this.buttonShout.Text = "shout"; + this.buttonShout.UseVisualStyleBackColor = true; + this.buttonShout.Click += new System.EventHandler(this.buttonShout_Click); + // + // buttonSay + // + this.buttonSay.Location = new System.Drawing.Point(256, 8); + this.buttonSay.Name = "buttonSay"; + this.buttonSay.Size = new System.Drawing.Size(48, 23); + this.buttonSay.TabIndex = 1; + this.buttonSay.Text = "say"; + this.buttonSay.UseVisualStyleBackColor = true; + this.buttonSay.Click += new System.EventHandler(this.buttonSay_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(8, 8); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(240, 20); + this.textBox1.TabIndex = 0; + this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(4, 4); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(507, 176); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Console"; + // + // textBox2 + // + this.textBox2.AcceptsReturn = true; + this.textBox2.AcceptsTab = true; + this.textBox2.ContextMenuStrip = this.contextMenuStrip1; + this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBox2.Location = new System.Drawing.Point(3, 16); + this.textBox2.Multiline = true; + this.textBox2.Name = "textBox2"; + this.textBox2.ReadOnly = true; + this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox2.Size = new System.Drawing.Size(501, 157); + this.textBox2.TabIndex = 0; + this.textBox2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyDown); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.copyToolStripMenuItem, + this.selectAllToolStripMenuItem, + this.toolStripSeparator1, + this.clearToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(129, 76); + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.Size = new System.Drawing.Size(128, 22); + this.copyToolStripMenuItem.Text = "Copy"; + this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); + // + // selectAllToolStripMenuItem + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(128, 22); + this.selectAllToolStripMenuItem.Text = "Select All"; + this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(125, 6); + // + // clearToolStripMenuItem + // + this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; + this.clearToolStripMenuItem.Size = new System.Drawing.Size(128, 22); + this.clearToolStripMenuItem.Text = "Clear"; + this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + // + // SimulatorConsole + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.panel1); + this.Name = "SimulatorConsole"; + this.Padding = new System.Windows.Forms.Padding(4); + this.Size = new System.Drawing.Size(515, 219); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button buttonShout; + private System.Windows.Forms.Button buttonSay; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + } +} diff --git a/SimulatorConsole.cs b/SimulatorConsole.cs new file mode 100644 index 0000000..a7f883a --- /dev/null +++ b/SimulatorConsole.cs @@ -0,0 +1,410 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class SimulatorConsole : UserControl + { + public event SecondLifeHost.SecondLifeHostChatHandler OnChat; + public event EventHandler OnControl; + + private List History; + private int intHistory; + + private Form[] Children; + private Solution.SolutionExplorer solutionExplorer; + + public SimulatorConsole(Solution.SolutionExplorer solutionExplorer, Form[] Children) + { + InitializeComponent(); + this.solutionExplorer = solutionExplorer; + this.Children = Children; + + this.textBox1.Focus(); + this.Dock = DockStyle.Fill; + this.History = new List(); + this.intHistory = 0; + + if (Properties.Settings.Default.SimulatorLocation != Point.Empty) + this.Location = Properties.Settings.Default.SimulatorLocation; + if (Properties.Settings.Default.SimulatorSize != Size.Empty) + this.Size = Properties.Settings.Default.SimulatorSize; + + this.Clear(); + + SecondLifeHost.SecondLifeHostChatHandler chathandler = new SecondLifeHost.SecondLifeHostChatHandler(SecondLifeHost_OnChat); + SecondLifeHost.SecondLifeHostMessageLinkedHandler messagelinkedhandler = new SecondLifeHost.SecondLifeHostMessageLinkedHandler(SecondLifeHost_OnMessageLinked); + + this.OnChat += chathandler; + this.OnControl += new EventHandler(SimulatorConsole_OnControl); + + this.LocationChanged += new EventHandler(SimulatorConsole_LocationChanged); + + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + editForm.ChatHandler = chathandler; + editForm.MessageLinkedHandler = messagelinkedhandler; + editForm.StartCompiler(); + } + } + + public void Stop() + { + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + editForm.StopCompiler(); + } + } + + private void SimulatorConsole_LocationChanged(object sender, EventArgs e) + { + Properties.Settings.Default.SimulatorLocation = this.Location; + } + + private void SecondLifeHost_OnChat(object sender, SecondLifeHostChatEventArgs e) + { + this.Listen(e); + + // talk only to the owner + if (e.how == CommunicationType.OwnerSay) + return; + + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + + if (editForm.runtime == null) + continue; + + if (editForm.runtime.SecondLifeHost == null) + continue; + + // prevent loops loops loops loops, dont talk to myself + if (sender != editForm.runtime.SecondLifeHost) + editForm.runtime.SecondLifeHost.Listen(e); + } + } + + private void SecondLifeHost_OnMessageLinked(object sender, SecondLifeHostMessageLinkedEventArgs e) + { + SecondLifeHost secondLifeHostSender = sender as SecondLifeHost; + + Guid ObjectGuid = this.solutionExplorer.GetParentGuid(secondLifeHostSender.guid); + Guid RootObjectGuid = this.solutionExplorer.GetParentGuid(ObjectGuid); + + List list; + + int intLinkNum = e.linknum; + switch (intLinkNum) + { + case 1: // LINK_ROOT , root prim in linked set (but not in a single prim, which is 0) + list = this.solutionExplorer.GetScripts(RootObjectGuid, false); + break; + case -1: // LINK_SET , all prims in object + list = this.solutionExplorer.GetScripts(RootObjectGuid, true); + break; + case -2: // LINK_ALL_OTHERS , all other prims in object besides prim function is in + list = this.solutionExplorer.GetScripts(RootObjectGuid, true); + // remove scripts in prim itself, and below + foreach (Guid guid in this.solutionExplorer.GetScripts(ObjectGuid, true)) + { + if (list.Contains(guid)) + list.Remove(guid); + } + break; + case -3: // LINK_ALL_CHILDREN , all child prims in object + list = this.solutionExplorer.GetScripts(RootObjectGuid, true); + // remove root itself + foreach (Guid guid in this.solutionExplorer.GetScripts(RootObjectGuid, false)) + { + if (list.Contains(guid)) + list.Remove(guid); + } + break; + case -4: // LINK_THIS + list = new List(); + list.Add(secondLifeHostSender.guid); // 4 feb 2008 + //list = this.solutionExplorer.GetScripts(ObjectGuid, true); + break; + default: // Link number + Guid ObjectNrGuid = this.solutionExplorer.GetGuidFromObjectNr(ObjectGuid, intLinkNum); + list = this.solutionExplorer.GetScripts(ObjectNrGuid, true); + break; + } + + // only send message to running scripts in list + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + + if (editForm.runtime == null) + continue; + + if (editForm.runtime.SecondLifeHost == null) + continue; + + if(list.Contains(editForm.guid)) + editForm.runtime.SecondLifeHost.LinkMessage(e); + } + } + + private void SimulatorConsole_OnControl(object sender, EventArgs e) + { + foreach (Form form in this.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + + if (editForm.runtime == null) + continue; + + if (editForm.runtime.SecondLifeHost == null) + continue; + + editForm.runtime.SecondLifeHost.SendControl((Keys)sender); + } + } + + private delegate void AppendTextDelegate(string strLine); + public void TalkToSimulatorConsole(string strLine) + { + if (this.textBox2.InvokeRequired) + { + this.textBox2.Invoke(new AppendTextDelegate(TalkToSimulatorConsole), new object[] { strLine }); + } + else + { + this.textBox2.AppendText(strLine.Replace("\n", "\r\n") + "\r\n"); + } + } + + private void Chat(int channel, string name, SecondLife.key id, string message, CommunicationType how) + { + if (OnChat != null) + OnChat(this, new SecondLifeHostChatEventArgs(channel, name, id, message, how)); + } + + public void Listen(SecondLifeHostChatEventArgs e) + { + // Translate the incomming messages a bit so it looks like SL. + string strHow = ": "; + if (e.how == CommunicationType.Shout) + strHow = " shout: "; + + if (e.how == CommunicationType.Whisper) + strHow = " whispers: "; + + string strWho = e.name; + string strMessage = e.message; + + if (e.name == Properties.Settings.Default.AvatarName) + strWho = "You"; + + if (e.message.ToString().StartsWith("/me")) + { + strWho = e.name; + strHow = " "; + strMessage = e.message.ToString().Substring(3).Trim(); + } + + if (e.channel == 0) + TalkToSimulatorConsole(strWho + strHow + strMessage); + } + + private void Speak(CommunicationType how) + { + int intChannel = 0; + string strMessage = this.textBox1.Text.Trim(); + + History.Add(strMessage); + intHistory = History.Count; + + + if (strMessage == "") + return; + + if (strMessage[0] == '/') + { + if (strMessage.StartsWith("/me")) + { + // do nothing + } + else + { + string strChannel = ""; + for (int intI = 1; intI < strMessage.Length; intI++) + { + if (strMessage[intI] >= '0' && strMessage[intI] <= '9') + { + strChannel += strMessage[intI]; + if (intI < 10) + continue; + } + try + { + intChannel = Convert.ToInt32(strChannel); + strMessage = strMessage.Substring(intI).Trim(); + } + catch + { + } + break; + } + } + } + + SecondLife.key id = new SecondLife.key(Properties.Settings.Default.AvatarKey); + + Chat(intChannel, Properties.Settings.Default.AvatarName, id, strMessage, how); + + this.textBox1.Clear(); + + this.buttonSay.Enabled = false; + this.buttonShout.Enabled = false; + } + + private void buttonShout_Click(object sender, EventArgs e) + { + Speak(CommunicationType.Shout); + this.textBox1.Focus(); + } + + + private void ScrollChat(KeyEventArgs e) + { + e.SuppressKeyPress = true; + if (e.KeyCode == Keys.Up) + intHistory = Math.Max(0, intHistory - 1); + if (e.KeyCode == Keys.Down) + intHistory = Math.Min(History.Count, intHistory + 1); + this.textBox1.Clear(); + if (intHistory != History.Count) + this.textBox1.AppendText(History[intHistory]); + } + + private void textBox1_KeyDown(object sender, KeyEventArgs e) + { + this.buttonSay.Enabled = true; + this.buttonShout.Enabled = true; + + if (e.KeyCode == Keys.Return) + { + Speak(CommunicationType.Say); + e.SuppressKeyPress = true; + } + if (e.Control && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) + { + ScrollChat(e); + } + else if (e.KeyCode == Keys.Down || + e.KeyCode == Keys.Left || + e.KeyCode == Keys.Right || + e.KeyCode == Keys.Up + ) + { + if (OnControl != null) + OnControl(e.KeyCode, new EventArgs()); + e.SuppressKeyPress = true; + } + } + + private void Simulator_Load(object sender, EventArgs e) + { + this.textBox1.Focus(); + } + + public void Clear() + { + this.textBox1.Clear(); + this.textBox2.Clear(); + this.textBox1.Focus(); + } + + private void buttonSay_Click(object sender, EventArgs e) + { + Speak(CommunicationType.Say); + this.textBox1.Focus(); + } + + private void textBox2_KeyDown(object sender, KeyEventArgs e) + { + if (e.Control && e.KeyCode == Keys.A) + this.textBox2.SelectAll(); + } + + private void copyToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.Copy(); + } + + private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.SelectAll(); + } + + private void clearToolStripMenuItem_Click(object sender, EventArgs e) + { + this.textBox2.Focus(); + this.textBox2.Clear(); + } + + } +} diff --git a/SimulatorConsole.resx b/SimulatorConsole.resx new file mode 100644 index 0000000..ee8866e --- /dev/null +++ b/SimulatorConsole.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Solution/GuidProperty.Designer.cs b/Solution/GuidProperty.Designer.cs new file mode 100644 index 0000000..a3d0757 --- /dev/null +++ b/Solution/GuidProperty.Designer.cs @@ -0,0 +1,115 @@ +namespace LSLEditor.Solution +{ + partial class GuidProperty + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(352, 64); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "properties"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(56, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(288, 20); + this.textBox1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(32, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Guid:"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(184, 80); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Ok"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(272, 80); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // GuidProperty + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(371, 113); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "GuidProperty"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "GuidProperty"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} \ No newline at end of file diff --git a/Solution/GuidProperty.cs b/Solution/GuidProperty.cs new file mode 100644 index 0000000..f5e44da --- /dev/null +++ b/Solution/GuidProperty.cs @@ -0,0 +1,89 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Solution +{ + public partial class GuidProperty : Form + { + private Solution.SolutionExplorer.RealTag realTag; + public Guid guid; + public GuidProperty(Solution.SolutionExplorer.RealTag realTag) + { + InitializeComponent(); + + this.DialogResult = DialogResult.Cancel; + + this.Text += ": " + realTag.Name; + + this.realTag = realTag; + this.textBox1.Text = realTag.Guid.ToString(); + } + + private void button2_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + try + { + this.guid = new Guid(this.textBox1.Text); + this.DialogResult = DialogResult.OK; + } + catch + { + } + this.Close(); + } + + + } +} \ No newline at end of file diff --git a/Solution/GuidProperty.resx b/Solution/GuidProperty.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Solution/GuidProperty.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Solution/NewProject.Designer.cs b/Solution/NewProject.Designer.cs new file mode 100644 index 0000000..55ce544 --- /dev/null +++ b/Solution/NewProject.Designer.cs @@ -0,0 +1,205 @@ +namespace LSLEditor +{ + partial class NewProject + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(38, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Name:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 48); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(51, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Location:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(8, 72); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(79, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Solution Name:"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(96, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(296, 20); + this.textBox1.TabIndex = 3; + this.textBox1.Text = "Project"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(96, 48); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(296, 20); + this.textBox2.TabIndex = 4; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(96, 72); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(136, 20); + this.textBox3.TabIndex = 5; + this.textBox3.Text = "Default"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(400, 48); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 6; + this.button1.Text = "browse..."; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Location = new System.Drawing.Point(240, 72); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(154, 17); + this.checkBox1.TabIndex = 7; + this.checkBox1.Text = "Create directory for solution"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.textBox3); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(488, 104); + this.groupBox1.TabIndex = 8; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "new project properties"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(408, 120); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 9; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(320, 120); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 10; + this.button3.Text = "Ok"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(16, 120); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(168, 17); + this.checkBox2.TabIndex = 11; + this.checkBox2.Text = "Checkout from SVN repository"; + this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); + // + // NewProject + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(504, 152); + this.Controls.Add(this.checkBox2); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "NewProject"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "NewProject"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private System.Windows.Forms.CheckBox checkBox2; + } +} \ No newline at end of file diff --git a/Solution/NewProject.cs b/Solution/NewProject.cs new file mode 100644 index 0000000..3354a69 --- /dev/null +++ b/Solution/NewProject.cs @@ -0,0 +1,158 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Reflection; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class NewProject : Form + { + private LSLEditorForm parent; + + public NewProject(LSLEditorForm parent) + { + InitializeComponent(); + + this.checkBox2.Visible = Svn.IsInstalled; + + this.parent = parent; + + this.textBox2.Text = Properties.Settings.Default.ProjectLocation; + } + + private void button2_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + + + private void button3_Click(object sender, EventArgs e) + { + if (this.checkBox2.Checked) + Checkout(); + else + CreateNew(); + } + + private void Checkout() + { + Svn svn = new Svn(); + string strSvnRepository = this.textBox1.Text.Trim(); + string strLocalDirectory = this.textBox2.Text.Trim(); + string strSolutionName = this.textBox3.Text.Trim(); + + strLocalDirectory = Path.Combine(strLocalDirectory, strSolutionName); + + strSvnRepository = strSvnRepository.TrimEnd(new char[] {'/'}); + if (!strSvnRepository.EndsWith(strSolutionName)) + strSvnRepository += "/"+strSolutionName; + strSvnRepository += "/"; + + string strSolFile = strSvnRepository + strSolutionName + ".sol"; + if (!svn.Execute("list \"" + strSolFile +"\"",false,true)) + return; + + if (!svn.Execute("checkout \"" + strSvnRepository + "\" \"" + strLocalDirectory + "\"",false,true)) + return; + + // Into solution directory + string strLocalSolFile = Path.Combine(strLocalDirectory, strSolutionName + ".sol"); + if(!Directory.Exists(strLocalDirectory)) + { + MessageBox.Show("Can't find directory " + strLocalDirectory, "Checkout Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (!File.Exists(strLocalSolFile)) + { + MessageBox.Show("Can't find solution file " + strLocalSolFile, "Checkout Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (parent.SolutionExplorer.OpenSolution(strLocalSolFile)) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + } + + private void CreateNew() + { + if (this.parent.SolutionExplorer.CreateNew(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, this.checkBox1.Checked)) + { + this.parent.ShowSolutionExplorer(true); + this.parent.UpdateRecentProjectList(this.parent.SolutionExplorer.GetCurrentSolutionPath(),true); + this.DialogResult = DialogResult.OK; + this.Close(); + } + } + + private void button1_Click(object sender, EventArgs e) + { + if (this.folderBrowserDialog1.ShowDialog(this) == DialogResult.OK) + { + this.textBox2.Text = this.folderBrowserDialog1.SelectedPath; + } + } + + private void checkBox2_CheckedChanged(object sender, EventArgs e) + { + if (this.checkBox2.Checked) + { + this.label1.Text = "SVN Path"; + this.textBox1.Text = ""; + } + else + { + this.label1.Text = "Name"; + this.textBox1.Text = "Project"; + } + } + } +} \ No newline at end of file diff --git a/Solution/NewProject.resx b/Solution/NewProject.resx new file mode 100644 index 0000000..c3fe8f1 --- /dev/null +++ b/Solution/NewProject.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Solution/SolutionExplorer.cs b/Solution/SolutionExplorer.cs new file mode 100644 index 0000000..487de79 --- /dev/null +++ b/Solution/SolutionExplorer.cs @@ -0,0 +1,2436 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; + +namespace LSLEditor.Solution +{ + public partial class SolutionExplorer : UserControl + { + public enum TypeSL : int + { + // Inventory containers + Inventory = 0, + Animations = 1, + Body_Parts = 2, + Calling_Cards = 3, + Clothes = 4, + Gestures = 5, + Landmarks = 6, + Lost_And_Found = 7, + Notecards = 8, + Objects = 9, + Photo_Album = 10, + Scripts = 11, + Sounds = 12, + Textures = 13, + Trash = 14, + Folder = 15, + + // Special containers + Solution = 16, + Project = 17, + Prim = 18, // not used, use Object instead + Unknown = 19, + + // Normal items!! + + // Animations + Animation = 20, + + Gesture = 21, + Landmark = 22, + Notecard = 23, + Object = 24, // This is a normal container item!!! + + // Photo Album + Snapshot = 25, + + Script = 26, + Sound = 27, + Texture = 28, + + // Body parts + Eyes = 29, + Hair = 30, + Shape = 31, + Skin = 32, + + // Clothes + Gloves = 33, + Jacket = 34, + Pants = 35, + Shirt = 36, + Shoes = 37, + Skirt = 38, + Socks = 39, + Underpants = 40, + Undershirt = 41 + } + private TypeSL[] BodyPartsTypes = + { + TypeSL.Eyes, + TypeSL.Hair, + TypeSL.Shape, + TypeSL.Skin + }; + private TypeSL[] ClothesTypes = + { + TypeSL.Gloves, + TypeSL.Jacket, + TypeSL.Pants, + TypeSL.Shirt, + TypeSL.Shoes, + TypeSL.Skirt, + TypeSL.Socks, + TypeSL.Underpants, + TypeSL.Undershirt + }; + private TypeSL[] FilesTypes = + { + TypeSL.Animation, + TypeSL.Gesture, + TypeSL.Landmark , + TypeSL.Notecard, + TypeSL.Snapshot, + TypeSL.Object, + TypeSL.Script, + TypeSL.Sound, + TypeSL.Texture + }; + + public struct RealTag + { + public TypeSL ItemType; + public string Name; + public string Description; + public Guid Guid; + public string Path; + + public RealTag(TypeSL ItemType, string Name, Guid Guid) + { + this.ItemType = ItemType; + this.Name = Name; + this.Description = string.Empty; + this.Guid = Guid; + this.Path = null; + } + + public RealTag(TypeSL ItemType,string Name, Guid Guid, string Path) + { + this.ItemType = ItemType; + this.Name = Name; + this.Description = string.Empty; + this.Guid = Guid; + this.Path = Path; + } + } + + public string DirectorySolution; + public string NameSolution; + public string Repository; + + private TreeNode ActiveSolution; + private TreeNode ActiveProject; + private TreeNode ActiveObject; + + private TreeNode CutObject; + private TreeNode CopyObject; + + public LSLEditorForm parent; + + private SolidBrush brushHighLightBackground; + private SolidBrush brushNormalForeColor; + private SolidBrush brushCutForeColor; + private SolidBrush brushBackColor; + private Pen penWhite; + private Pen penBackColor; + + private ImageList imageList1; + + private OpenFileDialog openFileDialog1; + + private Timer timer; + + private bool m_dirty; + + private ListViewItem m_HoveredItem; + private ToolTip toolTip1; + + + public bool IsDirty + { + get + { + return m_dirty; + } + } + + public SolutionExplorer() + { + InitializeComponent(); + + this.Repository = null; + + this.toolTip1 = new ToolTip(); + + this.m_dirty = false; + + this.components = new System.ComponentModel.Container(); + + imageList1 = new ImageList(); + imageList1.TransparentColor = Color.Transparent; + for (int intI = 0; intI <= 41; intI++) + { + TypeSL typeSL = (TypeSL)intI; + imageList1.Images.Add(intI.ToString(), new Bitmap(typeof(LSLEditorForm), "ImagesSolutionExplorer." + typeSL.ToString().Replace("_", " ") + ".gif")); + } + + // take care of this as an property + //this.parent = parent; + + this.brushHighLightBackground = new SolidBrush(Color.FromArgb(0xff, 0x6d, 0x6e, 0x6f)); + this.brushNormalForeColor = new SolidBrush(Color.FromArgb(0xff, 0xff, 0xff, 0xff)); + this.brushCutForeColor = new SolidBrush(Color.FromArgb(0xff, Color.DarkGray)); + this.brushBackColor = new SolidBrush(Color.FromArgb(0xff, 0x3e, 0x3e, 0x3e)); + this.penWhite = new Pen(Color.White); + this.penBackColor = new Pen(this.brushBackColor); + + + this.treeView1.ImageList = imageList1; + this.treeView1.ShowRootLines = false; // just 1 root + this.treeView1.ForeColor = Color.White; + this.treeView1.BackColor = Color.FromArgb(0xff, 0x3e, 0x3e, 0x3e); + this.treeView1.LabelEdit = false; + this.treeView1.BeforeCollapse += new TreeViewCancelEventHandler(treeView1_BeforeCollapse); + this.treeView1.DrawMode = TreeViewDrawMode.OwnerDrawText; + this.treeView1.DrawNode += new DrawTreeNodeEventHandler(treeView1_DrawNode); + this.treeView1.AfterLabelEdit += new NodeLabelEditEventHandler(treeView1_AfterLabelEdit); + this.treeView1.MouseDown += new MouseEventHandler(treeView1_MouseDown); + + this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick); + + this.treeView1.MouseUp += new MouseEventHandler(treeView1_MouseUp); + + this.treeView1.TreeViewNodeSorter = new NodeSorter(); + + this.listView1.Dock = DockStyle.Fill; + this.listView1.View = View.Details; + this.listView1.HeaderStyle = ColumnHeaderStyle.None; + //this.listView1.Scrollable = false; + + this.listView1.GridLines = true; + this.listView1.Columns.Add("Name",60); + this.listView1.Columns.Add("Value",250); + + // for disposing + this.timer = new Timer(this.components); + this.timer.Interval = 250; + this.timer.Tick += new EventHandler(timer_Tick); + + this.openFileDialog1 = new OpenFileDialog(); + } + + public string GetCurrentSolutionPath() + { + if (ActiveSolution == null) + return null; + if (DirectorySolution == null) + return null; + if (NameSolution == null) + return null; + + return Path.Combine(DirectorySolution, NameSolution + ".sol"); + } + + + public string GetProjectName(Guid guid) + { + TreeNode tn = FindGuid(this.treeView1.TopNode, guid); + if (tn != null) + { + while (tn != this.treeView1.TopNode) + { + tn = tn.Parent; + if (GetTypeSL(tn) == TypeSL.Project) + return tn.Text; + } + } + return ""; + } + + private void timer_Tick(object sender, EventArgs e) + { + timer.Stop(); + RenameAction(this.treeView1.SelectedNode); + } + + private int NumberOfProjects() + { + if (ActiveSolution == null) + return 0; + int intProjects = 0; + foreach (TreeNode tn in ActiveSolution.Nodes) + { + if (GetTypeSL(tn) == TypeSL.Project) + intProjects++; + } + return intProjects; + } + + private bool HasInventory() + { + foreach (TreeNode tn in ActiveSolution.Nodes) + { + if (GetTypeSL(tn) == TypeSL.Inventory) + return true; + } + return false; + } + + private void EmptyInventory(TreeNode parentNode) + { + this.m_dirty = true; + TreeNode treeNode = new TreeNode("Inventory", (int)TypeSL.Inventory, (int)TypeSL.Inventory); + string strInventoryPath = Path.Combine(DirectorySolution, "Inventory"); + treeNode.Tag = new RealTag(TypeSL.Inventory, "Inventory", Guid.NewGuid(), strInventoryPath); + parentNode.Nodes.Insert(0,treeNode); + for (int intI = 1; intI < 15; intI++) + { + TypeSL typeSL = (TypeSL)intI; + string strName = typeSL.ToString().Replace('_', ' '); + TreeNode tn = new TreeNode(strName, intI, intI); + tn.Tag = new RealTag(typeSL, strName, Guid.NewGuid()); + treeNode.Nodes.Add(tn); + } + } + + private EditForm GetEditForm(Guid guid) + { + LSLEditorForm lslEditorForm = this.parent; + foreach (Form form in lslEditorForm.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + if (editForm.guid == guid) + return editForm; + } + return null; + } + + public void CloseSolution() + { + if (this.ActiveSolution == null) + return; + + this.parent.StopSimulator(); + + if (this.parent.CloseAllOpenWindows()) + { + SaveSolutionFile(); + + this.ActiveProject = null; + this.ActiveSolution = null; + this.ActiveObject = null; + + this.m_dirty = false; + + this.treeView1.Nodes.Clear(); + + this.listView1.Items.Clear(); + + if(!Properties.Settings.Default.ShowSolutionExplorer) + this.parent.ShowSolutionExplorer(false); + this.parent.SolutionItemsFileMenu(false); + } + } + + public bool CreateNew(string strNameProject,string strDirectory,string strNameSolution,bool blnCreateSolutionDirectory) + { + DirectorySolution = Path.Combine(strDirectory,strNameSolution); + + string strSolutionFileName = Path.Combine(DirectorySolution, strNameSolution + ".sol"); + + if(File.Exists(strSolutionFileName)) + { + MessageBox.Show("Solution file already exists", "Create new Solution", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + AddSolution(strNameSolution); + + string strProjectPath; + if (blnCreateSolutionDirectory) + strProjectPath = Path.Combine(DirectorySolution, strNameProject); + else + strProjectPath = DirectorySolution; + + // made active, if only project + AddItem(TypeSL.Project,strNameProject, Guid.NewGuid() , strProjectPath); + + return true; + } + + public void AddExistingProject() + { + this.openFileDialog1.Multiselect = false; + this.openFileDialog1.FileName = ""; + this.openFileDialog1.Filter = "LSLEditor Project file (*.prj)|*.prj|All Files (*.*)|*.*"; + if (this.openFileDialog1.ShowDialog(this) == DialogResult.OK) + { + if (File.Exists(this.openFileDialog1.FileName)) + LoadItem(this.openFileDialog1.FileName,false); + } + } + + #region UserInterface stuff + + // disable root solution collapse (there is no + sign) + void treeView1_BeforeCollapse(object sender, TreeViewCancelEventArgs e) + { + e.Cancel = (e.Node == this.ActiveSolution); + } + + void treeView1_DrawNode(object sender, DrawTreeNodeEventArgs e) + { + if (e.Node.IsEditing) + return; + + if (e.Bounds.Height == 0) + return; + + Font font; + if (e.Node == ActiveProject || e.Node == ActiveObject) + font = new Font(this.treeView1.Font, FontStyle.Bold); + else + font = new Font(this.treeView1.Font, FontStyle.Regular); + + // Draw background + SizeF sizeF = e.Graphics.MeasureString(e.Node.Text, font); + Rectangle rect = new Rectangle(e.Bounds.Location, new Size((int)sizeF.Width + 5, e.Bounds.Height - 1)); + + if ((e.State & TreeNodeStates.Selected) != 0) + { + e.Graphics.FillRectangle(brushHighLightBackground, rect); + e.Graphics.DrawRectangle(penWhite, rect); + } + else + { + e.Graphics.FillRectangle(brushBackColor, rect); + e.Graphics.DrawRectangle(penBackColor, rect); + } + + // Draw text + Point point = new Point(e.Bounds.Location.X, e.Bounds.Location.Y + 2); + if (e.Node.ForeColor != Color.Empty) + e.Graphics.DrawString(e.Node.Text, font, brushCutForeColor, point); + else + e.Graphics.DrawString(e.Node.Text, font, brushNormalForeColor, point); + + // Clean up + font.Dispose(); + } + + void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) + { + this.treeView1.LabelEdit = false; + + if (e.Label == null || e.Label.Trim() == "") + { + e.CancelEdit = true; + return; + } + + // check for illegal chars!! + string strLabel = e.Label; + + foreach (char chrF in e.Label.ToCharArray()) + { + foreach (char chrInvalid in Path.GetInvalidFileNameChars()) + { + if (chrF == chrInvalid) + { + MessageBox.Show("Char '" + chrInvalid + "' is not allowed", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + } + } + + string strBackup = e.Node.Text; + string strSource = GetFullPath(e.Node); + e.Node.Text = e.Label; + string strDestination = GetFullPath(e.Node); + + if (e.Node == ActiveSolution) + { + NameSolution = e.Label; + UpdateVisualSolutionName(); + string strOldSolutionFile = Path.GetFullPath(Path.Combine(strSource, strBackup + ".sol")); + string strNewSolutionFile = Path.GetFullPath(Path.Combine(strDestination, NameSolution + ".sol")); + + if (File.Exists(strNewSolutionFile) && string.Compare(strOldSolutionFile, strNewSolutionFile, true) != 0) + { + if (MessageBox.Show("Destination solution exists! overwrite?", "Oops...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) + { + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + try + { + File.Delete(strNewSolutionFile); + } + catch (Exception exception) + { + MessageBox.Show("Error: " + exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + } + + if(File.Exists(strOldSolutionFile)) + File.Move(strOldSolutionFile, strNewSolutionFile); + ShowProperties(ActiveSolution); + + e.CancelEdit = true; + return; + } + + // source and destination are the same, cancel it all (file or directory) + if (string.Compare(strSource, strDestination, true) == 0) + { + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + + + // rename file + if (File.Exists(strSource)) + { + if (File.Exists(strDestination)) + { + if (MessageBox.Show("Destination file exists! overwrite?", "Oops...", MessageBoxButtons.YesNo , MessageBoxIcon.Warning) != DialogResult.Yes) + { + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + try + { + File.Delete(strDestination); + } + catch (Exception exception) + { + MessageBox.Show("Error: " + exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + } + try + { + File.Move(strSource, strDestination); + } + catch (Exception exception) + { + MessageBox.Show("Error: " + exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + + RealTag rt = (RealTag)e.Node.Tag; + rt.Name = e.Node.Text; + e.Node.Tag = rt; // save name + EditForm editForm = GetEditForm(rt.Guid); + if (editForm != null) + { + editForm.FullPathName = strDestination; // GetFullPath(e.Node); + editForm.SaveCurrentFile(); + } + return; // rename file complete + } + + // rename directory + if (Directory.Exists(strSource)) + { + if (Directory.Exists(strDestination)) + { + if (MessageBox.Show("Destination directory exists! overwrite?", "Oops...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) + { + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + try + { + Directory.Delete(strDestination, true); + } + catch (Exception exception) + { + MessageBox.Show("Error: " + exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + } + + try + { + Directory.Move(strSource, strDestination); + } + catch (Exception exception) + { + MessageBox.Show("Error: " + exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.Node.Text = strBackup; + e.CancelEdit = true; + return; + } + + RealTag rt = (RealTag)e.Node.Tag; + rt.Name = e.Node.Text; + e.Node.Tag = rt; // save name + + // update all path of opened windows + foreach (Form form in this.parent.Children) + { + EditForm editForm = form as EditForm; + if (editForm == null || editForm.IsDisposed) + continue; + TreeNode tn = FindGuid(e.Node, editForm.guid); + if (tn != null) + { + editForm.FullPathName = GetFullPath(tn); + editForm.SaveCurrentFile(); + } + } + return; + } + + MessageBox.Show("Can not rename, source does not exist", "Oops..."); + e.Node.Text = strBackup; + e.CancelEdit = true; + } + #endregion + + private bool IsItem(TreeNode treeNode) + { + TypeSL typeSL = GetTypeSL(treeNode); + return ((int)typeSL >= 20); + } + + private bool IsItemAndNotObject(TreeNode treeNode) + { + TypeSL typeSL = GetTypeSL(treeNode); + int intTypeSL = (int)typeSL; + return (intTypeSL >= 20 && typeSL != TypeSL.Object); + } + + + private bool IsInventoryContainer(TreeNode treeNode) + { + TypeSL TypeSL = GetTypeSL(treeNode); + return ((int)TypeSL <= 15); + } + + private TypeSL GetTypeSL(TreeNode treeNode) + { + if (treeNode == null) + return TypeSL.Unknown; + if (treeNode.Tag == null) + return TypeSL.Unknown; + RealTag realTag = (RealTag)treeNode.Tag; + return realTag.ItemType; + } + + private string GetPath(TreeNode treeNode) + { + if (treeNode == null) + return null; + if (treeNode.Tag == null) + return null; + RealTag realTag = (RealTag)treeNode.Tag; + string strPath = realTag.Path; + if (strPath == null) + return null; + + if(strPath.EndsWith(treeNode.Text)) + return strPath; + + // Project has been renamed + strPath = Path.Combine(Path.GetDirectoryName(strPath), treeNode.Text); + realTag.Path = strPath; + treeNode.Tag = realTag; + return strPath; + } + + private string GetXml(int intDepth, TreeNode treeNode) + { + StringBuilder sb = new StringBuilder(); + RealTag realTag = (RealTag)treeNode.Tag; + string strTagName = realTag.ItemType.ToString(); + string strValue = treeNode.Text; + if (treeNode == ActiveSolution) + strValue = NameSolution; + for (int intI = 0; intI < intDepth; intI++) + sb.Append('\t'); + string strActive = ""; + string strDescription = ""; + if (treeNode == ActiveObject) + strActive = @" active=""true"""; + if (realTag.Description != string.Empty) + strDescription = @" description=""" + realTag.Description + @""""; + sb.AppendFormat("<{0} name=\"{1}\" guid=\"{2}\"{3}{4}>\r\n", strTagName, strValue, realTag.Guid, strActive, strDescription); + foreach (TreeNode childNode in treeNode.Nodes) + sb.Append(GetXml(intDepth + 1, childNode)); + for (int intI = 0; intI < intDepth; intI++) + sb.Append('\t'); + sb.AppendFormat("\r\n", strTagName); + return sb.ToString(); + } + + private string GetFullPath(TreeNode treeNode) + { + if (treeNode == ActiveSolution) + return DirectorySolution; + + TreeNode parentNode = treeNode; + string strPath = ""; + while (GetPath(parentNode) == null) + { + strPath = Path.Combine(parentNode.Text, strPath); + parentNode = parentNode.Parent; + } + strPath = Path.Combine(GetPath(parentNode), strPath); + return Path.GetFullPath(strPath); + } + + private void RecursiveLoad(TreeNode treeNode, XmlNode xmlParentNode) + { + foreach (XmlNode xmlNode in xmlParentNode.SelectNodes("./*")) + { + TypeSL typeSL = (TypeSL)Enum.Parse(typeof(TypeSL), xmlNode.Name); + + if (typeSL == TypeSL.Prim) // Old!!! + typeSL = TypeSL.Object; + + string strName = xmlNode.Attributes["name"].Value; + Guid guid = new Guid(xmlNode.Attributes["guid"].Value); + + XmlAttribute attributePath = xmlNode.Attributes["path"]; + XmlAttribute attributeDescription = xmlNode.Attributes["description"]; + int intImageIndex = (int)typeSL; + TreeNode tn = new TreeNode(strName, intImageIndex, intImageIndex); + + RealTag realTag = new RealTag(typeSL, strName, guid); + + if (attributePath != null) + realTag.Path = attributePath.Value; + if (attributeDescription != null) + realTag.Description = attributeDescription.Value; + + tn.Tag = realTag; + + XmlAttribute attributeActive = xmlNode.Attributes["active"]; + if (attributeActive != null) + { + if (attributeActive.Value == "true") + ActiveObject = tn; + } + treeNode.Nodes.Add(tn); + RecursiveLoad(tn, xmlNode); + } + } + + + private void LoadItem(string strPath, bool blnActive) + { + XmlDocument xmlItemFile = new XmlDocument(); + try + { + xmlItemFile.Load(strPath); + } + catch + { + MessageBox.Show("Not a valid item file", "Oops..."); + return; + } + foreach (XmlNode xmlItem in xmlItemFile.SelectNodes("./*")) + { + TypeSL typeSL = (TypeSL)Enum.Parse(typeof(TypeSL), xmlItem.Name); + TreeNode currentItem = AddItem(typeSL, + xmlItem.Attributes["name"].Value, + new Guid(xmlItem.Attributes["guid"].Value), + Path.GetDirectoryName(strPath)); + if (currentItem == null) + continue; + if (blnActive) + ActiveProject = currentItem; + RecursiveLoad(currentItem, xmlItem); + } + } + + public bool OpenSolution(string strPath) + { + DirectorySolution = Path.GetDirectoryName(strPath); + NameSolution = Path.GetFileNameWithoutExtension(strPath); + + XmlDocument xml = new XmlDocument(); + try + { + xml.Load(strPath); + } + catch + { + MessageBox.Show("Not a valid Solution file", "Oops..."); + this.parent.UpdateRecentProjectList(strPath, false); + return false; + } + + this.treeView1.Nodes.Clear(); + + foreach (XmlNode xmlSolution in xml.SelectNodes("//Solution")) + { + if (xmlSolution.Attributes["repository"] != null) + this.Repository = xmlSolution.Attributes["repository"].Value; + + AddSolution(xmlSolution.Attributes["name"].Value); + foreach (XmlNode xmlItem in xmlSolution.SelectNodes("./*")) + { + string strItemPath = xmlItem.Attributes["path"].Value; + if (!Path.IsPathRooted(strItemPath)) + strItemPath = Path.Combine(DirectorySolution, strItemPath); + if (!File.Exists(strItemPath)) + continue; // TODO verbose error + bool blnActive = false; + if (xmlItem.Attributes["active"] != null) + blnActive = (xmlItem.Attributes["active"].Value == "true"); + LoadItem(strItemPath,blnActive); + } + } + this.parent.ShowSolutionExplorer(true); + this.parent.SolutionItemsFileMenu(true); + this.parent.UpdateRecentProjectList(strPath,true); + this.m_dirty = false; + + return true; + } + + public bool SaveSolutionFile() + { + if (ActiveSolution == null) + return false; + if (DirectorySolution == null) + return false; + if (NameSolution == null) + return false; + + if (!Directory.Exists(DirectorySolution)) + Directory.CreateDirectory(DirectorySolution); + + string strSolutionFileName = Path.Combine(DirectorySolution, NameSolution + ".sol"); + StreamWriter sw = new StreamWriter(strSolutionFileName); + string strRepositoryAttribute; + if (this.Repository == null) + strRepositoryAttribute = ""; + else + strRepositoryAttribute = string.Format(" repository=\"{0}\"",this.Repository); + sw.WriteLine("",NameSolution,strRepositoryAttribute); + foreach (TreeNode nodeItem in ActiveSolution.Nodes) + { + RealTag realTag = (RealTag)nodeItem.Tag; + string strItemPath = SaveItemFile(nodeItem); + if (strItemPath != null) + { + // Make path relative, if it is the same as solution directory + if (strItemPath.ToLower().IndexOf(DirectorySolution.ToLower()) == 0) + strItemPath = strItemPath.Substring(DirectorySolution.Length+1); + string strActive = ""; + if (ActiveProject == nodeItem) + strActive = @" active=""true"""; + sw.WriteLine("\t", nodeItem.Text, strItemPath, strActive); + } + } + sw.WriteLine(""); + sw.Close(); + this.m_dirty = false; + + return true; + } + + private string SaveItemFile(TreeNode nodeItem) + { + string strName = nodeItem.Text; + RealTag realTag = (RealTag)nodeItem.Tag; + string strPath = realTag.Path; + + if (!Directory.Exists(strPath)) + Directory.CreateDirectory(strPath); + + string strExtension = ".prj"; + if (realTag.Name == "Inventory") + strExtension = ".inv"; + string strFilePath = Path.Combine(strPath, strName + strExtension); + StreamWriter sw = new StreamWriter(strFilePath); + sw.Write(GetXml(0, nodeItem)); + sw.Close(); + return strFilePath; + } + + private void AddSolution(string strNameSolution) + { + this.NameSolution = strNameSolution; + ActiveSolution = new TreeNode("Solution '" + strNameSolution + "'", (int)TypeSL.Solution, (int)TypeSL.Solution); + ActiveSolution.Tag = new RealTag(TypeSL.Solution, strNameSolution, Guid.NewGuid()); + this.treeView1.Nodes.Insert(0,ActiveSolution); + ActiveSolution.Expand(); + this.parent.SolutionItemsFileMenu(true); + } + + private void UpdateVisualSolutionName() + { + int intProjects = NumberOfProjects(); + ActiveSolution.Text = "Solution '" + this.NameSolution + "' (" + intProjects + " project" + ((intProjects != 1) ? "s" : "") + ")"; + } + + private bool ItemExist(Guid guid) + { + foreach (TreeNode itemNode in ActiveSolution.Nodes) + { + RealTag realTag = (RealTag)itemNode.Tag; + if (realTag.Guid == guid) + return true; + } + return false; + } + + private TreeNode AddItem(TypeSL typeSL, string strName, Guid guid, string strPath) + { + if (ItemExist(guid)) + return null; + + if (!Directory.Exists(strPath)) + Directory.CreateDirectory(strPath); + + TreeNode treeNode = new TreeNode(strName, (int)typeSL, (int)typeSL); + treeNode.Tag = new RealTag(typeSL, strName, guid, strPath); + + if (ActiveProject == null && typeSL == TypeSL.Project) + ActiveProject = treeNode; + + ActiveSolution.Nodes.Add(treeNode); + ActiveSolution.Expand(); + UpdateVisualSolutionName(); + + this.m_dirty = true; + + return treeNode; + } + + private TreeNode AddNewContainer(TreeNode parent, TypeSL typeSL, string strNewName, Guid guid) + { + if (parent == null) + return null; + + string strDirectoryContainer = Path.Combine(GetFullPath(parent), strNewName); + if (!Directory.Exists(strDirectoryContainer)) + Directory.CreateDirectory(strDirectoryContainer); + + TreeNode treeNode = new TreeNode(strNewName, (int)typeSL, (int)typeSL); + treeNode.Tag = new RealTag(typeSL, strNewName, guid); + + if (ActiveObject == null && typeSL == TypeSL.Object) + ActiveObject = treeNode; + + parent.Nodes.Add(treeNode); + parent.Expand(); + + this.m_dirty = true; + + return treeNode; + } + + + private void AddNewFile(TreeNode parent, TypeSL typeFile) + { + if (parent == null) + return; + + string strName = typeFile+"{0}"; + string strExtension = ""; + switch (typeFile) + { + case TypeSL.Script: + strExtension = ".lsl"; + break; + case TypeSL.Notecard: + strExtension = ".txt"; + break; + case TypeSL.Texture: + strExtension = ".tga"; + break; + case TypeSL.Animation: + strExtension = ".ani"; + break; + case TypeSL.Gesture: + strExtension = ".ges"; + break; + case TypeSL.Landmark: + strExtension = ".lmrk"; + break; + case TypeSL.Snapshot: + strExtension = ".pic"; + break; + case TypeSL.Sound: + strExtension = ".snd"; + break; + default: + break; + } + string strNewName = GetNewFileName(parent, strName + strExtension); + + string strFilePath = Path.Combine(GetFullPath(parent), strNewName); + + if (!File.Exists(strFilePath)) + { + StreamWriter sw = new StreamWriter(strFilePath); + + switch (typeFile) + { + case TypeSL.Script: + sw.Write(AutoFormatter.ApplyFormatting(0,Helpers.GetTemplate.Source())); + break; + case TypeSL.Notecard: + sw.Write("notecard"); + break; + default: + // empty file + break; + } + sw.Close(); + } + + TreeNode newFile = new TreeNode(strNewName, (int)typeFile, (int)typeFile); + newFile.Tag = new RealTag(typeFile, strNewName, Guid.NewGuid()); + parent.Nodes.Add(newFile); + parent.Expand(); + + this.m_dirty = true; + } + + private void AddExistingFile(TreeNode parent, string strName, Guid guid) + { + if (parent == null) + return; + + string strFilePath = Path.Combine(GetFullPath(parent), strName); + + TypeSL typeFile = TypeSL.Unknown; + + switch (Path.GetExtension(strName)) + { + case ".lsl": + typeFile = TypeSL.Script; + break; + case ".txt": + typeFile = TypeSL.Notecard; + break; + case ".ogg": + case ".wav": + case ".mp3": + typeFile = TypeSL.Sound; + break; + case ".ani": + typeFile = TypeSL.Animation; + break; + case ".gif": + case ".jpg": + case ".jpeg": + case ".tiff": + case ".bmp": + case ".png": + typeFile = TypeSL.Snapshot; + break; + default: + break; + } + TreeNode newFile = new TreeNode(strName, (int)typeFile, (int)typeFile); + newFile.Tag = new RealTag(typeFile, strName, guid); + parent.Nodes.Add(newFile); + parent.Expand(); + + this.m_dirty = true; + } + + private void AddExistingFile(TreeNode tn) + { + if (GetTypeSL(tn) != TypeSL.Object) + return; + this.openFileDialog1.FileName = ""; + this.openFileDialog1.Filter = "All Files (*.*)|*.*"; + this.openFileDialog1.Multiselect = true; + if (this.openFileDialog1.ShowDialog(this) == DialogResult.OK) + { + foreach (string strSourcePath in this.openFileDialog1.FileNames) + { + string strName = Path.GetFileName(strSourcePath); + string strDestinationPath = Path.Combine(GetFullPath(tn), strName); + + bool blnAdd = true; + foreach (TreeNode child in tn.Nodes) + { + if (child.Text == strName) + { + blnAdd = false; + + if (strSourcePath.ToLower() == strDestinationPath.ToLower()) + break; + + if (MessageBox.Show("Overwrite existing file?", "File already exists", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) + { + child.Remove(); + blnAdd = true; + break; + } + } + } + if (!blnAdd) + continue; + if (strSourcePath.ToLower() != strDestinationPath.ToLower()) + { + try + { + File.Copy(strSourcePath, strDestinationPath, true); + } + catch (Exception exception) + { + MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + AddExistingFile(tn, strName, Guid.NewGuid()); + } + } + } + + public void AddNewObject() + { + if (ActiveProject == null) + return; + AddNewContainer(ActiveProject, TypeSL.Object, GetNewDirectoryName(ActiveProject, "Object{0}"), Guid.NewGuid()); + } + + #region ContextMenus + + private ToolStripMenuItem cmsItemsAdd(ContextMenuStrip cms, string strName, string strValue,string strKeys) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(strValue); + tsmi.ShortcutKeyDisplayString = strKeys; + tsmi.Name = strName; + cms.Items.Add(tsmi); + return tsmi; + } + + private ToolStripMenuItem cmsItemsAdd(ContextMenuStrip cms, string strName, string strValue) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(strValue); + tsmi.Name = strName; + cms.Items.Add(tsmi); + return tsmi; + } + + private ContextMenuStrip ContextMenuSolution() + { + ContextMenuStrip cms = new ContextMenuStrip(); + cms.MouseClick += new MouseEventHandler(cms_MouseClick); + cmsItemsAdd(cms, "CloseSolution", "Close Solution"); + cms.Items.Add(new ToolStripSeparator()); + + if (Properties.Settings.Default.VersionControlSVN) + { + if (this.Repository == null) + { + cmsItemsAdd(cms, "SvnImport", "Import Solution SVN"); + cms.Items.Add(new ToolStripSeparator()); + } + else // already workingcopy + { + cmsItemsAdd(cms, "SvnUpdate", "SVN update"); + cmsItemsAdd(cms, "SvnCommit", "SVN commit"); + cms.Items.Add(new ToolStripSeparator()); + } + } + + cmsItemsAdd(cms, "AddNewProject", "Add New Project"); + cmsItemsAdd(cms, "AddExistingProject", "Add Existing Project..."); + if (!HasInventory()) + { + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "AddInventory", "Add Empty Inventory"); + } + cms.Items.Add(new ToolStripSeparator()); + if (GetTypeSL(CutObject) == TypeSL.Project || GetTypeSL(CopyObject) == TypeSL.Project) + cmsItemsAdd(cms, "Paste", "Paste project" , "Ctrl+V"); + cmsItemsAdd(cms, "Rename", "Rename" , "F2"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Properties", "Properties"); + return cms; + } + + private ContextMenuStrip ContextMenuInventory(TypeSL typeSL) + { + ContextMenuStrip cms = new ContextMenuStrip(); + cms.MouseClick += new MouseEventHandler(cms_MouseClick); + + if (typeSL != TypeSL.Inventory) + { + ToolStripMenuItem tsmiClothes = cmsItemsAdd(cms, "Add", "Add Clothes"); + tsmiClothes.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + foreach (TypeSL file in ClothesTypes) + tsmiClothes.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + + ToolStripMenuItem tsmiBodyParts = cmsItemsAdd(cms, "Add", "Add Body Parts"); + tsmiBodyParts.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + foreach (TypeSL file in BodyPartsTypes) + tsmiBodyParts.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + + ToolStripMenuItem tsmiFiles = cmsItemsAdd(cms, "Add", "Add Items"); + tsmiFiles.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + foreach (TypeSL file in FilesTypes) + tsmiFiles.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + cms.Items.Add(new ToolStripSeparator()); + } + cmsItemsAdd(cms, "AddNewFolder", "Add New Folder"); + + if (typeSL == TypeSL.Folder) + { + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Cut", "Cut" , "Ctrl+X"); + cmsItemsAdd(cms, "Copy", "Copy","Ctrl+C"); + cmsItemsAdd(cms, "Delete", "Delete", "Del"); + cmsItemsAdd(cms, "Rename", "Rename", "F2"); + } + if (CutObject != null || CopyObject != null) + { + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Paste", "Paste", "Ctrl+V"); + } + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Properties", "Properties"); + + return cms; + } + + private ContextMenuStrip ContextMenuProject() + { + ContextMenuStrip cms = new ContextMenuStrip(); + cms.MouseClick += new MouseEventHandler(cms_MouseClick); + cmsItemsAdd(cms, "AddNewObject", "Add New Object"); + cmsItemsAdd(cms, "AddExistingObject", "Add Existing Object..."); + cms.Items.Add(new ToolStripSeparator()); + if (NumberOfProjects() > 1 || ActiveProject == null) + cmsItemsAdd(cms, "SetAsActiveProject", "Set as Active Project"); + cmsItemsAdd(cms, "DebugStart","Debug Start"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Cut","Cut","Ctrl+X"); + cmsItemsAdd(cms, "Copy", "Copy", "Ctrl+C"); + cmsItemsAdd(cms, "Remove","Remove"); + if (GetTypeSL(CutObject) == TypeSL.Object || GetTypeSL(CopyObject) == TypeSL.Object) + cmsItemsAdd(cms, "Paste", "Paste Object","Ctrl+V"); + cmsItemsAdd(cms, "Rename","Rename","F2"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Properties","Properties"); + return cms; + } + + public void CreateNewFileDrowDownMenu(ToolStripMenuItem tsmi) + { + tsmi.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + foreach (TypeSL file in FilesTypes) + tsmi.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + } + + public void CreateNewFileDrowDownMenu(ContextMenuStrip cms) + { + ToolStripMenuItem tsmi = cmsItemsAdd(cms, "Add", "Add New Item"); + tsmi.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + foreach (TypeSL file in FilesTypes) + tsmi.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + } + + private ContextMenuStrip ContextMenuBox() + { + ContextMenuStrip cms = new ContextMenuStrip(); + cms.MouseClick += new MouseEventHandler(cms_MouseClick); + + CreateNewFileDrowDownMenu(cms); + //ToolStripMenuItem tsmi = cmsItemsAdd(cms, "Add", "Add New File"); + //tsmi.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsmi_DropDownItemClicked); + //foreach (TypeSL file in FilesTypes) + // tsmi.DropDownItems.Add(file.ToString(), this.imageList1.Images[(int)file]); + + cmsItemsAdd(cms, "AddExistingFile", "Add Existing File(s)..."); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "SetAsActiveBox", "Set As Active Object"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "ExcludeFromProject", "Exclude From Project"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Cut", "Cut","Ctrl+X"); + cmsItemsAdd(cms, "Copy", "Copy", "Ctrl+C"); + cmsItemsAdd(cms, "Delete", "Delete", "Del"); + if (IsItem(CutObject) || IsItem(CopyObject)) + cmsItemsAdd(cms, "Paste", "Paste", "Ctrl+V"); + cmsItemsAdd(cms, "Rename", "Rename","F2"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Properties", "Properties"); + return cms; + } + + private ContextMenuStrip ContextMenuFile() + { + ContextMenuStrip cms = new ContextMenuStrip(); + cms.MouseClick += new MouseEventHandler(cms_MouseClick); + cmsItemsAdd(cms, "Open", "Open"); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Cut", "Cut" , "Ctrl+X"); + cmsItemsAdd(cms, "Copy", "Copy", "Ctrl+C"); + cmsItemsAdd(cms, "Delete", "Delete", "Del"); + cmsItemsAdd(cms, "Rename", "Rename", "F2"); + cms.Items.Add(new ToolStripSeparator()); + ToolStripMenuItem tsmi = cmsItemsAdd(cms, "ChangeFileType", "Change filetype"); + CreateNewFileDrowDownMenu(tsmi); + cms.Items.Add(new ToolStripSeparator()); + cmsItemsAdd(cms, "Properties", "Properties"); + return cms; + } + + #endregion + + void tsmi_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + // Add New File + TreeNode tn; + ToolStripDropDownItem tsddi = sender as ToolStripDropDownItem; + ContextMenuStrip cms = tsddi.Owner as ContextMenuStrip; + if (cms != null) + tn = cms.Tag as TreeNode; + else + tn = ActiveObject; + + if (tn != null) + { + string strName = tsddi.Name; + if (strName == "ChangeFileType") + { + RealTag realTag = (RealTag)tn.Tag; + TypeSL stypeSl = (TypeSL)Enum.Parse(typeof(TypeSL), e.ClickedItem.Text); + realTag.ItemType = stypeSl; + tn.Tag = realTag; + tn.ImageIndex = (int)stypeSl; + tn.SelectedImageIndex = (int)stypeSl; + this.treeView1.Invalidate(tn.Bounds); + return; + } + else + { + TypeSL typeSL = (TypeSL)Enum.Parse(typeof(TypeSL), e.ClickedItem.Text); + if (typeSL != TypeSL.Object) + AddNewFile(tn, typeSL); + else + AddNewContainer(tn, TypeSL.Object, GetNewDirectoryName(tn, "Object{0}"), Guid.NewGuid()); + } + } + } + + void treeView1_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button != MouseButtons.Left) + return; + + TreeNode treeNode = this.treeView1.GetNodeAt(new Point(e.X, e.Y)); + if (treeNode == null) + return; + + if (e.X < treeNode.Bounds.X) // only when clicked on the label + return; + + if (timer.Tag != null) + { + if (timer.Tag == treeNode) + { + timer.Tag = null; + timer.Start(); + return; + } + } + timer.Tag = treeNode; + } + + void treeView1_MouseDown(object sender, MouseEventArgs e) + { + TreeNode treeNode = this.treeView1.GetNodeAt(new Point(e.X, e.Y)); + if (treeNode == null) + return; + + this.treeView1.SelectedNode = treeNode; + + RealTag realTag = (RealTag)treeNode.Tag; + + if (e.Button == MouseButtons.Right) + { + ContextMenuStrip cms = null; + switch (realTag.ItemType) + { + case TypeSL.Solution: + cms = ContextMenuSolution(); + break; + case TypeSL.Project: + cms = ContextMenuProject(); + break; + case TypeSL.Object: + cms = ContextMenuBox(); + break; + default: + if (IsInventoryContainer(treeNode)) + cms = ContextMenuInventory(realTag.ItemType); + else if (IsItem(treeNode)) + cms = ContextMenuFile(); + else + cms = new ContextMenuStrip(); + break; + } + cms.Tag = treeNode; + this.treeView1.ContextMenuStrip = cms; + } + } + + private string GetNewName(TreeNode treeNode, bool blnDirectory, string strFormat) + { + string strDirectory = GetFullPath(treeNode); + if (File.Exists(strDirectory)) + strDirectory = Path.GetDirectoryName(strDirectory); + + if (!Directory.Exists(strDirectory)) + Directory.CreateDirectory(strDirectory); + + RealTag realTag = (RealTag)treeNode.Tag; + if (blnDirectory) + { + string strName = strFormat.Replace("({0}) ", "").Replace("{0}", "").Replace("Copy of ",""); + if (!Directory.Exists(Path.Combine(strDirectory, strName))) + return strName; + strName = strFormat.Replace("({0}) ", "").Replace("{0}", ""); + if (!Directory.Exists(Path.Combine(strDirectory, strName))) + return strName; + + for (int intI = 1; intI < 255; intI++) + { + strName = string.Format(strFormat, intI); + if (!Directory.Exists(Path.Combine(strDirectory, strName))) + return strName; + } + } + else + { + string strName = strFormat.Replace("({0}) ", "").Replace("{0}", "").Replace("Copy of ",""); + if (!File.Exists(Path.Combine(strDirectory, strName))) + return strName; + strName = strFormat.Replace("({0}) ", "").Replace("{0}", ""); + if (!File.Exists(Path.Combine(strDirectory, strName))) + return strName; + + for (int intI = 2; intI < 255; intI++) + { + strName = string.Format(strFormat, intI); + if (!File.Exists(Path.Combine(strDirectory, strName))) + return strName; + } + } + MessageBox.Show("There are 255 items with the same name", "Oops..."); + return null; + } + + private string GetNewFileName(TreeNode treeNode, string strFormat) + { + return GetNewName(treeNode, false, strFormat); + } + + private string GetNewDirectoryName(TreeNode treeNode, string strFormat) + { + return GetNewName(treeNode, true, strFormat); + } + + private void DeleteAction(TreeNode tn) + { + if (MessageBox.Show("Delete " + tn.Text, "Delete?", MessageBoxButtons.YesNo) == DialogResult.Yes) + DeleteChildren(tn); + } + + private void DeleteChildren(TreeNode tn) + { + // remove backwards, foreach does not work + for(int intI=tn.Nodes.Count-1;intI>=0;intI--) + DeleteChildren(tn.Nodes[intI]); + + string strPath = GetFullPath(tn); + if (File.Exists(strPath)) + { + File.Delete(strPath); + RealTag rt = (RealTag)tn.Tag; + EditForm editForm = GetEditForm(rt.Guid); + if (editForm != null) + { + this.parent.ActivateMdiForm(editForm); + this.parent.CloseActiveWindow(); + } + } + else if (Directory.Exists(strPath)) + { + if (Directory.GetFiles(strPath).Length == 0) + Directory.Delete(strPath, true); + } + else + { + MessageBox.Show("Not found: " + tn.Text, "Oops..."); + } + tn.Remove(); + + this.m_dirty = true; + } + + private void CopyChildren(TreeNode Source,TreeNode Destination) + { + RealTag realTag = (RealTag)Source.Tag; + realTag.Guid = Guid.NewGuid(); // copy objects have new guid + if (realTag.Path!=null) + realTag.Path = Path.Combine(Path.GetDirectoryName(GetFullPath(Source)), Destination.Text); + + Destination.Tag = realTag; + Destination.ImageIndex = Source.ImageIndex; + Destination.SelectedImageIndex = Source.SelectedImageIndex; + + string strSourcePath = GetFullPath(Source); + string strDestionationPath = GetFullPath(Destination); + if (File.Exists(strSourcePath)) + File.Copy(strSourcePath, strDestionationPath); + else if (Directory.Exists(strSourcePath)) + Directory.CreateDirectory(strDestionationPath); + else + MessageBox.Show("Error: " + strSourcePath, "Oops..."); + + foreach (TreeNode child in Source.Nodes) + { + TreeNode clone = new TreeNode(child.Text); + Destination.Nodes.Add(clone); + CopyChildren(child, clone); + } + this.m_dirty = true; + } + + private void PasteAction(TreeNode tn) + { + // paste on same object, get parent!! + // paste on item, get parent!! + if (tn == CopyObject || tn==CutObject || IsItemAndNotObject(tn)) + tn = tn.Parent; + + // sanitycheck, search all parents, may not be CopyObject or CutObject + TreeNode parentNode = tn; + while (parentNode != null) + { + if (parentNode == CopyObject || parentNode == CutObject) + return; + parentNode = parentNode.Parent; + } + + switch(GetTypeSL(tn)) + { + case TypeSL.Solution: + if (GetTypeSL(CutObject) != TypeSL.Project && + GetTypeSL(CopyObject) != TypeSL.Project) + return; + break; + case TypeSL.Project: + if (GetTypeSL(CutObject) != TypeSL.Object && + GetTypeSL(CopyObject) != TypeSL.Object) + return; + break; + case TypeSL.Object: + if (!IsItem(CutObject) && !IsItem(CopyObject)) + return; + break; + default: + if(IsInventoryContainer(tn)) + { + if (!IsItem(CutObject) && !IsItem(CopyObject) && + GetTypeSL(CutObject) != TypeSL.Folder && + GetTypeSL(CopyObject) != TypeSL.Folder) + return; + } + else if (!IsItem(tn)) // is special container + { + // must be a file + if (!IsItem(CutObject) && !IsItem(CopyObject) && + GetTypeSL(CutObject) != TypeSL.Folder && + GetTypeSL(CopyObject) != TypeSL.Folder) + return; + } + break; + } + + if (CutObject != null) // Paste the Cut object + { + string strName = CutObject.Text; + + foreach(TreeNode treeNode in tn.Nodes) + { + if (treeNode.Text == strName) + { + MessageBox.Show("Destination already exists","Oops..."); + return; + } + } + + TreeNode Destination = new TreeNode(strName); + tn.Nodes.Add(Destination); + + CopyChildren(CutObject, Destination); + DeleteChildren(CutObject); + + CutObject.Remove(); + CutObject = null; + } + if (CopyObject != null) // Paste the Copy object + { + string strName; + if (IsItem(CopyObject) && GetTypeSL(CopyObject) != TypeSL.Object) + strName = GetNewFileName(tn, "Copy ({0}) of " + CopyObject.Text); + else + strName = GetNewDirectoryName(tn, "Copy ({0}) of " + CopyObject.Text); + + TreeNode Destination = new TreeNode(strName); + tn.Nodes.Add(Destination); + + CopyChildren(CopyObject, Destination); + + CopyObject = null; + + if (tn == ActiveSolution) + UpdateVisualSolutionName(); + } + } + + private void RemoveAction(TreeNode tn) + { + if (GetTypeSL(tn) == TypeSL.Project) + { + SaveItemFile(tn); // saving pending updates!! + if (ActiveProject == tn) + ActiveProject = null; + // Does not!!!! delete, only remove form project + tn.Remove(); + UpdateVisualSolutionName(); + this.m_dirty = true; + } + } + + private void RenameAction(TreeNode tn) + { + RealTag realTag = (RealTag)tn.Tag; + if (IsInventoryContainer(tn)) + { + if(realTag.ItemType != TypeSL.Folder) + return; + } + + if (realTag.ItemType == TypeSL.Solution) + tn.Text = this.NameSolution; + this.treeView1.LabelEdit = true; + tn.BeginEdit(); + } + + private void CutAction(TreeNode tn) + { + if (CutObject != null) + CutObject.ForeColor = Color.Empty; + CutObject = tn; + tn.ForeColor = Color.DarkGray; + } + + private void CopyAction(TreeNode tn) + { + if (CutObject != null) + { + CutObject.ForeColor = Color.Empty; + CutObject = null; + } + CopyObject = tn; + } + + public void AddNewProjectAction() + { + string strNewProjectName = GetNewDirectoryName(ActiveSolution, "Project{0}"); + string strProjectPath = Path.Combine(DirectorySolution, strNewProjectName); + AddItem(TypeSL.Project, strNewProjectName, Guid.NewGuid(), strProjectPath); + } + + private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) + { + timer.Stop(); + timer.Tag = null; + + Guid guid = ((RealTag)e.Node.Tag).Guid; + + // already opened + EditForm editForm = GetEditForm(guid); + if (editForm != null) + { + TabPage tabPage = editForm.Tag as TabPage; + if (tabPage == null) + { + editForm.Focus(); + } + else + { + TabControl tabControl = tabPage.Parent as TabControl; + if(tabControl != null) + tabControl.SelectedTab = tabPage; + } + return; + } + + // open a new one + if (GetTypeSL(e.Node) == TypeSL.Script) + this.parent.OpenFile(GetFullPath(e.Node), guid, true); + if (GetTypeSL(e.Node) == TypeSL.Notecard) + this.parent.OpenFile(GetFullPath(e.Node), guid, false); + } + private void PropertiesActions(TreeNode tn) + { + SolutionExplorer.RealTag realTag = (SolutionExplorer.RealTag)tn.Tag; + Guid oldGuid = realTag.Guid; + GuidProperty prop = new GuidProperty(realTag); + + if (prop.ShowDialog(this) == DialogResult.OK) + { + EditForm editForm = GetEditForm(oldGuid); + if (editForm != null) + editForm.guid = prop.guid; + realTag.Guid = prop.guid; + tn.Tag = realTag; + ShowProperties(tn); + } + } + private void ShowProperties(TreeNode tn) + { + RealTag realTag = (RealTag)tn.Tag; + + this.listView1.Items.Clear(); + + ListViewItem lvi = new ListViewItem("Name"); + lvi.SubItems.Add(tn.Text); + this.listView1.Items.Add(lvi); + + if (realTag.Description != string.Empty) + { + lvi = new ListViewItem("Description"); + lvi.SubItems.Add(realTag.Description); + this.listView1.Items.Add(lvi); + } + + lvi = new ListViewItem("Guid"); + lvi.SubItems.Add(realTag.Guid.ToString()); + this.listView1.Items.Add(lvi); + + lvi = new ListViewItem("Path"); + lvi.SubItems.Add(GetFullPath(tn)); + this.listView1.Items.Add(lvi); + + lvi = new ListViewItem("Modified"); + FileInfo fi = new FileInfo(GetFullPath(tn)); + lvi.SubItems.Add(fi.LastWriteTime.ToString("s")); + this.listView1.Items.Add(lvi); + + } + + private void SetAsActiveProject(TreeNode tn) + { + ActiveObject = null; + ActiveProject = tn; + foreach (TreeNode child in ActiveProject.Nodes) + { + if (GetTypeSL(child) == TypeSL.Object) + { + ActiveObject = child; + break; + } + } + this.treeView1.Invalidate(); + } + + private void SetAsActiveBox(TreeNode tn) + { + ActiveProject = null; + ActiveObject = tn; + if (GetTypeSL(ActiveObject.Parent) == TypeSL.Project) + ActiveProject = ActiveObject.Parent; + this.treeView1.Invalidate(); + } + + private void DebugStart() + { + MessageBox.Show("TODO: Debug start", "Todo"); + } + + private void AddExistingObject(TreeNode tn) + { + MessageBox.Show("TODO: Add Existing Object", "Todo"); + } + + private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) + { + ShowProperties(e.Node); + } + + private TreeNode FindGuid(TreeNode treeNode, Guid guid) + { + if (treeNode == null) + return null; + foreach (TreeNode tn in treeNode.Nodes) + { + RealTag rt = (RealTag)tn.Tag; + if (rt.Guid == guid) + return tn; + TreeNode found = FindGuid(tn, guid); + if (found != null) + return found; + } + return null; + } + + private delegate bool IHateThisToo(Guid guid, string name); + private delegate string IHateThis(Guid guid); + public string GetObjectName(Guid guid) + { + if (this.treeView1.InvokeRequired) + return this.treeView1.Invoke(new IHateThis(GetObjectName), new object[] { guid }).ToString(); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + RealTag realTag = (RealTag)parent.Tag; + if (realTag.ItemType != TypeSL.Object) + return string.Empty; + return realTag.Name; + } + + public bool SetObjectName(Guid guid, string name) + { + if (this.treeView1.InvokeRequired) + return (bool)this.treeView1.Invoke(new IHateThisToo(SetObjectName), new object[] { guid, name }); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return false; + TreeNode parent = treeNode.Parent; + RealTag realTag = (RealTag)parent.Tag; + if (realTag.ItemType != TypeSL.Object) + return false; + + string strBackup = parent.Text; + string strSource = GetFullPath(parent); + parent.Text = name; + string strDestination = GetFullPath(parent); + + try + { + Directory.Move(strSource, strDestination); + realTag.Name = name; + parent.Tag = realTag; + parent.Text = name; + return true; + } + catch + { + parent.Text = strBackup; + return false; + } + } + + public string GetObjectDescription(Guid guid) + { + if (this.treeView1.InvokeRequired) + return this.treeView1.Invoke(new IHateThis(GetObjectDescription), new object[] { guid }).ToString(); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + RealTag realTag = (RealTag)parent.Tag; + if (realTag.ItemType != TypeSL.Object) + return string.Empty; + return realTag.Description; + } + + public bool SetObjectDescription(Guid guid, string description) + { + if (this.treeView1.InvokeRequired) + return (bool)this.treeView1.Invoke(new IHateThisToo(SetObjectDescription), new object[] { guid, description }); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return false; + TreeNode parent = treeNode.Parent; + RealTag realTag = (RealTag)parent.Tag; + if (realTag.ItemType != TypeSL.Object) + return false; + realTag.Description = description; + parent.Tag = realTag; + return true; + } + + + public string GetScriptName(Guid guid) + { + if (this.treeView1.InvokeRequired) + return this.treeView1.Invoke(new IHateThis(GetScriptName), new object[] { guid }).ToString(); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + return treeNode.Text; + } + + public string GetKey(Guid guid) + { + if (this.treeView1.InvokeRequired) + return this.treeView1.Invoke(new IHateThis(GetKey), new object[] { guid }).ToString(); + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + RealTag rt = (RealTag)parent.Tag; + return rt.Guid.ToString(); + } + + private TypeSL GetTypeSLFromInteger(int type) + { + TypeSL typeSL = TypeSL.Unknown; + switch (type) + { + case -1: //INVENTORY_ALL -1 all inventory items + return TypeSL.Unknown; + case 20: //INVENTORY_ANIMATION 20 animations 0x14 + return TypeSL.Animation; + case 13: //INVENTORY_BODYPART 13 body parts 0x0D + return TypeSL.Hair | TypeSL.Skin | TypeSL.Eyes | TypeSL.Shape; + case 5: //INVENTORY_CLOTHING 5 clothing 0x05 + return TypeSL.Jacket | TypeSL.Gloves | TypeSL.Pants | TypeSL.Shirt | TypeSL.Shoes | TypeSL.Skirt | TypeSL.Socks | TypeSL.Underpants | TypeSL.Undershirt; + case 21: //INVENTORY_GESTURE 21 gestures 0x15 + return TypeSL.Gesture; + case 3: //INVENTORY_LANDMARK 3 landmarks 0x03 + return TypeSL.Landmark; + case 7: //INVENTORY_NOTECARD 7 notecards 0x07 + return TypeSL.Notecard; + case 6: //INVENTORY_OBJECT 6 objects 0x06 + return TypeSL.Object; + case 10: //INVENTORY_SCRIPT 10 scripts 0x0A + return TypeSL.Script; + case 1: //INVENTORY_SOUND 1 sounds 0x01 + return TypeSL.Sound; + case 0: //INVENTORY_TEXTURE 0 textures 0x00 + return TypeSL.Texture; + default: + break; + } + return typeSL; + } + + private delegate string DelegateGetInventoryName(Guid guid, int type, int number); + public string GetInventoryName(Guid guid, int type, int number) + { + if (this.treeView1.InvokeRequired) + { + return this.treeView1.Invoke(new DelegateGetInventoryName(GetInventoryName), new object[] { guid, type, number }).ToString(); + } + + TypeSL typeSL = GetTypeSLFromInteger(type); + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + int intI=0; + foreach (TreeNode tn in parent.Nodes) + { + if (typeSL == TypeSL.Unknown || (typeSL & GetTypeSL(tn) ) == GetTypeSL(tn)) + { + if (intI == number) + return tn.Text; + intI++; + } + } + return string.Empty; + } + + private delegate string DelegateGetInventoryKey(Guid guid, string name); + public string GetInventoryKey(Guid guid, string name) + { + if (this.treeView1.InvokeRequired) + { + return this.treeView1.Invoke(new DelegateGetInventoryKey(GetInventoryKey), new object[] { guid, name }).ToString(); + } + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + foreach (TreeNode tn in parent.Nodes) + { + if (tn.Text == name) + { + RealTag rt = (RealTag)tn.Tag; + return rt.Guid.ToString(); + } + } + return string.Empty; + } + + private delegate int DelegateGetInventoryType(Guid guid, string name); + public int GetInventoryType(Guid guid, string name) + { + if (this.treeView1.InvokeRequired) + { + return (int)this.treeView1.Invoke(new DelegateGetInventoryType(GetInventoryType), new object[] { guid, name }); + } + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return SecondLife.INVENTORY_NONE; + TreeNode parent = treeNode.Parent; + foreach (TreeNode tn in parent.Nodes) + { + if (tn.Text == name) + { + RealTag rt = (RealTag)tn.Tag; + switch (rt.ItemType) + { + case TypeSL.Texture: + return SecondLife.INVENTORY_TEXTURE; + case TypeSL.Sound: + return SecondLife.INVENTORY_SOUND; + case TypeSL.Landmark: + return SecondLife.INVENTORY_LANDMARK; + case TypeSL.Gloves: + case TypeSL.Jacket: + case TypeSL.Pants: + case TypeSL.Shirt: + case TypeSL.Shoes: + case TypeSL.Skirt: + case TypeSL.Socks: + case TypeSL.Underpants: + case TypeSL.Undershirt: + return SecondLife.INVENTORY_CLOTHING; + case TypeSL.Object: + return SecondLife.INVENTORY_OBJECT; + case TypeSL.Script: + return SecondLife.INVENTORY_SCRIPT; + case TypeSL.Animation: + return SecondLife.INVENTORY_ANIMATION; + case TypeSL.Eyes: + case TypeSL.Hair: + case TypeSL.Shape: + case TypeSL.Skin: + return SecondLife.INVENTORY_BODYPART; + case TypeSL.Gesture: + return SecondLife.INVENTORY_GESTURE; + case TypeSL.Notecard: + return SecondLife.INVENTORY_NOTECARD; + default: + return SecondLife.INVENTORY_NONE; + } + } + } + return SecondLife.INVENTORY_NONE; + } + + private delegate int DelegateGetInventoryNumber(Guid guid, int type); + public int GetInventoryNumber(Guid guid, int type) + { + if (this.treeView1.InvokeRequired) + { + return (int)this.treeView1.Invoke(new DelegateGetInventoryNumber(GetInventoryNumber), new object[] { guid, type }); + } + + TypeSL typeSL = GetTypeSLFromInteger(type); + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return -1; + TreeNode parent = treeNode.Parent; + int intI = 0; + foreach (TreeNode tn in parent.Nodes) + { + if (typeSL == TypeSL.Unknown || (typeSL & GetTypeSL(tn)) == GetTypeSL(tn)) + intI++; + } + return intI; + } + + private delegate string DelegateGetPath(Guid guid, string name); + public string GetPath(Guid guid, string name) + { + if (this.treeView1.InvokeRequired) + { + return this.treeView1.Invoke(new DelegateGetPath(GetPath), new object[] { guid, name }).ToString(); + } + + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return string.Empty; + TreeNode parent = treeNode.Parent; + foreach (TreeNode tn in parent.Nodes) + { + if (tn.Text == name || ((RealTag)tn.Tag).Guid.ToString() == name) + return GetFullPath(tn); + } + return string.Empty; + } + + private delegate Guid GetParentGuidDelegate(Guid guid); + public Guid GetParentGuid(Guid guid) + { + if (this.treeView1.InvokeRequired) + { + return (Guid)this.treeView1.Invoke(new GetParentGuidDelegate(GetParentGuid), new object[] { guid }); + } + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return Guid.Empty; + TreeNode parent = treeNode.Parent; + // Only return parent when it is an object + if (((RealTag)parent.Tag).ItemType != TypeSL.Object) + return guid; + else // Return object itself, has no parent object + return ((RealTag)parent.Tag).Guid; + } + + private delegate Guid GetGuidFromObjectNrDelegate(Guid ObjectGuid, int intLinkNum); + public Guid GetGuidFromObjectNr(Guid ObjectGuid, int intLinkNum) + { + if (this.treeView1.InvokeRequired) + { + return (Guid)this.treeView1.Invoke(new GetGuidFromObjectNrDelegate(GetGuidFromObjectNr), new object[] { ObjectGuid, intLinkNum }); + } + TreeNode treeNode = FindGuid(this.treeView1.TopNode, ObjectGuid); + if (treeNode == null) + return Guid.Empty; + int intNr = 0; + foreach (TreeNode tn in treeNode.Nodes) + { + RealTag realTag = (RealTag)tn.Tag; + if (realTag.ItemType == TypeSL.Object) + { + intNr++; + if (intNr == intLinkNum) + return realTag.Guid; + } + } + return Guid.Empty; // no objects found + } + + + private void GetScriptsFromNode(TreeNode treeNode, List list, bool recursive) + { + foreach (TreeNode tn in treeNode.Nodes) + { + RealTag realTag = (RealTag)tn.Tag; + if (realTag.ItemType == TypeSL.Script) + list.Add(realTag.Guid); + else + if (realTag.ItemType == TypeSL.Object && recursive) + GetScriptsFromNode(tn, list, recursive); + } + } + + private delegate List GetScriptsDelegate(Guid guid, bool recursive); + public List GetScripts(Guid guid, bool recursive) + { + if (this.treeView1.InvokeRequired) + return this.treeView1.Invoke(new GetScriptsDelegate(GetScripts), new object[] { guid, recursive }) as List; + + List list = new List(); + TreeNode treeNode = FindGuid(this.treeView1.TopNode, guid); + if (treeNode == null) + return list; // empty + GetScriptsFromNode(treeNode, list, recursive); + return list; + } + + private void listView1_MouseMove(object sender, MouseEventArgs e) + { + ListViewItem lvi = this.listView1.GetItemAt(e.X,e.Y); + if (lvi == null) + this.toolTip1.SetToolTip(this.listView1, ""); + else if (lvi != m_HoveredItem) + { + m_HoveredItem = lvi; + this.toolTip1.SetToolTip(this.listView1, lvi.SubItems[1].Text); + } + } + + private void treeView1_KeyDown(object sender, KeyEventArgs e) + { + if (this.treeView1.SelectedNode == null) + return; + if (e.KeyCode == Keys.ControlKey) + return; + switch (e.KeyCode) + { + case Keys.F2: + RenameAction(this.treeView1.SelectedNode); + e.Handled = true; + break; + case Keys.Delete: + DeleteAction(this.treeView1.SelectedNode); + e.Handled = true; + break; + case Keys.C: + if (e.Control) + { + CopyAction(this.treeView1.SelectedNode); + e.SuppressKeyPress = true; + e.Handled = true; + } + break; + case Keys.V: + if (e.Control) + { + PasteAction(this.treeView1.SelectedNode); + e.SuppressKeyPress = true; + e.Handled = true; + } + break; + case Keys.X: + if (e.Control) + { + CutAction(this.treeView1.SelectedNode); + e.SuppressKeyPress = true; + e.Handled = true; + } + break; + default: + break; + } + } + + private void SvnImport() + { + SvnAguments svnArguments = new SvnAguments(); + svnArguments.Text = "SVN import"; + svnArguments.Comment = "Initial import"; + if (svnArguments.ShowDialog(this) == DialogResult.OK) + { + string strRepository = svnArguments.Repository; + string strMessage = svnArguments.Comment; + + strMessage = strMessage.Replace('"', '\''); + + string strNameOfDirectory = Path.GetFileName(this.DirectorySolution); + + if (!strRepository.EndsWith(strNameOfDirectory)) + { + if (!strRepository.EndsWith("/")) + strRepository += "/"; + strRepository += strNameOfDirectory; + } + + this.Repository = strRepository; + this.SaveSolutionFile(); + + // import "c:\temp\a\b \d\dir" "file:///d:/temp/svn/...." -m "Initital " + string strArguments = string.Format("import \"{0}\" \"{1}\" -m \"{2}\"", this.DirectorySolution, this.Repository, strMessage); + Svn svn = new Svn(); + if (!svn.Execute(strArguments, false, true)) + return; + try + { + Directory.Move(this.DirectorySolution, this.DirectorySolution + ".bak"); + svn.Execute("checkout \"" + this.Repository + "\" \"" + this.DirectorySolution + "\"", false, true); + } + catch // (Exception exception) + { + MessageBox.Show("Can't rename Directory", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void SvnUpdate() + { + Svn svn = new Svn(); + svn.Execute("update \"" + this.DirectorySolution + "\"",true, true); + } + + private void SvnCommit() + { + SvnAguments svnArguments = new SvnAguments(); + svnArguments.Text = "SVN Commit"; + svnArguments.ReadOnly = true; + svnArguments.Repository = this.Repository; + svnArguments.Comment = ""; + if (svnArguments.ShowDialog(this) == DialogResult.OK) + { + Svn svn = new Svn(); + svn.Execute("commit \"" + this.DirectorySolution + "\" -m \"" + svnArguments.Comment+ "\"", true, true); + } + } + + private void cms_MouseClick(object sender, MouseEventArgs e) + { + ContextMenuStrip cms = sender as ContextMenuStrip; + TreeNode tn = cms.Tag as TreeNode; + ToolStripMenuItem tsi = cms.GetItemAt(e.X, e.Y) as ToolStripMenuItem; + + if (tsi == null) + return; // TODO, why is this?? + + if (tsi.DropDownItems.Count == 0) + cms.Visible = false; + this.treeView1.Invalidate(tn.Bounds); + + switch (tsi.Name) + { + case "SvnImport": + SvnImport(); + break; + case "SvnUpdate": + SvnUpdate(); + break; + case "SvnCommit": + SvnCommit(); + break; + case "CloseSolution": + CloseSolution(); + break; + case "AddExistingFile": + AddExistingFile(tn); + break; + case "AddExistingProject": + AddExistingProject(); + break; + case "AddNewProject": + AddNewProjectAction(); + break; + case "AddNewObject": + AddNewContainer(tn, TypeSL.Object, GetNewDirectoryName(tn, "Object{0}"), Guid.NewGuid()); + break; + case "AddNewFolder": + AddNewContainer(tn, TypeSL.Folder, GetNewDirectoryName(tn, "Folder{0}"), Guid.NewGuid()); + break; + case "AddInventory": + EmptyInventory(tn); + break; + case "SetAsActiveProject": + SetAsActiveProject(tn); + break; + case "SetAsActiveBox": + SetAsActiveBox(tn); + break; + case "Cut": + CutAction(tn); + break; + case "Copy": + CopyAction(tn); + break; + case "Delete": + DeleteAction(tn); + break; + case "Paste": + PasteAction(tn); + break; + case "Remove": + RemoveAction(tn); + break; + case "Rename": + RenameAction(tn); + break; + case "Add": + // via dropdownitems + return; + case "ChangeFileType": + // via dropdownitems + return; + case "Properties": + PropertiesActions(tn); + break; + case "DebugStart": + DebugStart(); + break; + case "AddExistingObject": + AddExistingObject(tn); + break; + default: + MessageBox.Show("cms_MouseClick: " + tsi.Text, "TODO!!"); + break; + } + } + + } + public class NodeSorter : System.Collections.IComparer + { + public int Compare(object x, object y) + { + TreeNode tx = x as TreeNode; + TreeNode ty = y as TreeNode; + return string.Compare(tx.Text, ty.Text); + } + } + + +} diff --git a/Solution/SolutionExplorer.designer.cs b/Solution/SolutionExplorer.designer.cs new file mode 100644 index 0000000..46da504 --- /dev/null +++ b/Solution/SolutionExplorer.designer.cs @@ -0,0 +1,118 @@ +namespace LSLEditor.Solution +{ + partial class SolutionExplorer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.treeView1 = new System.Windows.Forms.TreeView(); + this.listView1 = new System.Windows.Forms.ListView(); + this.panel1 = new System.Windows.Forms.Panel(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.panel2 = new System.Windows.Forms.Panel(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // treeView1 + // + this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeView1.Location = new System.Drawing.Point(0, 0); + this.treeView1.Name = "treeView1"; + this.treeView1.Size = new System.Drawing.Size(216, 192); + this.treeView1.TabIndex = 0; + this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); + this.treeView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown); + // + // listView1 + // + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.FullRowSelect = true; + this.listView1.GridLines = true; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.MultiSelect = false; + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(216, 75); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseMove); + // + // panel1 + // + this.panel1.AutoScroll = true; + this.panel1.Controls.Add(this.listView1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 200); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(216, 75); + this.panel1.TabIndex = 1; + // + // splitter1 + // + this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.splitter1.Location = new System.Drawing.Point(0, 192); + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(216, 8); + this.splitter1.TabIndex = 2; + this.splitter1.TabStop = false; + // + // panel2 + // + this.panel2.Controls.Add(this.treeView1); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(216, 192); + this.panel2.TabIndex = 3; + // + // SolutionExplorer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panel2); + this.Controls.Add(this.splitter1); + this.Controls.Add(this.panel1); + this.Name = "SolutionExplorer"; + this.Size = new System.Drawing.Size(216, 275); + this.panel1.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView treeView1; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.Panel panel2; + + } +} diff --git a/Solution/SolutionExplorer.resx b/Solution/SolutionExplorer.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Solution/SolutionExplorer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Solution/SvnAguments.Designer.cs b/Solution/SvnAguments.Designer.cs new file mode 100644 index 0000000..bf6f453 --- /dev/null +++ b/Solution/SvnAguments.Designer.cs @@ -0,0 +1,139 @@ +namespace LSLEditor.Solution +{ + partial class SvnAguments + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(144, 96); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Ok"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(312, 80); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "repository properties"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(88, 48); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(208, 20); + this.textBox2.TabIndex = 3; + this.textBox2.Text = "Initial import"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(24, 48); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(51, 13); + this.label2.TabIndex = 2; + this.label2.Text = "Comment"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(88, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(208, 20); + this.textBox1.TabIndex = 1; + this.textBox1.Text = "file:///d:/temp/svn/"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(24, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(57, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Repository"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(232, 96); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // SvnAguments + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(335, 132); + this.Controls.Add(this.button2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SvnAguments"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Svn Arguments"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button2; + } +} \ No newline at end of file diff --git a/Solution/SvnAguments.cs b/Solution/SvnAguments.cs new file mode 100644 index 0000000..e38c2a8 --- /dev/null +++ b/Solution/SvnAguments.cs @@ -0,0 +1,107 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Solution +{ + public partial class SvnAguments : Form + { + public SvnAguments() + { + InitializeComponent(); + this.DialogResult = DialogResult.Cancel; + } + + public string Repository + { + get + { + return this.textBox1.Text.Trim(); + } + set + { + this.textBox1.Text = value; + } + } + + public string Comment + { + get + { + return this.textBox2.Text.Trim(); + } + set + { + this.textBox2.Text = value; + } + } + + public bool ReadOnly + { + set + { + this.textBox1.Enabled = !value; + } + } + + private void button1_Click(object sender, EventArgs e) + { + //Import(); + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void button2_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + } +} \ No newline at end of file diff --git a/Solution/SvnAguments.resx b/Solution/SvnAguments.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Solution/SvnAguments.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SyntaxError.Designer.cs b/SyntaxError.Designer.cs new file mode 100644 index 0000000..45d83ff --- /dev/null +++ b/SyntaxError.Designer.cs @@ -0,0 +1,166 @@ +namespace LSLEditor +{ + partial class SyntaxError + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SyntaxError)); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader6 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader7 = new System.Windows.Forms.ColumnHeader(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.copyLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyDescriptionOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2, + this.columnHeader3, + this.columnHeader4, + this.columnHeader5, + this.columnHeader6, + this.columnHeader7}); + this.listView1.ContextMenuStrip = this.contextMenuStrip1; + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.FullRowSelect = true; + this.listView1.GridLines = true; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(515, 131); + this.listView1.SmallImageList = this.imageList1; + this.listView1.TabIndex = 1; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); + this.listView1.Resize += new System.EventHandler(this.listView1_Resize); + this.listView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listView1_KeyDown); + // + // columnHeader1 + // + this.columnHeader1.Text = ""; + this.columnHeader1.Width = 25; + // + // columnHeader2 + // + this.columnHeader2.Text = ""; + this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.columnHeader2.Width = 40; + // + // columnHeader3 + // + this.columnHeader3.Text = "Description"; + this.columnHeader3.Width = 200; + // + // columnHeader4 + // + this.columnHeader4.Text = "File"; + this.columnHeader4.Width = 100; + // + // columnHeader5 + // + this.columnHeader5.Text = "Line"; + this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.columnHeader5.Width = 40; + // + // columnHeader6 + // + this.columnHeader6.Text = "Chr"; + this.columnHeader6.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.columnHeader6.Width = 40; + // + // columnHeader7 + // + this.columnHeader7.Text = "Project"; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.copyLineToolStripMenuItem, + this.copyDescriptionOnlyToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(190, 70); + // + // copyLineToolStripMenuItem + // + this.copyLineToolStripMenuItem.Name = "copyLineToolStripMenuItem"; + this.copyLineToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.copyLineToolStripMenuItem.Text = "Copy"; + this.copyLineToolStripMenuItem.Click += new System.EventHandler(this.copyLineToolStripMenuItem_Click); + // + // copyDescriptionOnlyToolStripMenuItem + // + this.copyDescriptionOnlyToolStripMenuItem.Name = "copyDescriptionOnlyToolStripMenuItem"; + this.copyDescriptionOnlyToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.copyDescriptionOnlyToolStripMenuItem.Text = "Copy Description only"; + this.copyDescriptionOnlyToolStripMenuItem.Click += new System.EventHandler(this.copyDescriptionOnlyToolStripMenuItem_Click); + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Magenta; + this.imageList1.Images.SetKeyName(0, ""); + this.imageList1.Images.SetKeyName(1, ""); + // + // SyntaxError + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView1); + this.Name = "SyntaxError"; + this.Size = new System.Drawing.Size(515, 131); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.ColumnHeader columnHeader3; + private System.Windows.Forms.ColumnHeader columnHeader4; + private System.Windows.Forms.ColumnHeader columnHeader5; + private System.Windows.Forms.ColumnHeader columnHeader6; + private System.Windows.Forms.ColumnHeader columnHeader7; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem copyLineToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyDescriptionOnlyToolStripMenuItem; + } +} diff --git a/SyntaxError.cs b/SyntaxError.cs new file mode 100644 index 0000000..c372ccc --- /dev/null +++ b/SyntaxError.cs @@ -0,0 +1,183 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class SyntaxError : UserControl + { + public SyntaxError() + { + InitializeComponent(); + } + + public void Clear() + { + this.listView1.Items.Clear(); + } + + public ListView ListView + { + get + { + return this.listView1; + } + } + + public bool HasErrors + { + get + { + return (this.listView1.Items.Count > 0); + } + } + + public class SyntaxErrorEventArgs : EventArgs + { + public string FullPathName; + public Guid EditFormGuid; + public bool IsScript; + public int Line; + public int Char; + public SyntaxErrorEventArgs(string strPath, Guid guid, bool isScript, int intLine, int intChar) + { + this.FullPathName = strPath; + this.IsScript = isScript; + this.EditFormGuid = guid; + this.Line = intLine; + this.Char = intChar; + } + } + + public delegate void SyntaxErrorHandler(object sender, SyntaxErrorEventArgs e); + + public event SyntaxErrorHandler OnSyntaxError; + + private void DoSyntaxError(string strPath, Guid guid, bool isScript, int intLine, int intChar) + { + if(OnSyntaxError != null) + OnSyntaxError(this, new SyntaxErrorEventArgs(strPath, guid, isScript, intLine, intChar)); + } + + private void listView1_DoubleClick(object sender, EventArgs e) + { + foreach (ListViewItem lvi in this.listView1.Items) + lvi.BackColor = this.listView1.BackColor; + + if (this.listView1.SelectedItems.Count == 1) + { + ListViewItem lvi = this.listView1.SelectedItems[0]; + lvi.BackColor = SystemColors.Control; + int intLine, intChr; + if (int.TryParse(lvi.SubItems[4].Text, out intLine) && + int.TryParse(lvi.SubItems[5].Text, out intChr)) + { + string strPath = lvi.SubItems[7].Text; + Guid guid = new Guid(lvi.SubItems[8].Text); + bool isScript = Convert.ToBoolean(lvi.SubItems[9].Text); + DoSyntaxError(strPath,guid,isScript, intLine, intChr); + } + } + } + + private void listView1_Resize(object sender, EventArgs e) + { + if (this.listView1.Columns.Count == 0) + return; + int intWidth = 0; + for (int intI = 0; intI < this.listView1.Columns.Count; intI++) + { + if (intI != 2) + intWidth += this.listView1.Columns[intI].Width; + } + this.listView1.Columns[2].Width = this.listView1.Width - intWidth - 50; + } + + private void CopyToClipboard(bool blnDescriptionOnly) + { + if (this.listView1.SelectedItems.Count > 0) + { + StringBuilder sb = new StringBuilder(); + //sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\r\n", this.listView1.Columns[1].Text, this.listView1.Columns[2].Text, this.listView1.Columns[3].Text, this.listView1.Columns[4].Text, this.listView1.Columns[5].Text, this.listView1.Columns[6].Text); + foreach (ListViewItem lvi in this.listView1.SelectedItems) + { + if(blnDescriptionOnly) + sb.AppendFormat("{0}\r\n", lvi.SubItems[2].Text); + else + sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\r\n", lvi.SubItems[1].Text, lvi.SubItems[2].Text, lvi.SubItems[3].Text, lvi.SubItems[4].Text, lvi.SubItems[5].Text, lvi.SubItems[6].Text); + } + Clipboard.SetDataObject(sb.ToString(), true); + } + } + + private void listView1_KeyDown(object sender, KeyEventArgs e) + { + if (e.Control) + { + if (e.KeyCode == Keys.A) + { + foreach (ListViewItem lvi in this.listView1.Items) + lvi.Selected = true; + } + if (e.KeyCode == Keys.C) + { + CopyToClipboard(false); + } + } + } + + private void copyLineToolStripMenuItem_Click(object sender, EventArgs e) + { + CopyToClipboard(false); + } + + private void copyDescriptionOnlyToolStripMenuItem_Click(object sender, EventArgs e) + { + CopyToClipboard(true); + } + } +} diff --git a/SyntaxError.resx b/SyntaxError.resx new file mode 100644 index 0000000..76cd9d7 --- /dev/null +++ b/SyntaxError.resx @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 122, 17 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACk + CQAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz + AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ + AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM + AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA + AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA + AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ + AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ + AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA + AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm + ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ + Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz + AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA + AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM + AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM + ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM + Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA + AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM + AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ + AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz + AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm + AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wEAAfYBeQUqAwMEKgED + AVEwAAEbATEBNwE4CjcBOAEwDQAB8AHrAQcgAAEbAVgBWQFeAzgBMQERATEEOAE3AUsMAAEHARMBUgFK + IQABGgFZAl4COAHrARQBEAM4AfsBMAFzCwABBwETAVIBmgFzIQAB9gFZA14B+wExAesBMQI4AV4BNwEq + AfQKAAEHARMBUgGaAXMjAAGgAVkB5QJeATcBMQE3AjgB+wEwAXMEAAHyAQcBrgJsAa4B7wEVAVIBmgFz + JAAB9gFYAuUBXgE3AREBNwE4AfsBOAEDAfIDAAHwAa4BkQG0AbUBtAGuAWwBUQGaAXMmAAGaAVkBoAFe + AVEBFAEDATgB+wExAVEDAAH0Aa4BtQQJAbsBkQFsAXMnAAH2AVgBoAHlAW0B7QEiATcB+wEqARoDAAHv + AbUEGQIJAbUBrgFtKAABmgFZAXkB7AH3ARABNwExAVEEAAH3AbsCGQHzAhkCCQG0Aa4oAAH2AVkBeQHs + Ae8BQwE3AQMBmQQAAewB8AHzAfQB/wH0ARkCCQG1AWwpAAGaAVkBeQFtAVEBNwFRBQAB7wEHAfQC/wH0 + AfMBGQEJAbQBbCkAAfYBWANeAQMBmQUAAfEB7wHzAv8B9AIZAQkBkQH3KgABmgFZAeUBNwFLAf8FAAH0 + Ae8BvAL0AfMBGQEJAbUBbAHzKgAB9gNYAZkHAAHyAe8BBwK8AbsBkQGuAbwsAAH2CwAB9AHxAQcB9wHt + Ae8B8yYAAUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8DAAL/BgAB/wH4BgAB/wHw + BAABgAEAAf8B4AQAAYABAAH/AcEEAAHAAQEB4AEDBAABwAEBAcABBwQAAeABAwGAAQ8EAAHgAQMBgAEP + BAAB8AEHAYABDwQAAfABBwGAAQ8EAAH4AQ8BgAEPBAAB+AEPAYABDwQAAfwBDwGAAQ8EAAH8AR8BwAEf + BAAB/gH/AeABPwQACw== + + + \ No newline at end of file diff --git a/Tools/EnvironmentBrowser.Designer.cs b/Tools/EnvironmentBrowser.Designer.cs new file mode 100644 index 0000000..064ac96 --- /dev/null +++ b/Tools/EnvironmentBrowser.Designer.cs @@ -0,0 +1,74 @@ +namespace LSLEditor.Tools +{ + partial class EnvironmentBrowser + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 80); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "browser settings"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 40); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(158, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.Text = "Browser in seperate window"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // EnvironmentBrowser + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Name = "EnvironmentBrowser"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox checkBox1; + } +} diff --git a/Tools/EnvironmentBrowser.cs b/Tools/EnvironmentBrowser.cs new file mode 100644 index 0000000..63b8db9 --- /dev/null +++ b/Tools/EnvironmentBrowser.cs @@ -0,0 +1,65 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class EnvironmentBrowser : UserControl, ICommit + { + public EnvironmentBrowser() + { + InitializeComponent(); + + this.checkBox1.Checked = Properties.Settings.Default.BrowserInWindow; + } + + public void Commit() + { + Properties.Settings.Default.BrowserInWindow = this.checkBox1.Checked; + } + } +} diff --git a/Tools/EnvironmentBrowser.resx b/Tools/EnvironmentBrowser.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/EnvironmentBrowser.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/EnvironmentGeneral.Designer.cs b/Tools/EnvironmentGeneral.Designer.cs new file mode 100644 index 0000000..475c4d4 --- /dev/null +++ b/Tools/EnvironmentGeneral.Designer.cs @@ -0,0 +1,231 @@ +namespace LSLEditor.Tools +{ + partial class EnvironmentGeneral + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.radioButton4 = new System.Windows.Forms.RadioButton(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.groupBox3.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.checkBox1); + this.groupBox3.Controls.Add(this.radioButton4); + this.groupBox3.Controls.Add(this.radioButton3); + this.groupBox3.Location = new System.Drawing.Point(0, 176); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(184, 96); + this.groupBox3.TabIndex = 7; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "auto update settings"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 16); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(112, 17); + this.checkBox1.TabIndex = 3; + this.checkBox1.Text = "check for updates"; + this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + // + // radioButton4 + // + this.radioButton4.AutoSize = true; + this.radioButton4.Location = new System.Drawing.Point(16, 64); + this.radioButton4.Name = "radioButton4"; + this.radioButton4.Size = new System.Drawing.Size(87, 17); + this.radioButton4.TabIndex = 1; + this.radioButton4.Text = "once a week"; + this.radioButton4.UseVisualStyleBackColor = true; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Location = new System.Drawing.Point(16, 40); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(78, 17); + this.radioButton3.TabIndex = 0; + this.radioButton3.Text = "once a day"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.radioButton1); + this.groupBox2.Controls.Add(this.radioButton2); + this.groupBox2.Location = new System.Drawing.Point(0, 0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 64); + this.groupBox2.TabIndex = 8; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "window layout"; + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(24, 16); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(117, 17); + this.radioButton1.TabIndex = 5; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "Tabbed documents"; + this.radioButton1.UseVisualStyleBackColor = true; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(24, 32); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(131, 17); + this.radioButton2.TabIndex = 6; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "Windowed documents"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Location = new System.Drawing.Point(0, 72); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 96); + this.groupBox1.TabIndex = 9; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "recent file list"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(64, 56); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(124, 13); + this.label2.TabIndex = 3; + this.label2.Text = "recent projects list length"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(64, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(105, 13); + this.label1.TabIndex = 2; + this.label1.Text = "recent files list length"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(24, 56); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(32, 20); + this.textBox2.TabIndex = 1; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(24, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(32, 20); + this.textBox1.TabIndex = 0; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.checkBox2); + this.groupBox4.Location = new System.Drawing.Point(200, 176); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(192, 96); + this.groupBox4.TabIndex = 8; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "auto update files"; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(16, 24); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(153, 17); + this.checkBox2.TabIndex = 3; + this.checkBox2.Text = "delete old files after update"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // EnvironmentGeneral + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox3); + this.Name = "EnvironmentGeneral"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.RadioButton radioButton4; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.CheckBox checkBox2; + } +} diff --git a/Tools/EnvironmentGeneral.cs b/Tools/EnvironmentGeneral.cs new file mode 100644 index 0000000..49f532b --- /dev/null +++ b/Tools/EnvironmentGeneral.cs @@ -0,0 +1,103 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public interface ICommit + { + void Commit(); + } + + public partial class EnvironmentGeneral : UserControl, ICommit + { + public EnvironmentGeneral() + { + InitializeComponent(); + + this.radioButton1.Checked = Properties.Settings.Default.TabbedDocument; + this.radioButton2.Checked = !Properties.Settings.Default.TabbedDocument; + + this.textBox1.Text = Properties.Settings.Default.RecentFileMax.ToString(); + this.textBox2.Text = Properties.Settings.Default.RecentProjectMax.ToString(); + + this.checkBox1.Checked = Properties.Settings.Default.CheckForUpdates; + this.checkBox2.Checked = Properties.Settings.Default.DeleteOldFiles; + this.radioButton3.Checked = Properties.Settings.Default.CheckEveryDay; + this.radioButton4.Checked = Properties.Settings.Default.CheckEveryWeek; + + checkBox1_CheckedChanged(null, null); + } + + public void Commit() + { + Properties.Settings.Default.TabbedDocument = this.radioButton1.Checked; + + int intValue; + + if (int.TryParse(this.textBox1.Text, out intValue)) + Properties.Settings.Default.RecentFileMax = intValue; + if (int.TryParse(this.textBox2.Text, out intValue)) + Properties.Settings.Default.RecentProjectMax = intValue; + + Properties.Settings.Default.CheckForUpdates = this.checkBox1.Checked; + Properties.Settings.Default.CheckEveryDay = this.radioButton3.Checked; + Properties.Settings.Default.CheckEveryWeek = this.radioButton4.Checked; + Properties.Settings.Default.DeleteOldFiles = this.checkBox2.Checked; + } + + private void checkBox1_CheckedChanged(object sender, EventArgs e) + { + this.radioButton3.Enabled = this.checkBox1.Checked; + this.radioButton4.Enabled = this.checkBox1.Checked; + this.groupBox4.Enabled = this.checkBox1.Checked; + } + + } +} diff --git a/Tools/EnvironmentGeneral.resx b/Tools/EnvironmentGeneral.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/EnvironmentGeneral.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/EnvironmentHelp.Designer.cs b/Tools/EnvironmentHelp.Designer.cs new file mode 100644 index 0000000..84a0502 --- /dev/null +++ b/Tools/EnvironmentHelp.Designer.cs @@ -0,0 +1,224 @@ +namespace LSLEditor.Tools +{ + partial class EnvironmentHelp + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.radioButton4 = new System.Windows.Forms.RadioButton(); + this.groupBox6.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.button2); + this.groupBox6.Controls.Add(this.button1); + this.groupBox6.Controls.Add(this.label1); + this.groupBox6.Controls.Add(this.textBox1); + this.groupBox6.Controls.Add(this.radioButton2); + this.groupBox6.Controls.Add(this.radioButton1); + this.groupBox6.Location = new System.Drawing.Point(0, 0); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(392, 112); + this.groupBox6.TabIndex = 12; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "wiki help pages"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(208, 48); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(112, 24); + this.button2.TabIndex = 5; + this.button2.Text = "wiki.secondlife.com"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(120, 48); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 24); + this.button1.TabIndex = 4; + this.button1.Text = "lslwiki.net"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(112, 80); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(144, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Using LSLEditorHelp.chm file"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(112, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(256, 20); + this.textBox1.TabIndex = 2; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(16, 80); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(79, 17); + this.radioButton2.TabIndex = 1; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "Offline Wiki"; + this.radioButton2.UseVisualStyleBackColor = true; + this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged); + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(16, 24); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(79, 17); + this.radioButton1.TabIndex = 0; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "Online Wiki"; + this.radioButton1.UseVisualStyleBackColor = true; + this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.radioButton4); + this.groupBox1.Controls.Add(this.radioButton3); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Location = new System.Drawing.Point(0, 120); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 72); + this.groupBox1.TabIndex = 13; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "online wiki pages"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(152, 48); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(145, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.Text = "New tab for every search"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.checkBox2); + this.groupBox2.Location = new System.Drawing.Point(0, 200); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 56); + this.groupBox2.TabIndex = 14; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "tooltip"; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(16, 24); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(265, 17); + this.checkBox2.TabIndex = 0; + this.checkBox2.Text = "Use tooltips on keywords when hovering script text"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Location = new System.Drawing.Point(16, 24); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(122, 17); + this.radioButton3.TabIndex = 1; + this.radioButton3.TabStop = true; + this.radioButton3.Text = "external webbrowser"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // radioButton4 + // + this.radioButton4.AutoSize = true; + this.radioButton4.Location = new System.Drawing.Point(16, 48); + this.radioButton4.Name = "radioButton4"; + this.radioButton4.Size = new System.Drawing.Size(119, 17); + this.radioButton4.TabIndex = 2; + this.radioButton4.TabStop = true; + this.radioButton4.Text = "internal webbrowser"; + this.radioButton4.UseVisualStyleBackColor = true; + this.radioButton4.CheckedChanged += new System.EventHandler(this.radioButton4_CheckedChanged); + // + // EnvironmentHelp + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBox6); + this.Name = "EnvironmentHelp"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.RadioButton radioButton4; + private System.Windows.Forms.RadioButton radioButton3; + } +} diff --git a/Tools/EnvironmentHelp.cs b/Tools/EnvironmentHelp.cs new file mode 100644 index 0000000..7322cfe --- /dev/null +++ b/Tools/EnvironmentHelp.cs @@ -0,0 +1,135 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Reflection; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class EnvironmentHelp : UserControl, ICommit + { + public EnvironmentHelp() + { + InitializeComponent(); + + this.radioButton1.Checked = Properties.Settings.Default.HelpOnline; + this.radioButton2.Checked = Properties.Settings.Default.HelpOffline; + + this.radioButton3.Checked = Properties.Settings.Default.WikiSeperateBrowser; + this.radioButton4.Checked = !Properties.Settings.Default.WikiSeperateBrowser; + + this.checkBox1.Checked = Properties.Settings.Default.HelpNewTab; + + this.checkBox2.Checked = Properties.Settings.Default.ToolTip; + + this.textBox1.Text = Properties.Settings.Default.Help; + + radioButton1_CheckedChanged(null, null); + + radioButton4_CheckedChanged(null, null); + } + + public void Commit() + { + Properties.Settings.Default.HelpOnline = this.radioButton1.Checked; + Properties.Settings.Default.HelpOffline= this.radioButton2.Checked; + Properties.Settings.Default.WikiSeperateBrowser = this.radioButton3.Checked; + + Properties.Settings.Default.HelpNewTab = this.checkBox1.Checked; + Properties.Settings.Default.ToolTip = this.checkBox2.Checked; + + Properties.Settings.Default.Help = this.textBox1.Text; + } + + private void radioButton2_CheckedChanged(object sender, EventArgs e) + { + if (this.radioButton2.Checked) + { + this.textBox1.Enabled = false; + string strHelpFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + Properties.Settings.Default.HelpOfflineFile); + if (!File.Exists(strHelpFile)) + { + if (MessageBox.Show("Help file does not exist, would you like to download it?", "Download Helpfile", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) + { + UpdateApplicationForm updater = new UpdateApplicationForm(); + //updater.Icon = this.Icon; // TODO!! + updater.CheckForHelpFile(); + updater.ShowDialog(this); + return; + } + } + + } + } + + private void radioButton1_CheckedChanged(object sender, EventArgs e) + { + this.textBox1.Enabled = this.radioButton1.Checked; + this.groupBox1.Enabled = this.radioButton1.Checked; + this.button1.Enabled = this.radioButton1.Checked; + this.button2.Enabled = this.radioButton1.Checked; + } + + private void button1_Click(object sender, EventArgs e) + { + this.textBox1.Text = Properties.Settings.Default.Help1; + } + + private void button2_Click(object sender, EventArgs e) + { + this.textBox1.Text = Properties.Settings.Default.Help2; + } + + private void radioButton4_CheckedChanged(object sender, EventArgs e) + { + this.checkBox1.Enabled = this.radioButton4.Checked; + } + + } +} diff --git a/Tools/EnvironmentHelp.resx b/Tools/EnvironmentHelp.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/EnvironmentHelp.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/EnvironmentPlugins.Designer.cs b/Tools/EnvironmentPlugins.Designer.cs new file mode 100644 index 0000000..54cd0fb --- /dev/null +++ b/Tools/EnvironmentPlugins.Designer.cs @@ -0,0 +1,74 @@ +namespace LSLEditor.Tools +{ + partial class EnvironmentPlugins + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 56); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "plugins"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(24, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(178, 13); + this.label1.TabIndex = 0; + this.label1.Text = "No plugins found in directory Plugins"; + // + // EnvironmentPlugins + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Name = "EnvironmentPlugins"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label1; + + } +} diff --git a/Tools/EnvironmentPlugins.cs b/Tools/EnvironmentPlugins.cs new file mode 100644 index 0000000..90cee3a --- /dev/null +++ b/Tools/EnvironmentPlugins.cs @@ -0,0 +1,131 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Drawing; +using System.Reflection; +using System.Windows.Forms; +using System.Collections.Specialized; + +namespace LSLEditor.Tools +{ + public partial class EnvironmentPlugins : UserControl, ICommit + { + private int intX,intY; + + public EnvironmentPlugins() + { + InitializeComponent(); + + ShowPlugins(); + } + + private void ShowPlugin(string strName) + { + CheckBox checkBox = new CheckBox(); + checkBox.AutoSize = true; + checkBox.Text = strName; + checkBox.Name = "Plugin_" + strName; + checkBox.Tag = strName; + checkBox.Checked = Properties.Settings.Default.Plugins.Contains(checkBox.Tag.ToString()); + checkBox.Location = new Point(intX, intY); + this.groupBox1.Controls.Add(checkBox); + intY += 20; + this.label1.Visible = false; + } + + private void ShowPlugins() + { + if (Properties.Settings.Default.Plugins == null) + Properties.Settings.Default.Plugins = new StringCollection(); + + string strDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string strPluginsDirectory = Path.Combine(strDirectory, "Plugins"); + + intX = 20; + intY = 20; + + if (Directory.Exists(strPluginsDirectory)) + { + foreach (string strFilePath in Directory.GetFiles(strPluginsDirectory, "*.exe")) + { + ShowPlugin(Path.GetFileNameWithoutExtension(strFilePath)); + } + } + if (Svn.IsInstalled) + { + if(!Properties.Settings.Default.Plugins.Contains("SVN (Version control)")) + Properties.Settings.Default.Plugins.Add("SVN (Version control)"); + ShowPlugin("SVN (Version control)"); + } + + this.groupBox1.Height = intY + 20; + } + + public void Commit() + { + Properties.Settings.Default.Plugins = new StringCollection(); + + bool SvnPlugin = false; + foreach (Control control in this.groupBox1.Controls) + { + CheckBox checkBox = control as CheckBox; + if (checkBox == null) + continue; + if (checkBox.Checked) + { + string strPluginName = checkBox.Tag.ToString(); + Properties.Settings.Default.Plugins.Add(strPluginName); + if (strPluginName.ToLower().Contains("svn")) + SvnPlugin = true; + } + } + if (!SvnPlugin) + { + Properties.Settings.Default.VersionControl = false; + Properties.Settings.Default.VersionControlSVN = false; + } + } + } +} diff --git a/Tools/EnvironmentPlugins.resx b/Tools/EnvironmentPlugins.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/EnvironmentPlugins.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/ProjectSettings.Designer.cs b/Tools/ProjectSettings.Designer.cs new file mode 100644 index 0000000..0b1be72 --- /dev/null +++ b/Tools/ProjectSettings.Designer.cs @@ -0,0 +1,126 @@ +namespace LSLEditor.Tools +{ + partial class ProjectSettings + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 88); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "project settings"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(336, 40); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(32, 23); + this.button1.TabIndex = 2; + this.button1.Text = "..."; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(16, 40); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(312, 20); + this.textBox1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(136, 13); + this.label1.TabIndex = 0; + this.label1.Text = "LSLEditor projects location:"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.checkBox4); + this.groupBox2.Location = new System.Drawing.Point(0, 96); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 56); + this.groupBox2.TabIndex = 10; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "file extension association"; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(16, 24); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(150, 17); + this.checkBox4.TabIndex = 0; + this.checkBox4.Text = "register .sol with LSLEditor"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // ProjectSettings + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Name = "ProjectSettings"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox checkBox4; + } +} diff --git a/Tools/ProjectSettings.cs b/Tools/ProjectSettings.cs new file mode 100644 index 0000000..2b74432 --- /dev/null +++ b/Tools/ProjectSettings.cs @@ -0,0 +1,93 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class ProjectSettings : UserControl, ICommit + { + public ProjectSettings() + { + InitializeComponent(); + + this.textBox1.Text = Properties.Settings.Default.ProjectLocation; + + this.checkBox4.Checked = Helpers.FileAssociator.IsAssociated(".sol"); + } + + public void Commit() + { + Properties.Settings.Default.ProjectLocation = this.textBox1.Text; + + if (this.checkBox4.Checked) + { + if (! + Helpers.FileAssociator.Associate(".sol", "LSLEditorSolution", "Solution File for LSLEditor", Assembly.GetExecutingAssembly().Location, 0)) + MessageBox.Show("File association can not be made (needs administrative access)", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else + { + if (Helpers.FileAssociator.IsAssociated(".sol")) + { + if(!Helpers.FileAssociator.DeAssociate(".sol", "LSLEditorSolution")) + MessageBox.Show("File association can not be unmade (needs administrative access)", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void button1_Click(object sender, EventArgs e) + { + this.folderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer; + if (this.folderBrowserDialog1.ShowDialog(this) == DialogResult.OK) + { + if(Directory.Exists(this.folderBrowserDialog1.SelectedPath)) + this.textBox1.Text = this.folderBrowserDialog1.SelectedPath; + } + } + + } +} diff --git a/Tools/ProjectSettings.resx b/Tools/ProjectSettings.resx new file mode 100644 index 0000000..c3fe8f1 --- /dev/null +++ b/Tools/ProjectSettings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Tools/RuntimeExternal.Designer.cs b/Tools/RuntimeExternal.Designer.cs new file mode 100644 index 0000000..e7cd2e1 --- /dev/null +++ b/Tools/RuntimeExternal.Designer.cs @@ -0,0 +1,129 @@ +namespace LSLEditor.Tools +{ + partial class RuntimeExternal + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.ProxyPassword = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.ProxyUserid = new System.Windows.Forms.TextBox(); + this.ProxyServer = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.label6); + this.groupBox3.Controls.Add(this.ProxyPassword); + this.groupBox3.Controls.Add(this.label5); + this.groupBox3.Controls.Add(this.ProxyUserid); + this.groupBox3.Controls.Add(this.ProxyServer); + this.groupBox3.Controls.Add(this.label3); + this.groupBox3.Location = new System.Drawing.Point(0, 0); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(392, 96); + this.groupBox3.TabIndex = 8; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Proxy"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 64); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(53, 13); + this.label6.TabIndex = 7; + this.label6.Text = "Password"; + // + // ProxyPassword + // + this.ProxyPassword.Location = new System.Drawing.Point(88, 64); + this.ProxyPassword.Name = "ProxyPassword"; + this.ProxyPassword.PasswordChar = '*'; + this.ProxyPassword.Size = new System.Drawing.Size(152, 20); + this.ProxyPassword.TabIndex = 6; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(8, 40); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(37, 13); + this.label5.TabIndex = 5; + this.label5.Text = "Userid"; + // + // ProxyUserid + // + this.ProxyUserid.Location = new System.Drawing.Point(88, 40); + this.ProxyUserid.Name = "ProxyUserid"; + this.ProxyUserid.Size = new System.Drawing.Size(152, 20); + this.ProxyUserid.TabIndex = 3; + // + // ProxyServer + // + this.ProxyServer.Location = new System.Drawing.Point(88, 16); + this.ProxyServer.Name = "ProxyServer"; + this.ProxyServer.Size = new System.Drawing.Size(208, 20); + this.ProxyServer.TabIndex = 2; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(8, 16); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(38, 13); + this.label3.TabIndex = 0; + this.label3.Text = "Server"; + // + // RuntimeInternal + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox3); + this.Name = "RuntimeInternal"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox ProxyPassword; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox ProxyUserid; + private System.Windows.Forms.TextBox ProxyServer; + private System.Windows.Forms.Label label3; + + } +} diff --git a/Tools/RuntimeExternal.cs b/Tools/RuntimeExternal.cs new file mode 100644 index 0000000..662f05a --- /dev/null +++ b/Tools/RuntimeExternal.cs @@ -0,0 +1,71 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class RuntimeExternal : UserControl, ICommit + { + public RuntimeExternal() + { + InitializeComponent(); + + this.ProxyServer.Text = Properties.Settings.Default.ProxyServer; + this.ProxyUserid.Text = Properties.Settings.Default.ProxyUserid; + this.ProxyPassword.Text = Properties.Settings.Default.ProxyPassword; + } + + public void Commit() + { + Properties.Settings.Default.ProxyServer = this.ProxyServer.Text; + Properties.Settings.Default.ProxyUserid = this.ProxyUserid.Text; + Properties.Settings.Default.ProxyPassword = this.ProxyPassword.Text; + } + } +} diff --git a/Tools/RuntimeExternal.resx b/Tools/RuntimeExternal.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/RuntimeExternal.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/RuntimeGeneral.Designer.cs b/Tools/RuntimeGeneral.Designer.cs new file mode 100644 index 0000000..6a3659b --- /dev/null +++ b/Tools/RuntimeGeneral.Designer.cs @@ -0,0 +1,182 @@ +namespace LSLEditor.Tools +{ + partial class RuntimeGeneral + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox7 = new System.Windows.Forms.CheckBox(); + this.checkBox6 = new System.Windows.Forms.CheckBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.checkBox5 = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox7); + this.groupBox1.Controls.Add(this.checkBox6); + this.groupBox1.Controls.Add(this.checkBox3); + this.groupBox1.Controls.Add(this.checkBox2); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 152); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "General"; + // + // checkBox7 + // + this.checkBox7.AutoSize = true; + this.checkBox7.Location = new System.Drawing.Point(16, 120); + this.checkBox7.Name = "checkBox7"; + this.checkBox7.Size = new System.Drawing.Size(220, 17); + this.checkBox7.TabIndex = 4; + this.checkBox7.Text = "state changes allowed in global functions"; + this.checkBox7.UseVisualStyleBackColor = true; + // + // checkBox6 + // + this.checkBox6.AutoSize = true; + this.checkBox6.Location = new System.Drawing.Point(16, 96); + this.checkBox6.Name = "checkBox6"; + this.checkBox6.Size = new System.Drawing.Size(187, 17); + this.checkBox6.TabIndex = 3; + this.checkBox6.Text = "llGetScriptName without extension"; + this.checkBox6.UseVisualStyleBackColor = true; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(16, 72); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(223, 17); + this.checkBox3.TabIndex = 2; + this.checkBox3.Text = "Single quote char \' allowed outside strings"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(16, 48); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(168, 17); + this.checkBox2.TabIndex = 1; + this.checkBox2.Text = "Skip warnings when compiling"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 24); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(195, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.Text = "C style comments allowed (/* .... */)"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.checkBox4); + this.groupBox2.Location = new System.Drawing.Point(0, 152); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 56); + this.groupBox2.TabIndex = 6; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Verbose window"; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(16, 24); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(163, 17); + this.checkBox4.TabIndex = 0; + this.checkBox4.Text = "Quoted \"strings\" in list output"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.checkBox5); + this.groupBox3.Location = new System.Drawing.Point(0, 208); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(392, 56); + this.groupBox3.TabIndex = 7; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Auto save"; + // + // checkBox5 + // + this.checkBox5.AutoSize = true; + this.checkBox5.Location = new System.Drawing.Point(16, 24); + this.checkBox5.Name = "checkBox5"; + this.checkBox5.Size = new System.Drawing.Size(204, 17); + this.checkBox5.TabIndex = 0; + this.checkBox5.Text = "Use autosave on files when compiling"; + this.checkBox5.UseVisualStyleBackColor = true; + // + // RuntimeGeneral + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Name = "RuntimeGeneral"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox checkBox4; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.CheckBox checkBox5; + private System.Windows.Forms.CheckBox checkBox6; + private System.Windows.Forms.CheckBox checkBox7; + } +} diff --git a/Tools/RuntimeGeneral.cs b/Tools/RuntimeGeneral.cs new file mode 100644 index 0000000..e1bfcc0 --- /dev/null +++ b/Tools/RuntimeGeneral.cs @@ -0,0 +1,77 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class RuntimeGeneral : UserControl, ICommit + { + public RuntimeGeneral() + { + InitializeComponent(); + + this.checkBox1.Checked = Properties.Settings.Default.CommentCStyle; + this.checkBox2.Checked = Properties.Settings.Default.SkipWarnings; + this.checkBox3.Checked = Properties.Settings.Default.SingleQuote; + this.checkBox4.Checked = Properties.Settings.Default.QuotesListVerbose; + this.checkBox5.Checked = Properties.Settings.Default.AutoSaveOnDebug; + this.checkBox6.Checked = Properties.Settings.Default.llGetScriptName; + this.checkBox7.Checked = Properties.Settings.Default.StatesInGlobalFunctions; + } + + public void Commit() + { + Properties.Settings.Default.CommentCStyle = this.checkBox1.Checked; + Properties.Settings.Default.SkipWarnings = this.checkBox2.Checked; + Properties.Settings.Default.SingleQuote = this.checkBox3.Checked; + Properties.Settings.Default.QuotesListVerbose = this.checkBox4.Checked; + Properties.Settings.Default.AutoSaveOnDebug = this.checkBox5.Checked; + Properties.Settings.Default.llGetScriptName = this.checkBox6.Checked; + Properties.Settings.Default.StatesInGlobalFunctions = this.checkBox7.Checked; + } + + + } +} diff --git a/Tools/RuntimeGeneral.resx b/Tools/RuntimeGeneral.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/RuntimeGeneral.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/RuntimeInternal.Designer.cs b/Tools/RuntimeInternal.Designer.cs new file mode 100644 index 0000000..e3c66ee --- /dev/null +++ b/Tools/RuntimeInternal.Designer.cs @@ -0,0 +1,313 @@ +namespace LSLEditor.Tools +{ + partial class RuntimeInternal + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.XSecondLifeShard = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.RegionFPS = new System.Windows.Forms.TextBox(); + this.RegionName = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.AvatarKey = new System.Windows.Forms.TextBox(); + this.AvatarName = new System.Windows.Forms.TextBox(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.textBoxParcelArea = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.textBoxParcelGroup = new System.Windows.Forms.TextBox(); + this.textBoxParcelOwner = new System.Windows.Forms.TextBox(); + this.textBoxParcelDescription = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.textBoxParcelName = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.groupBox4.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.XSecondLifeShard); + this.groupBox4.Controls.Add(this.label2); + this.groupBox4.Controls.Add(this.label8); + this.groupBox4.Controls.Add(this.RegionFPS); + this.groupBox4.Controls.Add(this.RegionName); + this.groupBox4.Controls.Add(this.label7); + this.groupBox4.Location = new System.Drawing.Point(0, 72); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(392, 64); + this.groupBox4.TabIndex = 0; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Sim"; + // + // XSecondLifeShard + // + this.XSecondLifeShard.Location = new System.Drawing.Point(256, 40); + this.XSecondLifeShard.Name = "XSecondLifeShard"; + this.XSecondLifeShard.Size = new System.Drawing.Size(120, 20); + this.XSecondLifeShard.TabIndex = 6; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(144, 40); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(102, 13); + this.label2.TabIndex = 0; + this.label2.Text = "X-SecondLife-Shard"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(16, 40); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(61, 13); + this.label8.TabIndex = 0; + this.label8.Text = "RegionFPS"; + // + // RegionFPS + // + this.RegionFPS.Location = new System.Drawing.Point(80, 40); + this.RegionFPS.Name = "RegionFPS"; + this.RegionFPS.Size = new System.Drawing.Size(48, 20); + this.RegionFPS.TabIndex = 5; + // + // RegionName + // + this.RegionName.Location = new System.Drawing.Point(80, 16); + this.RegionName.Name = "RegionName"; + this.RegionName.Size = new System.Drawing.Size(272, 20); + this.RegionName.TabIndex = 4; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(8, 16); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(69, 13); + this.label7.TabIndex = 0; + this.label7.Text = "RegionName"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.AvatarKey); + this.groupBox1.Controls.Add(this.AvatarName); + this.groupBox1.Controls.Add(this.linkLabel1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 64); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Avatar"; + // + // AvatarKey + // + this.AvatarKey.Location = new System.Drawing.Point(80, 40); + this.AvatarKey.Name = "AvatarKey"; + this.AvatarKey.Size = new System.Drawing.Size(272, 20); + this.AvatarKey.TabIndex = 3; + // + // AvatarName + // + this.AvatarName.Location = new System.Drawing.Point(80, 16); + this.AvatarName.Name = "AvatarName"; + this.AvatarName.Size = new System.Drawing.Size(272, 20); + this.AvatarName.TabIndex = 1; + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Location = new System.Drawing.Point(48, 40); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(24, 13); + this.linkLabel1.TabIndex = 2; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "key"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(40, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Name"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.textBoxParcelArea); + this.groupBox2.Controls.Add(this.label9); + this.groupBox2.Controls.Add(this.textBoxParcelGroup); + this.groupBox2.Controls.Add(this.textBoxParcelOwner); + this.groupBox2.Controls.Add(this.textBoxParcelDescription); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.textBoxParcelName); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Location = new System.Drawing.Point(0, 144); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 120); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Parcel"; + // + // textBoxParcelArea + // + this.textBoxParcelArea.Location = new System.Drawing.Point(320, 40); + this.textBoxParcelArea.Name = "textBoxParcelArea"; + this.textBoxParcelArea.Size = new System.Drawing.Size(56, 20); + this.textBoxParcelArea.TabIndex = 13; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(320, 24); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(29, 13); + this.label9.TabIndex = 0; + this.label9.Text = "Area"; + // + // textBoxParcelGroup + // + this.textBoxParcelGroup.Location = new System.Drawing.Point(80, 88); + this.textBoxParcelGroup.Name = "textBoxParcelGroup"; + this.textBoxParcelGroup.Size = new System.Drawing.Size(224, 20); + this.textBoxParcelGroup.TabIndex = 12; + // + // textBoxParcelOwner + // + this.textBoxParcelOwner.Location = new System.Drawing.Point(80, 64); + this.textBoxParcelOwner.Name = "textBoxParcelOwner"; + this.textBoxParcelOwner.Size = new System.Drawing.Size(224, 20); + this.textBoxParcelOwner.TabIndex = 10; + // + // textBoxParcelDescription + // + this.textBoxParcelDescription.Location = new System.Drawing.Point(80, 40); + this.textBoxParcelDescription.Name = "textBoxParcelDescription"; + this.textBoxParcelDescription.Size = new System.Drawing.Size(224, 20); + this.textBoxParcelDescription.TabIndex = 8; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(8, 40); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.TabIndex = 0; + this.label3.Text = "Description"; + // + // textBoxParcelName + // + this.textBoxParcelName.Location = new System.Drawing.Point(80, 16); + this.textBoxParcelName.Name = "textBoxParcelName"; + this.textBoxParcelName.Size = new System.Drawing.Size(224, 20); + this.textBoxParcelName.TabIndex = 7; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(32, 16); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(35, 13); + this.label5.TabIndex = 0; + this.label5.Text = "Name"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(8, 64); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(64, 13); + this.label4.TabIndex = 0; + this.label4.Text = "Owner (key)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 88); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(62, 13); + this.label6.TabIndex = 0; + this.label6.Text = "Group (key)"; + // + // RuntimeInternal + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.groupBox1); + this.Name = "RuntimeInternal"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox RegionFPS; + private System.Windows.Forms.TextBox RegionName; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox AvatarKey; + private System.Windows.Forms.TextBox AvatarName; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox XSecondLifeShard; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox textBoxParcelName; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox textBoxParcelDescription; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBoxParcelArea; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox textBoxParcelGroup; + private System.Windows.Forms.TextBox textBoxParcelOwner; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label4; + } +} diff --git a/Tools/RuntimeInternal.cs b/Tools/RuntimeInternal.cs new file mode 100644 index 0000000..538a4a1 --- /dev/null +++ b/Tools/RuntimeInternal.cs @@ -0,0 +1,175 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; + +namespace LSLEditor.Tools +{ + public partial class RuntimeInternal : UserControl, ICommit + { + public RuntimeInternal() + { + InitializeComponent(); + + this.AvatarName.Text = Properties.Settings.Default.AvatarName; + this.AvatarKey.Text = Properties.Settings.Default.AvatarKey; + + this.RegionName.Text = Properties.Settings.Default.RegionName; + this.RegionFPS.Text = Properties.Settings.Default.RegionFPS.ToString(); + + this.XSecondLifeShard.Text = Properties.Settings.Default.XSecondLifeShard; + + this.textBoxParcelName.Text = Properties.Settings.Default.ParcelName; + this.textBoxParcelDescription.Text = Properties.Settings.Default.ParcelDescription; + this.textBoxParcelOwner.Text = Properties.Settings.Default.ParcelOwner; + this.textBoxParcelGroup.Text = Properties.Settings.Default.ParcelGroup; + this.textBoxParcelArea.Text = Properties.Settings.Default.ParcelArea.ToString(); + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + SearchForKey(); + } + + private void SearchForKey() + { + bool Searching = true; + bool XmlVersion = false; + try + { + string[] arName = this.AvatarName.Text.Split(' '); + string strFirst = arName[0].Trim().ToLower(); + string strLast = arName[1].Trim().ToLower(); + string strCachePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\SecondLife\cache\name.cache"; + + StreamReader sr = new StreamReader(strCachePath); + while (Searching) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + if (strLine.Contains("")) + { + XmlVersion = true; + break; + } + strLine = strLine.ToLower(); + if (strLine.IndexOf(strFirst) > 0) + { + if (strLine.IndexOf(strLast) > 0) + { + string strXoredKey = strLine.Split(new char[] { '\t' })[0].Trim(); + Guid g1 = new Guid(strXoredKey); + Guid g2 = Guid.Empty; + byte[] b1 = g1.ToByteArray(); + byte[] b2 = g2.ToByteArray(); + for (int intI = 0; intI < b1.Length; intI++) + b2[intI] = (byte)(b1[intI] ^ 0x33); + g2 = new Guid(b2); + this.AvatarKey.Text = g2.ToString(); + Searching = false; + } + } + } + sr.Close(); + + if (XmlVersion) + { + XmlDocument xmlDocument = new XmlDocument(); + xmlDocument.Load(strCachePath); + // Who has made this key f*cking xml file??? it s*cks bigtime + XmlNode xmlNodeMapFirst = xmlDocument.SelectSingleNode("//map[translate(string[1],'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = '" + strFirst + "']"); + XmlNode xmlNodeMapLast = xmlDocument.SelectSingleNode("//map[translate(string[2],'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = '" + strLast + "']"); + if (xmlNodeMapFirst != null && xmlNodeMapLast != null) + { + if (xmlNodeMapFirst == xmlNodeMapLast) + { + // previous sibbeling key is the key + // Please, please, this meshed up my day, + // USE HIERARCHY PARENT-CHILD NOT SIBLINGS!! + this.AvatarKey.Text = xmlNodeMapFirst.PreviousSibling.InnerText; + Searching = false; + } + } + } + } + catch + { + } + if (Searching) + this.AvatarKey.Text = "Name not found in Cache"; + } + + public void Commit() + { + Properties.Settings.Default.AvatarName = this.AvatarName.Text; + Properties.Settings.Default.AvatarKey = this.AvatarKey.Text; + + Properties.Settings.Default.XSecondLifeShard = this.XSecondLifeShard.Text; + + Properties.Settings.Default.RegionName = this.RegionName.Text; + double dblA; + if(double.TryParse(this.RegionFPS.Text, out dblA)) + Properties.Settings.Default.RegionFPS = dblA; + + Properties.Settings.Default.ParcelName = this.textBoxParcelName.Text; + Properties.Settings.Default.ParcelDescription = this.textBoxParcelDescription.Text; + Properties.Settings.Default.ParcelOwner = this.textBoxParcelOwner.Text; + Properties.Settings.Default.ParcelGroup = this.textBoxParcelGroup.Text; + + int intArea; + if(int.TryParse(this.textBoxParcelArea.Text, out intArea)) + Properties.Settings.Default.ParcelArea = intArea; + else + Properties.Settings.Default.ParcelArea = 512; + } + + } +} diff --git a/Tools/RuntimeInternal.resx b/Tools/RuntimeInternal.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/RuntimeInternal.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/RuntimeSmtp.Designer.cs b/Tools/RuntimeSmtp.Designer.cs new file mode 100644 index 0000000..49a5fe3 --- /dev/null +++ b/Tools/RuntimeSmtp.Designer.cs @@ -0,0 +1,274 @@ +namespace LSLEditor.Tools +{ + partial class RuntimeSmtp + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.radioButton6 = new System.Windows.Forms.RadioButton(); + this.radioButton5 = new System.Windows.Forms.RadioButton(); + this.radioButton4 = new System.Windows.Forms.RadioButton(); + this.label12 = new System.Windows.Forms.Label(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.label11 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.SmtpPassword = new System.Windows.Forms.TextBox(); + this.EmailAddress = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.SmtpUserid = new System.Windows.Forms.TextBox(); + this.EmailServer = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.EmailAddress); + this.groupBox2.Controls.Add(this.EmailServer); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Location = new System.Drawing.Point(0, 0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(392, 80); + this.groupBox2.TabIndex = 7; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Email"; + // + // radioButton6 + // + this.radioButton6.AutoSize = true; + this.radioButton6.Enabled = false; + this.radioButton6.Location = new System.Drawing.Point(256, 96); + this.radioButton6.Name = "radioButton6"; + this.radioButton6.Size = new System.Drawing.Size(80, 17); + this.radioButton6.TabIndex = 19; + this.radioButton6.Text = "Anonymous"; + this.radioButton6.UseVisualStyleBackColor = true; + // + // radioButton5 + // + this.radioButton5.AutoSize = true; + this.radioButton5.Enabled = false; + this.radioButton5.Location = new System.Drawing.Point(192, 96); + this.radioButton5.Name = "radioButton5"; + this.radioButton5.Size = new System.Drawing.Size(63, 17); + this.radioButton5.TabIndex = 18; + this.radioButton5.Text = "External"; + this.radioButton5.UseVisualStyleBackColor = true; + // + // radioButton4 + // + this.radioButton4.AutoSize = true; + this.radioButton4.Enabled = false; + this.radioButton4.Location = new System.Drawing.Point(192, 120); + this.radioButton4.Name = "radioButton4"; + this.radioButton4.Size = new System.Drawing.Size(91, 17); + this.radioButton4.TabIndex = 17; + this.radioButton4.Text = "DIGEST-MD5"; + this.radioButton4.UseVisualStyleBackColor = true; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(24, 96); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(52, 13); + this.label12.TabIndex = 16; + this.label12.Text = "Auth type"; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Enabled = false; + this.radioButton3.Location = new System.Drawing.Point(96, 120); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(82, 17); + this.radioButton3.TabIndex = 15; + this.radioButton3.Text = "CRAM-MD5"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(144, 96); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(51, 17); + this.radioButton2.TabIndex = 14; + this.radioButton2.Text = "Login"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Checked = true; + this.radioButton1.Location = new System.Drawing.Point(96, 96); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(48, 17); + this.radioButton1.TabIndex = 13; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "Plain"; + this.radioButton1.UseVisualStyleBackColor = true; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(24, 24); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(158, 13); + this.label11.TabIndex = 12; + this.label11.Text = "leave blank for normal operation"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(24, 72); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(53, 13); + this.label9.TabIndex = 11; + this.label9.Text = "Password"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(8, 40); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(72, 13); + this.label4.TabIndex = 4; + this.label4.Text = "Email address"; + // + // SmtpPassword + // + this.SmtpPassword.Location = new System.Drawing.Point(104, 72); + this.SmtpPassword.Name = "SmtpPassword"; + this.SmtpPassword.PasswordChar = '*'; + this.SmtpPassword.Size = new System.Drawing.Size(152, 20); + this.SmtpPassword.TabIndex = 10; + // + // EmailAddress + // + this.EmailAddress.Location = new System.Drawing.Point(88, 40); + this.EmailAddress.Name = "EmailAddress"; + this.EmailAddress.Size = new System.Drawing.Size(208, 20); + this.EmailAddress.TabIndex = 3; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(24, 48); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(37, 13); + this.label10.TabIndex = 9; + this.label10.Text = "Userid"; + // + // SmtpUserid + // + this.SmtpUserid.Location = new System.Drawing.Point(104, 48); + this.SmtpUserid.Name = "SmtpUserid"; + this.SmtpUserid.Size = new System.Drawing.Size(152, 20); + this.SmtpUserid.TabIndex = 8; + // + // EmailServer + // + this.EmailServer.Location = new System.Drawing.Point(88, 16); + this.EmailServer.Name = "EmailServer"; + this.EmailServer.Size = new System.Drawing.Size(208, 20); + this.EmailServer.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 16); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(69, 13); + this.label2.TabIndex = 0; + this.label2.Text = "SMTP server"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label11); + this.groupBox1.Controls.Add(this.radioButton6); + this.groupBox1.Controls.Add(this.radioButton1); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Controls.Add(this.radioButton5); + this.groupBox1.Controls.Add(this.radioButton2); + this.groupBox1.Controls.Add(this.SmtpPassword); + this.groupBox1.Controls.Add(this.radioButton4); + this.groupBox1.Controls.Add(this.radioButton3); + this.groupBox1.Controls.Add(this.SmtpUserid); + this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.label12); + this.groupBox1.Location = new System.Drawing.Point(0, 88); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 152); + this.groupBox1.TabIndex = 20; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "SMTP Authentication"; + // + // RuntimeInternal + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBox2); + this.Name = "RuntimeInternal"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox EmailAddress; + private System.Windows.Forms.TextBox EmailServer; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.RadioButton radioButton6; + private System.Windows.Forms.RadioButton radioButton5; + private System.Windows.Forms.RadioButton radioButton4; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox SmtpPassword; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox SmtpUserid; + private System.Windows.Forms.GroupBox groupBox1; + + } +} diff --git a/Tools/RuntimeSmtp.cs b/Tools/RuntimeSmtp.cs new file mode 100644 index 0000000..a973bc1 --- /dev/null +++ b/Tools/RuntimeSmtp.cs @@ -0,0 +1,113 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class RuntimeSmtp : UserControl, ICommit + { + public RuntimeSmtp() + { + InitializeComponent(); + + this.EmailServer.Text = Properties.Settings.Default.EmailServer; + this.EmailAddress.Text = Properties.Settings.Default.EmailAddress; + + this.SmtpUserid.Text = Properties.Settings.Default.SmtpUserid; + this.SmtpPassword.Text = Properties.Settings.Default.SmtpPassword; + + switch (Properties.Settings.Default.SmtpAuth) + { + case "PLAIN": + this.radioButton1.Checked = true; + break; + case "LOGIN": + this.radioButton2.Checked = true; + break; + case "CRAM-MD5": + this.radioButton3.Checked = true; + break; + case "DIGEST-MD5": + this.radioButton4.Checked = true; + break; + case "EXTERNAL": + this.radioButton5.Checked = true; + break; + case "ANONYMOUS": + this.radioButton6.Checked = true; + break; + default: + break; + } + } + + public void Commit() + { + Properties.Settings.Default.EmailServer = this.EmailServer.Text; + Properties.Settings.Default.EmailAddress = this.EmailAddress.Text; + + Properties.Settings.Default.SmtpUserid = this.SmtpUserid.Text; + Properties.Settings.Default.SmtpPassword = this.SmtpPassword.Text; + + if (this.radioButton1.Checked) + Properties.Settings.Default.SmtpAuth = "PLAIN"; + if (this.radioButton2.Checked) + Properties.Settings.Default.SmtpAuth = "LOGIN"; + if (this.radioButton3.Checked) + Properties.Settings.Default.SmtpAuth = "CRAM-MD5"; + if (this.radioButton4.Checked) + Properties.Settings.Default.SmtpAuth = "DIGEST-MD5"; + if (this.radioButton5.Checked) + Properties.Settings.Default.SmtpAuth = "EXTERNAL"; + if (this.radioButton6.Checked) + Properties.Settings.Default.SmtpAuth = "ANONYMOUS"; + + } + } +} diff --git a/Tools/RuntimeSmtp.resx b/Tools/RuntimeSmtp.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/RuntimeSmtp.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/TextEditorCodeCompletion.Designer.cs b/Tools/TextEditorCodeCompletion.Designer.cs new file mode 100644 index 0000000..9b027b3 --- /dev/null +++ b/Tools/TextEditorCodeCompletion.Designer.cs @@ -0,0 +1,113 @@ +namespace LSLEditor.Tools +{ + partial class TextEditorCodeCompletion + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.groupBox4.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.checkBox4); + this.groupBox4.Controls.Add(this.checkBox3); + this.groupBox4.Controls.Add(this.checkBox1); + this.groupBox4.Controls.Add(this.checkBox2); + this.groupBox4.Location = new System.Drawing.Point(0, 0); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(392, 160); + this.groupBox4.TabIndex = 7; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "code completion"; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(16, 88); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(273, 17); + this.checkBox3.TabIndex = 4; + this.checkBox3.Text = "use autocomplete on function arguments (if possible)"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 24); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(208, 17); + this.checkBox1.TabIndex = 1; + this.checkBox1.Text = "use autocomplete on known keywords"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(16, 56); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(328, 17); + this.checkBox2.TabIndex = 3; + this.checkBox2.Text = "use autocomplete on user defined variable names (experimental)"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(16, 120); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(206, 17); + this.checkBox4.TabIndex = 5; + this.checkBox4.Text = "use autocomplete on animation strings"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // TextEditorCodeCompletion + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox4); + this.Name = "TextEditorCodeCompletion"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.CheckBox checkBox4; + } +} diff --git a/Tools/TextEditorCodeCompletion.cs b/Tools/TextEditorCodeCompletion.cs new file mode 100644 index 0000000..b2300ff --- /dev/null +++ b/Tools/TextEditorCodeCompletion.cs @@ -0,0 +1,70 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class TextEditorCodeCompletion : UserControl, ICommit + { + public TextEditorCodeCompletion() + { + InitializeComponent(); + + this.checkBox1.Checked = Properties.Settings.Default.CodeCompletion; + this.checkBox2.Checked = Properties.Settings.Default.CodeCompletionUserVar; + this.checkBox3.Checked = Properties.Settings.Default.CodeCompletionArguments; + this.checkBox4.Checked = Properties.Settings.Default.CodeCompletionAnimation; + } + + public void Commit() + { + Properties.Settings.Default.CodeCompletion = this.checkBox1.Checked; + Properties.Settings.Default.CodeCompletionUserVar = this.checkBox2.Checked; + Properties.Settings.Default.CodeCompletionArguments = this.checkBox3.Checked; + Properties.Settings.Default.CodeCompletionAnimation = this.checkBox4.Checked; + } + + + } +} diff --git a/Tools/TextEditorCodeCompletion.resx b/Tools/TextEditorCodeCompletion.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/TextEditorCodeCompletion.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/TextEditorFontColors.Designer.cs b/Tools/TextEditorFontColors.Designer.cs new file mode 100644 index 0000000..55e261d --- /dev/null +++ b/Tools/TextEditorFontColors.Designer.cs @@ -0,0 +1,165 @@ +namespace LSLEditor.Tools +{ + partial class TextEditorFontColors + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.fontDialog1 = new System.Windows.Forms.FontDialog(); + this.groupBox5.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.label4); + this.groupBox5.Controls.Add(this.label3); + this.groupBox5.Controls.Add(this.label2); + this.groupBox5.Controls.Add(this.label5); + this.groupBox5.Controls.Add(this.button3); + this.groupBox5.Controls.Add(this.button4); + this.groupBox5.Location = new System.Drawing.Point(0, 80); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(392, 80); + this.groupBox5.TabIndex = 12; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "font settings"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(64, 48); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(16, 13); + this.label4.TabIndex = 11; + this.label4.Text = "..."; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(64, 24); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(16, 13); + this.label3.TabIndex = 10; + this.label3.Text = "..."; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 48); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(47, 13); + this.label2.TabIndex = 9; + this.label2.Text = "Tooltips:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(16, 24); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(37, 13); + this.label5.TabIndex = 8; + this.label5.Text = "Editor:"; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(304, 16); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 6; + this.button3.Text = "Change..."; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(304, 48); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 23); + this.button4.TabIndex = 7; + this.button4.Text = "Change..."; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 72); + this.groupBox1.TabIndex = 11; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "colors"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 24); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(142, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.Text = "use original colorscheme"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // EnvironmentFontColors + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox5); + this.Controls.Add(this.groupBox1); + this.Name = "EnvironmentFontColors"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.FontDialog fontDialog1; + } +} diff --git a/Tools/TextEditorFontColors.cs b/Tools/TextEditorFontColors.cs new file mode 100644 index 0000000..2a6c477 --- /dev/null +++ b/Tools/TextEditorFontColors.cs @@ -0,0 +1,125 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class TextEditorFontColors : UserControl, ICommit + { + private Font fontEditor; + private Font fontTooltips; + + public TextEditorFontColors() + { + InitializeComponent(); + + this.checkBox1.Checked = Properties.Settings.Default.SLColorScheme; + + fontEditor = Properties.Settings.Default.FontEditor; + fontTooltips = Properties.Settings.Default.FontTooltips; + + ShowFonts(); + } + + private void ShowFonts() + { + this.label3.Text = string.Format("{0} / {1} / {2}", + fontEditor.Name, + fontEditor.Size, + fontEditor.Style); + + this.label4.Text = string.Format("{0} / {1} / {2}", + fontTooltips.Name, + fontTooltips.Size, + fontTooltips.Style); + } + + private void button3_Click(object sender, EventArgs e) + { + this.fontDialog1.FixedPitchOnly = true; + this.fontDialog1.ShowEffects = false; + this.fontDialog1.AllowScriptChange = false; + this.fontDialog1.Font = Properties.Settings.Default.FontEditor; + try + { + if (this.fontDialog1.ShowDialog(this) == DialogResult.OK) + { + fontEditor = this.fontDialog1.Font; + ShowFonts(); + } + } + catch + { + } + } + + private void button4_Click(object sender, EventArgs e) + { + this.fontDialog1.FixedPitchOnly = false; + this.fontDialog1.ShowEffects = false; + this.fontDialog1.AllowScriptChange = false; + this.fontDialog1.Font = Properties.Settings.Default.FontTooltips; + if (this.fontDialog1.ShowDialog(this) == DialogResult.OK) + { + fontTooltips = this.fontDialog1.Font; + ShowFonts(); + } + } + + public void Commit() + { + Properties.Settings.Default.SLColorScheme = this.checkBox1.Checked; + + Properties.Settings.Default.FontEditor = fontEditor; + Properties.Settings.Default.FontTooltips = fontTooltips; + } + + + } +} diff --git a/Tools/TextEditorFontColors.resx b/Tools/TextEditorFontColors.resx new file mode 100644 index 0000000..6cc62e6 --- /dev/null +++ b/Tools/TextEditorFontColors.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Tools/TextEditorGeneral.Designer.cs b/Tools/TextEditorGeneral.Designer.cs new file mode 100644 index 0000000..7506554 --- /dev/null +++ b/Tools/TextEditorGeneral.Designer.cs @@ -0,0 +1,297 @@ +namespace LSLEditor.Tools +{ + partial class TextEditorGeneral + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox5 = new System.Windows.Forms.CheckBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.radioButton4 = new System.Windows.Forms.RadioButton(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox4 = new System.Windows.Forms.CheckBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.radioButton5 = new System.Windows.Forms.RadioButton(); + this.radioButton6 = new System.Windows.Forms.RadioButton(); + this.radioButton7 = new System.Windows.Forms.RadioButton(); + this.radioButton8 = new System.Windows.Forms.RadioButton(); + this.groupBox4.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.checkBox5); + this.groupBox4.Controls.Add(this.checkBox1); + this.groupBox4.Controls.Add(this.radioButton4); + this.groupBox4.Controls.Add(this.radioButton3); + this.groupBox4.Controls.Add(this.groupBox3); + this.groupBox4.Location = new System.Drawing.Point(0, 0); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(392, 136); + this.groupBox4.TabIndex = 7; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "indenting"; + // + // checkBox5 + // + this.checkBox5.AutoSize = true; + this.checkBox5.Location = new System.Drawing.Point(16, 96); + this.checkBox5.Name = "checkBox5"; + this.checkBox5.Size = new System.Drawing.Size(180, 17); + this.checkBox5.TabIndex = 8; + this.checkBox5.Text = "autocorrect indent on file loading"; + this.checkBox5.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 64); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(191, 17); + this.checkBox1.TabIndex = 7; + this.checkBox1.Text = "warning on different indent scheme"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // radioButton4 + // + this.radioButton4.AutoSize = true; + this.radioButton4.Location = new System.Drawing.Point(80, 24); + this.radioButton4.Name = "radioButton4"; + this.radioButton4.Size = new System.Drawing.Size(90, 17); + this.radioButton4.TabIndex = 6; + this.radioButton4.TabStop = true; + this.radioButton4.Text = "4 spaces (SL)"; + this.radioButton4.UseVisualStyleBackColor = true; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Location = new System.Drawing.Point(16, 24); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(49, 17); + this.radioButton3.TabIndex = 5; + this.radioButton3.TabStop = true; + this.radioButton3.Text = "Tabs"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.checkBox2); + this.groupBox3.Controls.Add(this.radioButton2); + this.groupBox3.Controls.Add(this.radioButton1); + this.groupBox3.Location = new System.Drawing.Point(232, 16); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(144, 100); + this.groupBox3.TabIndex = 4; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "autoindent when typing"; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(8, 24); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(110, 17); + this.checkBox2.TabIndex = 3; + this.checkBox2.Text = "use autoindenting"; + this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(8, 72); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(128, 17); + this.radioButton2.TabIndex = 0; + this.radioButton2.Text = "cursor placement only"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(8, 48); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(94, 17); + this.radioButton1.TabIndex = 1; + this.radioButton1.Text = "full auto indent"; + this.radioButton1.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.checkBox3); + this.groupBox2.Location = new System.Drawing.Point(200, 144); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(192, 56); + this.groupBox2.TabIndex = 8; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "default editor options"; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(16, 24); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(156, 17); + this.checkBox3.TabIndex = 2; + this.checkBox3.Text = "Auto word selection (is bad)"; + this.checkBox3.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox4); + this.groupBox1.Location = new System.Drawing.Point(200, 216); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(192, 56); + this.groupBox1.TabIndex = 9; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "file extension association"; + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(16, 24); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(146, 17); + this.checkBox4.TabIndex = 0; + this.checkBox4.Text = "register .lsl with LSLEditor"; + this.checkBox4.UseVisualStyleBackColor = true; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.radioButton8); + this.groupBox5.Controls.Add(this.radioButton7); + this.groupBox5.Controls.Add(this.radioButton6); + this.groupBox5.Controls.Add(this.radioButton5); + this.groupBox5.Location = new System.Drawing.Point(0, 144); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(184, 128); + this.groupBox5.TabIndex = 10; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "output format"; + // + // radioButton5 + // + this.radioButton5.AutoSize = true; + this.radioButton5.Location = new System.Drawing.Point(16, 24); + this.radioButton5.Name = "radioButton5"; + this.radioButton5.Size = new System.Drawing.Size(50, 17); + this.radioButton5.TabIndex = 0; + this.radioButton5.TabStop = true; + this.radioButton5.Text = "ANSI"; + this.radioButton5.UseVisualStyleBackColor = true; + // + // radioButton6 + // + this.radioButton6.AutoSize = true; + this.radioButton6.Location = new System.Drawing.Point(16, 48); + this.radioButton6.Name = "radioButton6"; + this.radioButton6.Size = new System.Drawing.Size(65, 17); + this.radioButton6.TabIndex = 1; + this.radioButton6.TabStop = true; + this.radioButton6.Text = "Unicode"; + this.radioButton6.UseVisualStyleBackColor = true; + // + // radioButton7 + // + this.radioButton7.AutoSize = true; + this.radioButton7.Location = new System.Drawing.Point(16, 72); + this.radioButton7.Name = "radioButton7"; + this.radioButton7.Size = new System.Drawing.Size(117, 17); + this.radioButton7.TabIndex = 2; + this.radioButton7.TabStop = true; + this.radioButton7.Text = "Unicode big endian"; + this.radioButton7.UseVisualStyleBackColor = true; + // + // radioButton8 + // + this.radioButton8.AutoSize = true; + this.radioButton8.Location = new System.Drawing.Point(16, 96); + this.radioButton8.Name = "radioButton8"; + this.radioButton8.Size = new System.Drawing.Size(55, 17); + this.radioButton8.TabIndex = 3; + this.radioButton8.TabStop = true; + this.radioButton8.Text = "UTF-8"; + this.radioButton8.UseVisualStyleBackColor = true; + // + // TextEditorGeneral + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox5); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox4); + this.Name = "TextEditorGeneral"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.RadioButton radioButton1; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox checkBox4; + private System.Windows.Forms.CheckBox checkBox5; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.RadioButton radioButton4; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.RadioButton radioButton8; + private System.Windows.Forms.RadioButton radioButton7; + private System.Windows.Forms.RadioButton radioButton6; + private System.Windows.Forms.RadioButton radioButton5; + } +} diff --git a/Tools/TextEditorGeneral.cs b/Tools/TextEditorGeneral.cs new file mode 100644 index 0000000..f9742bd --- /dev/null +++ b/Tools/TextEditorGeneral.cs @@ -0,0 +1,137 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Reflection; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class TextEditorGeneral : UserControl, ICommit + { + public TextEditorGeneral() + { + InitializeComponent(); + + this.checkBox1.Checked = Properties.Settings.Default.IndentWarning; + + this.checkBox2.Checked = Properties.Settings.Default.Indent; + checkBox2_CheckedChanged(null, null); + + this.radioButton1.Checked = Properties.Settings.Default.IndentFullAuto; + this.radioButton2.Checked = Properties.Settings.Default.IndentCursorPlacement; + + this.radioButton3.Checked = !Properties.Settings.Default.SL4SpacesIndent; + this.radioButton4.Checked = Properties.Settings.Default.SL4SpacesIndent; + + this.checkBox3.Checked = Properties.Settings.Default.AutoWordSelection; + + this.checkBox4.Checked = Helpers.FileAssociator.IsAssociated(".lsl"); + + this.checkBox5.Checked = Properties.Settings.Default.IndentAutoCorrect; + + + switch(Properties.Settings.Default.OutputFormat) + { + case "Unicode": + this.radioButton6.Checked = true; + break; + case "BigEndianUnicode": + this.radioButton7.Checked = true; + break; + case "UTF8": + this.radioButton8.Checked = true; + break; + default: // ANSI + this.radioButton5.Checked = true; + break; + } + } + + public void Commit() + { + Properties.Settings.Default.IndentWarning = this.checkBox1.Checked; + Properties.Settings.Default.Indent = this.checkBox2.Checked; + Properties.Settings.Default.AutoWordSelection = this.checkBox3.Checked; + Properties.Settings.Default.SL4SpacesIndent = this.radioButton4.Checked; + Properties.Settings.Default.IndentAutoCorrect = this.checkBox5.Checked; + Properties.Settings.Default.IndentFullAuto = this.radioButton1.Checked; + Properties.Settings.Default.IndentCursorPlacement = this.radioButton2.Checked; + + if (this.radioButton5.Checked) + Properties.Settings.Default.OutputFormat = "ANSI"; + else if (this.radioButton6.Checked) + Properties.Settings.Default.OutputFormat = "Unicode"; + else if (this.radioButton7.Checked) + Properties.Settings.Default.OutputFormat = "BigEndianUnicode"; + else if (this.radioButton8.Checked) + Properties.Settings.Default.OutputFormat = "UTF8"; + + if (this.checkBox4.Checked) + { + if(! + Helpers.FileAssociator.Associate(".lsl", "LSLEditorScript", "SecondLife script file for LSLEditor", Assembly.GetExecutingAssembly().Location, 0)) + MessageBox.Show("File association can not be made (needs administrative access)", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + + } + else + { + if (Helpers.FileAssociator.IsAssociated(".lsl")) + { + if(!Helpers.FileAssociator.DeAssociate(".lsl", "LSLEditorScript")) + MessageBox.Show("File association can not be unmade (needs administrative access)", "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void checkBox2_CheckedChanged(object sender, EventArgs e) + { + this.radioButton1.Enabled = this.checkBox2.Checked; + this.radioButton2.Enabled = this.checkBox2.Checked; + } + + } +} diff --git a/Tools/TextEditorGeneral.resx b/Tools/TextEditorGeneral.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/TextEditorGeneral.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/ToolsOptions.Designer.cs b/Tools/ToolsOptions.Designer.cs new file mode 100644 index 0000000..19a5335 --- /dev/null +++ b/Tools/ToolsOptions.Designer.cs @@ -0,0 +1,153 @@ +namespace LSLEditor.Tools +{ + partial class ToolsOptions + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panelBottom = new System.Windows.Forms.Panel(); + this.button3 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.panelLeft = new System.Windows.Forms.Panel(); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.label1 = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panelBottom.SuspendLayout(); + this.panelLeft.SuspendLayout(); + this.SuspendLayout(); + // + // panelBottom + // + this.panelBottom.Controls.Add(this.button3); + this.panelBottom.Controls.Add(this.button2); + this.panelBottom.Controls.Add(this.button1); + this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panelBottom.Location = new System.Drawing.Point(0, 296); + this.panelBottom.Name = "panelBottom"; + this.panelBottom.Size = new System.Drawing.Size(637, 45); + this.panelBottom.TabIndex = 0; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(16, 8); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 2; + this.button3.Text = "Reset all"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(552, 8); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(464, 8); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Ok"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // panelLeft + // + this.panelLeft.Controls.Add(this.treeView1); + this.panelLeft.Dock = System.Windows.Forms.DockStyle.Left; + this.panelLeft.Location = new System.Drawing.Point(0, 0); + this.panelLeft.Name = "panelLeft"; + this.panelLeft.Padding = new System.Windows.Forms.Padding(6); + this.panelLeft.Size = new System.Drawing.Size(224, 296); + this.panelLeft.TabIndex = 1; + // + // treeView1 + // + this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeView1.HideSelection = false; + this.treeView1.Location = new System.Drawing.Point(6, 6); + this.treeView1.Name = "treeView1"; + this.treeView1.Size = new System.Drawing.Size(212, 284); + this.treeView1.TabIndex = 0; + this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); + // + // label1 + // + this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.label1.Location = new System.Drawing.Point(224, 288); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(408, 2); + this.label1.TabIndex = 2; + // + // panel1 + // + this.panel1.Location = new System.Drawing.Point(232, 8); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(392, 272); + this.panel1.TabIndex = 3; + // + // ToolsOptions + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(637, 341); + this.Controls.Add(this.panel1); + this.Controls.Add(this.label1); + this.Controls.Add(this.panelLeft); + this.Controls.Add(this.panelBottom); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ToolsOptions"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "LSLEditor - Tools - Options"; + this.Load += new System.EventHandler(this.ToolsOptions_Load); + this.panelBottom.ResumeLayout(false); + this.panelLeft.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panelBottom; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Panel panelLeft; + private System.Windows.Forms.TreeView treeView1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button button3; + } +} \ No newline at end of file diff --git a/Tools/ToolsOptions.cs b/Tools/ToolsOptions.cs new file mode 100644 index 0000000..448b819 --- /dev/null +++ b/Tools/ToolsOptions.cs @@ -0,0 +1,162 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Reflection; +using System.ComponentModel; +using System.Drawing; +using System.Xml; +using System.IO; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class ToolsOptions : Form + { + public delegate void PropertiesChangedHandler(); + public event PropertiesChangedHandler PropertiesChanged; + + public ToolsOptions() + { + InitializeComponent(); + + LoadTreeView(); + } + + private XmlDocument GetXmlFromResource(string strName) + { + XmlDocument xml = new XmlDocument(); + Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("LSLEditor." + strName); + + if (resource != null) + xml.Load(resource); + return xml; + } + + private void LoadTreeView() + { + XmlDocument xml = GetXmlFromResource(Properties.Settings.Default.ToolsOptions); + RecursiveLoad(this.treeView1.Nodes, xml.SelectSingleNode("/root")); + } + + private void RecursiveLoad(TreeNodeCollection nodes, XmlNode xmlParentNode) + { + foreach (XmlNode xmlNode in xmlParentNode.SelectNodes("./*")) + { + string strName = xmlNode.Attributes["name"].Value; + string strUserControl = xmlNode.Attributes["usercontrol"].Value; + TreeNode tn = new TreeNode(strName, 0, 0); + tn.Tag = strUserControl; + nodes.Add(tn); + RecursiveLoad(tn.Nodes, xmlNode); + } + } + + private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) + { + string strUserControl = "LSLEditor.Tools." + e.Node.Tag.ToString(); + bool blnFound = false; + foreach (Control control in this.panel1.Controls) + { + control.Visible = (strUserControl == control.ToString()); + if (control.Visible) + blnFound = true; + } + if (blnFound) + return; + //create control and add to panel1 + Control newControl = Assembly.GetExecutingAssembly().CreateInstance(strUserControl) as Control; + if (newControl != null) + { + this.panel1.Controls.Add(newControl); + } + } + + private void button2_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + // ok + foreach (Control control in this.panel1.Controls) + { + ((ICommit)control).Commit(); + } + + // save properties + Properties.Settings.Default.Save(); + + // notify parent + if (PropertiesChanged != null) + PropertiesChanged(); + + this.Close(); + } + + private void button3_Click(object sender, EventArgs e) + { + if (MessageBox.Show("Reset all properties?", "Reset properties", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) + { + this.panel1.Controls.Clear(); + + Properties.Settings.Default.Reset(); + Properties.Settings.Default.CallUpgrade = false; + + if (Properties.Settings.Default.FontEditor == null) + Properties.Settings.Default.FontEditor = new Font("Courier New", 9.75F, FontStyle.Regular); + + if (Properties.Settings.Default.FontTooltips == null) + Properties.Settings.Default.FontTooltips = new Font(SystemFonts.MessageBoxFont.Name, 9.75F, FontStyle.Regular); + } + } + + private void ToolsOptions_Load(object sender, EventArgs e) + { + this.treeView1.ExpandAll(); + this.treeView1.SelectedNode = this.treeView1.Nodes[0]; + this.treeView1.Focus(); + } + } +} \ No newline at end of file diff --git a/Tools/ToolsOptions.resx b/Tools/ToolsOptions.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/Tools/ToolsOptions.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tools/VersionControlGeneral.Designer.cs b/Tools/VersionControlGeneral.Designer.cs new file mode 100644 index 0000000..ce7ee1b --- /dev/null +++ b/Tools/VersionControlGeneral.Designer.cs @@ -0,0 +1,160 @@ +namespace LSLEditor.Tools +{ + partial class VersionControlGeneral + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.button3 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox3); + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Controls.Add(this.button3); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(392, 168); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "version control"; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(80, 128); + this.textBox3.Name = "textBox3"; + this.textBox3.PasswordChar = '*'; + this.textBox3.Size = new System.Drawing.Size(104, 20); + this.textBox3.TabIndex = 11; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(80, 104); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(104, 20); + this.textBox2.TabIndex = 10; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(16, 128); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(53, 13); + this.label3.TabIndex = 9; + this.label3.Text = "Password"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 104); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(37, 13); + this.label2.TabIndex = 8; + this.label2.Text = "Userid"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(16, 32); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(132, 17); + this.checkBox1.TabIndex = 7; + this.checkBox1.Text = "Use Subversion (SVN)"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(304, 64); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 3; + this.button3.Text = "browse..."; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(80, 64); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(216, 20); + this.textBox1.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 64); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(53, 13); + this.label1.TabIndex = 2; + this.label1.Text = "SVN-EXE"; + // + // VersionControlGeneral + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Name = "VersionControlGeneral"; + this.Size = new System.Drawing.Size(392, 272); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + } +} diff --git a/Tools/VersionControlGeneral.cs b/Tools/VersionControlGeneral.cs new file mode 100644 index 0000000..c0cadb3 --- /dev/null +++ b/Tools/VersionControlGeneral.cs @@ -0,0 +1,93 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Windows.Forms; + +namespace LSLEditor.Tools +{ + public partial class VersionControlGeneral : UserControl, ICommit + { + public VersionControlGeneral() + { + InitializeComponent(); + + this.groupBox1.Enabled = Properties.Settings.Default.VersionControl; + + this.checkBox1.Checked = Properties.Settings.Default.VersionControlSVN; + this.checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged); + checkBox1_CheckedChanged(null, null); + this.textBox1.Text = Properties.Settings.Default.SvnExe; + this.textBox2.Text = Properties.Settings.Default.SvnUserid; + this.textBox3.Text = Properties.Settings.Default.SvnPassword; + } + + private void checkBox1_CheckedChanged(object sender, EventArgs e) + { + this.textBox1.Enabled = this.checkBox1.Checked; + } + + public void Commit() + { + Properties.Settings.Default.SvnExe = this.textBox1.Text; + Properties.Settings.Default.SvnUserid = this.textBox2.Text; + Properties.Settings.Default.SvnPassword = this.textBox3.Text; + + Properties.Settings.Default.VersionControlSVN = this.checkBox1.Checked; + } + + + private void button3_Click(object sender, EventArgs e) + { + this.openFileDialog1.FileName = "svn.exe"; + this.openFileDialog1.Filter = "Executables (*.exe)|*.exe|All files (*.*)|*.*"; + if (this.openFileDialog1.ShowDialog(this) == DialogResult.OK) + { + if (File.Exists(this.openFileDialog1.FileName)) + this.textBox1.Text = this.openFileDialog1.FileName; + } + } + + } +} diff --git a/Tools/VersionControlGeneral.resx b/Tools/VersionControlGeneral.resx new file mode 100644 index 0000000..8dc6b17 --- /dev/null +++ b/Tools/VersionControlGeneral.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/UpdateApplicationForm.Designer.cs b/UpdateApplicationForm.Designer.cs new file mode 100644 index 0000000..26f13b9 --- /dev/null +++ b/UpdateApplicationForm.Designer.cs @@ -0,0 +1,173 @@ +namespace LSLEditor +{ + partial class UpdateApplicationForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.progressBar1); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(8, 8); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(216, 128); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "version information"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(104, 72); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(0, 13); + this.label6.TabIndex = 6; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(16, 72); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(48, 13); + this.label5.TabIndex = 5; + this.label5.Text = "Help file:"; + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(16, 96); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(184, 15); + this.progressBar1.TabIndex = 4; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(104, 48); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(0, 13); + this.label4.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(104, 24); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(0, 13); + this.label3.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 48); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(81, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Current version:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Your version:"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(48, 144); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Update"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(136, 144); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 2; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // UpdateApplicationForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(234, 177); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "UpdateApplicationForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Update LSLEditor"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdateApplicationForm_FormClosing); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + } +} \ No newline at end of file diff --git a/UpdateApplicationForm.cs b/UpdateApplicationForm.cs new file mode 100644 index 0000000..a7dafa4 --- /dev/null +++ b/UpdateApplicationForm.cs @@ -0,0 +1,448 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.IO; +using System.Net; +using System.Reflection; +using System.ComponentModel; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class UpdateApplicationForm : Form + { + private WebClient manifest; + private WebClient client; + + private string strHashNew; + private string strDownloadUrl; + + private string strHelpHashNew; + private string strHelpUrl; + private string strHelpReferer; + + private bool blnOnlyHelpFile; + + public UpdateApplicationForm() + { + InitializeComponent(); + this.strHashNew = ""; + this.strHelpHashNew = ""; + this.strDownloadUrl = null; + this.strHelpUrl = null; + this.strHelpReferer = null; + this.button1.Enabled = false; + this.blnOnlyHelpFile = false; + } + + public event EventHandler OnUpdateAvailable; + + private void StartDownloadinManifest() + { + Uri url; + string strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + if (Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location).Contains("beta")) + url = new Uri(Properties.Settings.Default.UpdateManifest + "?beta-" + strVersion); + else + url = new Uri(Properties.Settings.Default.UpdateManifest + "?" + strVersion); + + manifest = new WebClient(); + manifest.DownloadStringCompleted += new DownloadStringCompletedEventHandler(manifest_DownloadCompleted); + manifest.DownloadStringAsync(url); + } + + public void CheckForHelpFile() + { + this.blnOnlyHelpFile = true; + StartDownloadinManifest(); + } + + public void CheckForUpdate(bool blnForce) + { + if (!blnForce) + { + if (Properties.Settings.Default.DeleteOldFiles) + DeleteOldFile(); + + DateTime dateTime = Properties.Settings.Default.CheckDate; + if (Properties.Settings.Default.CheckEveryDay) + { + TimeSpan lastUpdate = DateTime.Now - dateTime; + if (lastUpdate.TotalDays >= 1.0) + blnForce = true; + } + else if (Properties.Settings.Default.CheckEveryWeek) + { + TimeSpan lastUpdate = DateTime.Now - dateTime; + if(lastUpdate.TotalDays >= 7.0) + blnForce = true; + } + } + + if (blnForce) + { + Properties.Settings.Default.CheckDate = DateTime.Now; + Properties.Settings.Default.Save(); // save also al settings + + StartDownloadinManifest(); + } + } + + void manifest_DownloadCompleted(object sender, DownloadStringCompletedEventArgs e) + { + if (e.Error != null) + return; + + string strHashOld = Decompressor.MD5Verify.ComputeHash(Assembly.GetExecutingAssembly().Location); + string strVersionOld = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + string strVersionNew = strVersionOld; + + string strHelpHashOld = ""; + string strHelpFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.HelpOfflineFile); + if (File.Exists(strHelpFile)) + { + strHelpHashOld = Decompressor.MD5Verify.ComputeHash(strHelpFile); + } + else + { + // help file does not exist + if (Properties.Settings.Default.HelpOffline || blnOnlyHelpFile) + { + strHelpHashOld = "*"; // force new update + } + else + { + strHelpHashOld = ""; // no update + this.label5.Visible = false; + this.label6.Visible = false; + } + } + + strHashNew = strHashOld; + StringReader sr = new StringReader(e.Result); + for (int intI = 0; intI < 255; intI++) + { + string strLine = sr.ReadLine(); + if (strLine == null) + break; + int intSplit = strLine.IndexOf("="); + if (intSplit < 0) + continue; + string strName = strLine.Substring(0, intSplit); + string strValue = strLine.Substring(intSplit + 1); + switch (strName) + { + case "Version": + strVersionNew = strValue; + break; + case "Hash": + strHashNew = strValue; + break; + case "Url": + strDownloadUrl = strValue; + break; + + case "GZipVersion": + strVersionNew = strValue; + break; + case "GZipHash": + strHashNew = strValue; + break; + case "GZipUrl": + strDownloadUrl = strValue; + break; + + case "ZipVersion": + strVersionNew = strValue; + break; + case "ZipHash": + strHashNew = strValue; + break; + case "ZipUrl": + strDownloadUrl = strValue; + break; + + case "HelpHash": + strHelpHashNew = strValue; + break; + case "HelpUrl2": + strHelpUrl = strValue; + break; + case "HelpReferer": + strHelpReferer = strValue; + break; + + default: + break; + } + } + + this.label3.Text = strVersionOld; + this.label4.Text = strVersionNew; + + if (strHelpHashOld == "") + strHelpHashOld = strHelpHashNew; + + if (strHelpHashOld == strHelpHashNew) + { + this.label6.Text = "Up to date"; + this.strHelpUrl = null; + } + else + { + this.label6.Text = "Out of date"; + } + + if (strHashOld == strHashNew) + { + this.strDownloadUrl = null; + } + + if (this.blnOnlyHelpFile) + { + this.strDownloadUrl = null; + this.label2.Visible = false; + this.label4.Visible = false; + } + + if (this.strHelpUrl != null || this.strDownloadUrl != null) + { + this.button1.Enabled = true; + + if (OnUpdateAvailable != null) + OnUpdateAvailable(this, null); + } + } + + private void button2_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + this.button1.Enabled = false; + Download(); + } + + private void Download() + { + if (strHelpUrl != null) + DownloadHelpFile(); // starts also DownloadProgram when finished + else + DownloadProgram(); + } + + private void DownloadHelpFile() + { + if (strHelpUrl == null) + return; + + Uri url = new Uri(strHelpUrl); + + client = new WebClient(); + + if(this.strHelpReferer != null) + client.Headers.Add("Referer", strHelpReferer); + + client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadHelpFileCompleted); + client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); + + string strCurrentFile = Assembly.GetExecutingAssembly().Location; + string strDirectory = Path.GetDirectoryName(strCurrentFile); + string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile); + + if (File.Exists(strNewFile)) + File.Delete(strNewFile); + + client.DownloadFileAsync(url, strNewFile); + } + + void client_DownloadHelpFileCompleted(object sender, AsyncCompletedEventArgs e) + { + try + { + if (e.Error != null) + throw e.Error; + + string strCurrentFile = Assembly.GetExecutingAssembly().Location; + string strDirectory = Path.GetDirectoryName(strCurrentFile); + string strNewFile = Path.Combine(strDirectory, Properties.Settings.Default.HelpOfflineFile); + + string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile); + if (strComputedHash != strHelpHashNew) + { + this.button1.Enabled = true; + throw new Exception("MD5 Hash of HelpFile not correct, try downloading again!"); + } + if (this.strDownloadUrl != null) + DownloadProgram(); + else + this.Close(); + } + catch (Exception exception) + { + MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void DownloadProgram() + { + if (strDownloadUrl == null) + return; + + Uri url = new Uri(strDownloadUrl); + + client = new WebClient(); + client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); + client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); + + string strCurrentFile = Assembly.GetExecutingAssembly().Location; + string strDirectory = Path.GetDirectoryName(strCurrentFile); + string strNewFileName = Path.GetFileName(strDownloadUrl); + string strNewFile = Path.Combine(strDirectory, strNewFileName); + + if (File.Exists(strNewFile)) + File.Delete(strNewFile); + + client.DownloadFileAsync(url, strNewFile, strNewFileName); + } + + void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) + { + this.progressBar1.Value = e.ProgressPercentage; + } + + void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) + { + try + { + if (e.Error != null) + throw e.Error; + + string strNewFileName = e.UserState.ToString(); + + string strCurrentFile = Assembly.GetExecutingAssembly().Location; + string strDirectory = Path.GetDirectoryName(strCurrentFile); + string strZipFile = Path.Combine(strDirectory, strNewFileName); + string strNewFile = Path.Combine(strDirectory, "LSLEditor.exe.new"); + + string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe"); + + string strExtension = Path.GetExtension(strNewFileName); + switch (strExtension) + { + case ".bz2": + //BZip2Decompress.Decompressor.Decompress(File.OpenRead(strZipFile), File.Create(strNewFile)); + break; + case ".gz": + case ".gzip": + Decompressor.Gzip.Decompress(File.OpenRead(strZipFile), File.Create(strNewFile)); + break; + case ".zip": + Decompressor.Zip.Decompress(File.OpenRead(strZipFile), File.Create(strNewFile)); + break; + default: + break; + } + string strComputedHash = Decompressor.MD5Verify.ComputeHash(strNewFile); + if (strComputedHash == strHashNew) + { + if (File.Exists(strOldFile)) + File.Delete(strOldFile); + + File.Move(strCurrentFile, strOldFile); + File.Move(strNewFile, strCurrentFile); + + if (File.Exists(strZipFile)) + File.Delete(strZipFile); + + // save all there is pending (if any) + Properties.Settings.Default.Save(); + + System.Diagnostics.Process.Start(strCurrentFile); + + Environment.Exit(0); + } + else + { + this.button1.Enabled = true; + throw new Exception("MD5 Hash not correct, try downloading again!"); + } + } + catch (Exception exception) + { + MessageBox.Show(exception.Message, "Oops...", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void UpdateApplicationForm_FormClosing(object sender, FormClosingEventArgs e) + { + if (client != null) + { + if (client.IsBusy) + client.CancelAsync(); + client.Dispose(); + } + client = null; + if (manifest != null) + { + if (manifest.IsBusy) + manifest.CancelAsync(); + manifest.Dispose(); + } + manifest = null; + } + + private void DeleteOldFile() + { + string strCurrentFile = Assembly.GetExecutingAssembly().Location; + string strDirectory = Path.GetDirectoryName(strCurrentFile); + string strOldFile = Path.Combine(strDirectory, "_LSLEditor.exe"); + if (File.Exists(strOldFile)) + File.Delete(strOldFile); + } + + } +} \ No newline at end of file diff --git a/UpdateApplicationForm.resx b/UpdateApplicationForm.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/UpdateApplicationForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Web References/org.lsleditor.www/Reference.cs b/Web References/org.lsleditor.www/Reference.cs new file mode 100644 index 0000000..2ee82f5 --- /dev/null +++ b/Web References/org.lsleditor.www/Reference.cs @@ -0,0 +1,364 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +#pragma warning disable 1591 + +namespace LSLEditor.org.lsleditor.www { + using System.Diagnostics; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Xml.Serialization; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap", Namespace="http://tempuri.org/")] + public partial class Service1 : System.Web.Services.Protocols.SoapHttpClientProtocol { + + private System.Threading.SendOrPostCallback OpenOperationCompleted; + + private System.Threading.SendOrPostCallback GetStatusOperationCompleted; + + private System.Threading.SendOrPostCallback GetBugReportOperationCompleted; + + private System.Threading.SendOrPostCallback WriteOperationCompleted; + + private bool useDefaultCredentialsSetExplicitly; + + /// + public Service1() { + this.Url = "http://www.lsleditor.org/UploadBugReport/Service1.asmx"; + if ((this.IsLocalFileSystemWebService(this.Url) == true)) { + this.UseDefaultCredentials = true; + this.useDefaultCredentialsSetExplicitly = false; + } + else { + this.useDefaultCredentialsSetExplicitly = true; + } + } + + public new string Url { + get { + return base.Url; + } + set { + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) + && (this.IsLocalFileSystemWebService(value) == false))) { + base.UseDefaultCredentials = false; + } + base.Url = value; + } + } + + public new bool UseDefaultCredentials { + get { + return base.UseDefaultCredentials; + } + set { + base.UseDefaultCredentials = value; + this.useDefaultCredentialsSetExplicitly = true; + } + } + + /// + public event OpenCompletedEventHandler OpenCompleted; + + /// + public event GetStatusCompletedEventHandler GetStatusCompleted; + + /// + public event GetBugReportCompletedEventHandler GetBugReportCompleted; + + /// + public event WriteCompletedEventHandler WriteCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Open", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Open() { + object[] results = this.Invoke("Open", new object[0]); + return ((string)(results[0])); + } + + /// + public void OpenAsync() { + this.OpenAsync(null); + } + + /// + public void OpenAsync(object userState) { + if ((this.OpenOperationCompleted == null)) { + this.OpenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnOpenOperationCompleted); + } + this.InvokeAsync("Open", new object[0], this.OpenOperationCompleted, userState); + } + + private void OnOpenOperationCompleted(object arg) { + if ((this.OpenCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.OpenCompleted(this, new OpenCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetStatus", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetStatus(string Handle) { + object[] results = this.Invoke("GetStatus", new object[] { + Handle}); + return ((string)(results[0])); + } + + /// + public void GetStatusAsync(string Handle) { + this.GetStatusAsync(Handle, null); + } + + /// + public void GetStatusAsync(string Handle, object userState) { + if ((this.GetStatusOperationCompleted == null)) { + this.GetStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetStatusOperationCompleted); + } + this.InvokeAsync("GetStatus", new object[] { + Handle}, this.GetStatusOperationCompleted, userState); + } + + private void OnGetStatusOperationCompleted(object arg) { + if ((this.GetStatusCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetStatusCompleted(this, new GetStatusCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetBugReport", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetBugReport(string Handle) { + object[] results = this.Invoke("GetBugReport", new object[] { + Handle}); + return ((string)(results[0])); + } + + /// + public void GetBugReportAsync(string Handle) { + this.GetBugReportAsync(Handle, null); + } + + /// + public void GetBugReportAsync(string Handle, object userState) { + if ((this.GetBugReportOperationCompleted == null)) { + this.GetBugReportOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetBugReportOperationCompleted); + } + this.InvokeAsync("GetBugReport", new object[] { + Handle}, this.GetBugReportOperationCompleted, userState); + } + + private void OnGetBugReportOperationCompleted(object arg) { + if ((this.GetBugReportCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetBugReportCompleted(this, new GetBugReportCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/Write", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string Write(string Handle, string FileName, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] buffer, int intLength) { + object[] results = this.Invoke("Write", new object[] { + Handle, + FileName, + buffer, + intLength}); + return ((string)(results[0])); + } + + /// + public void WriteAsync(string Handle, string FileName, byte[] buffer, int intLength) { + this.WriteAsync(Handle, FileName, buffer, intLength, null); + } + + /// + public void WriteAsync(string Handle, string FileName, byte[] buffer, int intLength, object userState) { + if ((this.WriteOperationCompleted == null)) { + this.WriteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteOperationCompleted); + } + this.InvokeAsync("Write", new object[] { + Handle, + FileName, + buffer, + intLength}, this.WriteOperationCompleted, userState); + } + + private void OnWriteOperationCompleted(object arg) { + if ((this.WriteCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WriteCompleted(this, new WriteCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + + private bool IsLocalFileSystemWebService(string url) { + if (((url == null) + || (url == string.Empty))) { + return false; + } + System.Uri wsUri = new System.Uri(url); + if (((wsUri.Port >= 1024) + && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { + return true; + } + return false; + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + public delegate void OpenCompletedEventHandler(object sender, OpenCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class OpenCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal OpenCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + public delegate void GetStatusCompletedEventHandler(object sender, GetStatusCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetStatusCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + public delegate void GetBugReportCompletedEventHandler(object sender, GetBugReportCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetBugReportCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetBugReportCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + public delegate void WriteCompletedEventHandler(object sender, WriteCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class WriteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal WriteCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } +} + +#pragma warning restore 1591 \ No newline at end of file diff --git a/Web References/org.lsleditor.www/Reference.map b/Web References/org.lsleditor.www/Reference.map new file mode 100644 index 0000000..7f86c16 --- /dev/null +++ b/Web References/org.lsleditor.www/Reference.map @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Web References/org.lsleditor.www/Service1.disco b/Web References/org.lsleditor.www/Service1.disco new file mode 100644 index 0000000..9f967d0 --- /dev/null +++ b/Web References/org.lsleditor.www/Service1.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Web References/org.lsleditor.www/Service1.wsdl b/Web References/org.lsleditor.www/Service1.wsdl new file mode 100644 index 0000000..de4a410 --- /dev/null +++ b/Web References/org.lsleditor.www/Service1.wsdl @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_MakeRelease.cmd b/_MakeRelease.cmd new file mode 100644 index 0000000..7e14e2f --- /dev/null +++ b/_MakeRelease.cmd @@ -0,0 +1,12 @@ +REM cd "C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\bin\Debug" +cd "bin\Debug" + +del d:\temp\LsLEditor.zip +del d:\temp\LsLEditor.exe.bz2 +del d:\temp\LsLEditor.exe.gz + +"c:\Program Files\7-Zip\7z" a -tzip d:\temp\LsLEditor.zip LsLEditor.exe +"c:\Program Files\7-Zip\7z" a -tbzip2 d:\temp\LsLEditor.exe.bz2 LsLEditor.exe +"c:\Program Files\7-Zip\7z" a -tgzip d:\temp\LsLEditor.exe.gz LsLEditor.exe + +pause diff --git a/_ReSharper.lsleditor/BuildScriptCache/.crc b/_ReSharper.lsleditor/BuildScriptCache/.crc new file mode 100644 index 0000000..27c8f6d --- /dev/null +++ b/_ReSharper.lsleditor/BuildScriptCache/.crc @@ -0,0 +1 @@ +ó¨û \ No newline at end of file diff --git a/_ReSharper.lsleditor/BuildScriptCache/.version b/_ReSharper.lsleditor/BuildScriptCache/.version new file mode 100644 index 0000000..2cf9f20 Binary files /dev/null and b/_ReSharper.lsleditor/BuildScriptCache/.version differ diff --git a/_ReSharper.lsleditor/BuildScriptCache/5/4680b305.dat b/_ReSharper.lsleditor/BuildScriptCache/5/4680b305.dat new file mode 100644 index 0000000..3d5acdd Binary files /dev/null and b/_ReSharper.lsleditor/BuildScriptCache/5/4680b305.dat differ diff --git a/_ReSharper.lsleditor/ModuleIds.xml b/_ReSharper.lsleditor/ModuleIds.xml new file mode 100644 index 0000000..c4076ec --- /dev/null +++ b/_ReSharper.lsleditor/ModuleIds.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/_ReSharper.lsleditor/NamedArguments/.crc b/_ReSharper.lsleditor/NamedArguments/.crc new file mode 100644 index 0000000..5ead12d --- /dev/null +++ b/_ReSharper.lsleditor/NamedArguments/.crc @@ -0,0 +1 @@ +0´ä· \ No newline at end of file diff --git a/_ReSharper.lsleditor/NamedArguments/.version b/_ReSharper.lsleditor/NamedArguments/.version new file mode 100644 index 0000000..f66c9cf Binary files /dev/null and b/_ReSharper.lsleditor/NamedArguments/.version differ diff --git a/_ReSharper.lsleditor/NamedArguments/5/4680b305.dat b/_ReSharper.lsleditor/NamedArguments/5/4680b305.dat new file mode 100644 index 0000000..6c56d1d Binary files /dev/null and b/_ReSharper.lsleditor/NamedArguments/5/4680b305.dat differ diff --git a/_ReSharper.lsleditor/ProjectModel/ProjectModel.dat b/_ReSharper.lsleditor/ProjectModel/ProjectModel.dat new file mode 100644 index 0000000..01fa1e0 Binary files /dev/null and b/_ReSharper.lsleditor/ProjectModel/ProjectModel.dat differ diff --git a/_ReSharper.lsleditor/Resources/.crc b/_ReSharper.lsleditor/Resources/.crc new file mode 100644 index 0000000..ca596c6 --- /dev/null +++ b/_ReSharper.lsleditor/Resources/.crc @@ -0,0 +1 @@ +s[/ \ No newline at end of file diff --git a/_ReSharper.lsleditor/Resources/.version b/_ReSharper.lsleditor/Resources/.version new file mode 100644 index 0000000..38424fc Binary files /dev/null and b/_ReSharper.lsleditor/Resources/.version differ diff --git a/_ReSharper.lsleditor/Resources/5/626cc1d.dat b/_ReSharper.lsleditor/Resources/5/626cc1d.dat new file mode 100644 index 0000000..211a06a Binary files /dev/null and b/_ReSharper.lsleditor/Resources/5/626cc1d.dat differ diff --git a/_ReSharper.lsleditor/SymbolCache.bin b/_ReSharper.lsleditor/SymbolCache.bin new file mode 100644 index 0000000..432bd95 Binary files /dev/null and b/_ReSharper.lsleditor/SymbolCache.bin differ diff --git a/_ReSharper.lsleditor/TagPrefixes/.crc b/_ReSharper.lsleditor/TagPrefixes/.crc new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/_ReSharper.lsleditor/TagPrefixes/.crc differ diff --git a/_ReSharper.lsleditor/TagPrefixes/.version b/_ReSharper.lsleditor/TagPrefixes/.version new file mode 100644 index 0000000..f66c9cf Binary files /dev/null and b/_ReSharper.lsleditor/TagPrefixes/.version differ diff --git a/_ReSharper.lsleditor/TodoCache/.crc b/_ReSharper.lsleditor/TodoCache/.crc new file mode 100644 index 0000000..0c25090 --- /dev/null +++ b/_ReSharper.lsleditor/TodoCache/.crc @@ -0,0 +1 @@ +L÷m \ No newline at end of file diff --git a/_ReSharper.lsleditor/TodoCache/.version b/_ReSharper.lsleditor/TodoCache/.version new file mode 100644 index 0000000..2eedfde Binary files /dev/null and b/_ReSharper.lsleditor/TodoCache/.version differ diff --git a/_ReSharper.lsleditor/TodoCache/3/79ddd176.dat b/_ReSharper.lsleditor/TodoCache/3/79ddd176.dat new file mode 100644 index 0000000..09963ba Binary files /dev/null and b/_ReSharper.lsleditor/TodoCache/3/79ddd176.dat differ diff --git a/_ReSharper.lsleditor/WebsiteFileReferences/.crc b/_ReSharper.lsleditor/WebsiteFileReferences/.crc new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/_ReSharper.lsleditor/WebsiteFileReferences/.crc differ diff --git a/_ReSharper.lsleditor/WebsiteFileReferences/.version b/_ReSharper.lsleditor/WebsiteFileReferences/.version new file mode 100644 index 0000000..59c36c6 Binary files /dev/null and b/_ReSharper.lsleditor/WebsiteFileReferences/.version differ diff --git a/_ReSharper.lsleditor/WordIndex/.crc b/_ReSharper.lsleditor/WordIndex/.crc new file mode 100644 index 0000000..d666e44 --- /dev/null +++ b/_ReSharper.lsleditor/WordIndex/.crc @@ -0,0 +1 @@ +:]‘f \ No newline at end of file diff --git a/_ReSharper.lsleditor/WordIndex/.version b/_ReSharper.lsleditor/WordIndex/.version new file mode 100644 index 0000000..2cf9f20 Binary files /dev/null and b/_ReSharper.lsleditor/WordIndex/.version differ diff --git a/_ReSharper.lsleditor/WordIndex/5/4680b305.dat b/_ReSharper.lsleditor/WordIndex/5/4680b305.dat new file mode 100644 index 0000000..9f330ab Binary files /dev/null and b/_ReSharper.lsleditor/WordIndex/5/4680b305.dat differ diff --git a/_ReSharper.lsleditor/WordIndex/6/bf11a17.dat b/_ReSharper.lsleditor/WordIndex/6/bf11a17.dat new file mode 100644 index 0000000..22e4624 Binary files /dev/null and b/_ReSharper.lsleditor/WordIndex/6/bf11a17.dat differ diff --git a/app.config b/app.config new file mode 100644 index 0000000..b6b6315 --- /dev/null +++ b/app.config @@ -0,0 +1,352 @@ + + + + + +
+ + +
+ + + + + + SecondLife Name + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + youraddress@yourdomain.ext + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 175 + + + 0, 0 + + + 254464, 255232 + + + True + + + False + + + False + + + False + + + 0, 0 + + + False + + + 224, 224, 224 + + + 175, 0 + + + True + + + 15 + + + True + + + True + + + False + + + 2010-01-01 + + + 15 + + + False + + + True + + + True + + + + + + + + + PLAIN + + + True + + + False + + + + + + + + + + + + False + + + False + + + True + + + False + + + False + + + False + + + False + + + True + + + True + + + False + + + False + + + False + + + + + + + + + + + + ANSI + + + False + + + + + + Production + + + False + + + True + + + True + + + True + + + NoteCard.txt + + + False + + + False + + + LSLEditor parcel + + + Description of LSLEditor parcel + + + 00000000-0000-0000-0000-000000000000 + + + 00000000-0000-0000-0000-000000000000 + + + 512 + + + + + + + 2.40.0 + + + Resource.ConfLSL.xml + + + new.lsl + + + ReleaseNotes.htm + + + C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects + + + About.htm + + + 4 + + + 100 + + + 60 + + + default.lsl + + + LSLEditorHelp.chm + + + + // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) + default + { + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } + } + + + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + + + http://www.lsleditor.org/examples/ + + + + + http://www.lsleditor.org/uploadscript/ + + + + + Resource.ConfCSharp.xml + + + + + http://www.lsleditor.org/CheckForUpdate/Manifest.aspx + + + + + Resource.ToolsOptions.xml + + + + + http://www.lsleditor.org/mail/ + + + + + http://www.lsleditor.org/donate.htm + + + + + http://wiki.secondlife.com/wiki/Special:Search?go=Go&search= + + + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + + + http://www.lsleditor.org/forum/ + + + + + \ No newline at end of file diff --git a/bin/Debug/Default/Default.sol b/bin/Debug/Default/Default.sol new file mode 100644 index 0000000..af8601b --- /dev/null +++ b/bin/Debug/Default/Default.sol @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/Default/Project/Object/Script.lsl b/bin/Debug/Default/Project/Object/Script.lsl new file mode 100644 index 0000000..1f38691 --- /dev/null +++ b/bin/Debug/Default/Project/Object/Script.lsl @@ -0,0 +1,13 @@ +// www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + llOwnerSay(llGetScriptName()); + } +} \ No newline at end of file diff --git a/bin/Debug/Default/Project/Project.prj b/bin/Debug/Default/Project/Project.prj new file mode 100644 index 0000000..5709065 --- /dev/null +++ b/bin/Debug/Default/Project/Project.prj @@ -0,0 +1,6 @@ + + + + + diff --git a/bin/Debug/Default1/Default1.sol b/bin/Debug/Default1/Default1.sol new file mode 100644 index 0000000..863db49 --- /dev/null +++ b/bin/Debug/Default1/Default1.sol @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/Default1/Project/Object/Script.lsl b/bin/Debug/Default1/Project/Object/Script.lsl new file mode 100644 index 0000000..1f38691 --- /dev/null +++ b/bin/Debug/Default1/Project/Object/Script.lsl @@ -0,0 +1,13 @@ +// www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + llOwnerSay(llGetScriptName()); + } +} \ No newline at end of file diff --git a/bin/Debug/Default1/Project/Object/new.lsl b/bin/Debug/Default1/Project/Object/new.lsl new file mode 100644 index 0000000..d16c34e --- /dev/null +++ b/bin/Debug/Default1/Project/Object/new.lsl @@ -0,0 +1,10 @@ +default +{ + state_entry() + { + if((key)"") + llOwnerSay("TRUE"); + else + llOwnerSay("FALSE"); + } +} \ No newline at end of file diff --git a/bin/Debug/Default1/Project/Project.prj b/bin/Debug/Default1/Project/Project.prj new file mode 100644 index 0000000..a4a95d7 --- /dev/null +++ b/bin/Debug/Default1/Project/Project.prj @@ -0,0 +1,6 @@ + + + + + diff --git a/bin/Debug/Default123/Default123.sol b/bin/Debug/Default123/Default123.sol new file mode 100644 index 0000000..6e6c13f --- /dev/null +++ b/bin/Debug/Default123/Default123.sol @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/Default123/Project123/Object/Notecard.txt b/bin/Debug/Default123/Project123/Object/Notecard.txt new file mode 100644 index 0000000..20906f8 --- /dev/null +++ b/bin/Debug/Default123/Project123/Object/Notecard.txt @@ -0,0 +1,7 @@ +1 +2 +3 +4 +5 +6 +6 diff --git a/bin/Debug/Default123/Project123/Object/Notecard2.txt b/bin/Debug/Default123/Project123/Object/Notecard2.txt new file mode 100644 index 0000000..99a0c60 --- /dev/null +++ b/bin/Debug/Default123/Project123/Object/Notecard2.txt @@ -0,0 +1,7 @@ +notecard +1 +2 +3 +4 +5 +6 diff --git a/bin/Debug/Default123/Project123/Object/Notecard3.txt b/bin/Debug/Default123/Project123/Object/Notecard3.txt new file mode 100644 index 0000000..677357f --- /dev/null +++ b/bin/Debug/Default123/Project123/Object/Notecard3.txt @@ -0,0 +1 @@ +notecard \ No newline at end of file diff --git a/bin/Debug/Default123/Project123/Object/new.lsl b/bin/Debug/Default123/Project123/Object/new.lsl new file mode 100644 index 0000000..423ac79 --- /dev/null +++ b/bin/Debug/Default123/Project123/Object/new.lsl @@ -0,0 +1,13 @@ +// www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + llEmail("alphons@hwh.nl","a","b"); + } +} \ No newline at end of file diff --git a/bin/Debug/Default123/Project123/Project123.prj b/bin/Debug/Default123/Project123/Project123.prj new file mode 100644 index 0000000..c14c0ad --- /dev/null +++ b/bin/Debug/Default123/Project123/Project123.prj @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/bin/Debug/Default321/Default3210.sol b/bin/Debug/Default321/Default3210.sol new file mode 100644 index 0000000..ab3bf19 --- /dev/null +++ b/bin/Debug/Default321/Default3210.sol @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/Default321/Project/Project.prj b/bin/Debug/Default321/Project/Project.prj new file mode 100644 index 0000000..f05883f --- /dev/null +++ b/bin/Debug/Default321/Project/Project.prj @@ -0,0 +1,2 @@ + + diff --git a/bin/Debug/LSLEditor-beta.vshost.exe.config b/bin/Debug/LSLEditor-beta.vshost.exe.config new file mode 100644 index 0000000..f663bec --- /dev/null +++ b/bin/Debug/LSLEditor-beta.vshost.exe.config @@ -0,0 +1,135 @@ + + + + +
+ + +
+ + + + + + SecondLife Name + + + 2.1.1 + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + youraddress@yourdomain.ext + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 100 + + + 0, 0 + + + 254464, 255232 + + + True + + + False + + + False + + + False + + + 0, 0 + + + False + + + + + + + http://www.lsleditor.org/UploadExampleService/Service1.asmx + + + // LSL-Editor by Alphons Jano (Alphons van der Heijden) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } +} + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + http://www.lsleditor.org/examples/ + + + http://www.lsleditor.org/uploadscript/ + + + Resource.ConfLSL.xml + + + Resource.ConfCSharp.xml + + + new.lsl + + + res://LSLEditor.exe/ReleaseNotes.htm + + + + \ No newline at end of file diff --git a/bin/Debug/LSLEditor.exe b/bin/Debug/LSLEditor.exe new file mode 100644 index 0000000..6f53499 Binary files /dev/null and b/bin/Debug/LSLEditor.exe differ diff --git a/bin/Debug/LSLEditor.exe.config b/bin/Debug/LSLEditor.exe.config new file mode 100644 index 0000000..57800cb --- /dev/null +++ b/bin/Debug/LSLEditor.exe.config @@ -0,0 +1,327 @@ + + + + +
+ + +
+ + + + + + SecondLife Name + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + youraddress@yourdomain.ext + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 175 + + + 0, 0 + + + 254464, 255232 + + + True + + + False + + + False + + + False + + + 0, 0 + + + False + + + 224, 224, 224 + + + 175, 0 + + + True + + + 15 + + + True + + + True + + + False + + + 2010-01-01 + + + 15 + + + False + + + True + + + True + + + + + + + + + PLAIN + + + True + + + False + + + + + + + + + + + + False + + + False + + + True + + + False + + + False + + + False + + + False + + + True + + + True + + + False + + + False + + + False + + + + + + + + + + + + ANSI + + + False + + + + + + Production + + + False + + + True + + + True + + + True + + + NoteCard.txt + + + False + + + False + + + LSLEditor parcel + + + Description of LSLEditor parcel + + + 00000000-0000-0000-0000-000000000000 + + + 00000000-0000-0000-0000-000000000000 + + + 512 + + + + + + + 2.40.0 + + + // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } +} + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + http://www.lsleditor.org/examples/ + + + http://www.lsleditor.org/uploadscript/ + + + Resource.ConfLSL.xml + + + Resource.ConfCSharp.xml + + + new.lsl + + + ReleaseNotes.htm + + + C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects + + + About.htm + + + 4 + + + 100 + + + http://www.lsleditor.org/CheckForUpdate/Manifest.aspx + + + 60 + + + default.lsl + + + LSLEditorHelp.chm + + + Resource.ToolsOptions.xml + + + http://www.lsleditor.org/mail/ + + + http://www.lsleditor.org/donate.htm + + + http://wiki.secondlife.com/wiki/Special:Search?go=Go&search= + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + http://www.lsleditor.org/forum/ + + + + \ No newline at end of file diff --git a/bin/Debug/LSLEditor.pdb b/bin/Debug/LSLEditor.pdb new file mode 100644 index 0000000..00ec7f5 Binary files /dev/null and b/bin/Debug/LSLEditor.pdb differ diff --git a/bin/Debug/LSLEditor.vshost.exe b/bin/Debug/LSLEditor.vshost.exe new file mode 100644 index 0000000..ce3f102 Binary files /dev/null and b/bin/Debug/LSLEditor.vshost.exe differ diff --git a/bin/Debug/LSLEditor.vshost.exe.config b/bin/Debug/LSLEditor.vshost.exe.config new file mode 100644 index 0000000..57800cb --- /dev/null +++ b/bin/Debug/LSLEditor.vshost.exe.config @@ -0,0 +1,327 @@ + + + + +
+ + +
+ + + + + + SecondLife Name + + + False + + + + + + LSLEditor Island + + + smtp.emailserver.ext + + + youraddress@yourdomain.ext + + + + + + + + + + + + 0, 0 + + + 0, 0 + + + 0, 0 + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + 0, 0 + + + 0, 0 + + + 25 + + + 0, 175 + + + 0, 0 + + + 254464, 255232 + + + True + + + False + + + False + + + False + + + 0, 0 + + + False + + + 224, 224, 224 + + + 175, 0 + + + True + + + 15 + + + True + + + True + + + False + + + 2010-01-01 + + + 15 + + + False + + + True + + + True + + + + + + + + + PLAIN + + + True + + + False + + + + + + + + + + + + False + + + False + + + True + + + False + + + False + + + False + + + False + + + True + + + True + + + False + + + False + + + False + + + + + + + + + + + + ANSI + + + False + + + + + + Production + + + False + + + True + + + True + + + True + + + NoteCard.txt + + + False + + + False + + + LSLEditor parcel + + + Description of LSLEditor parcel + + + 00000000-0000-0000-0000-000000000000 + + + 00000000-0000-0000-0000-000000000000 + + + 512 + + + + + + + 2.40.0 + + + // www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } +} + + + http://www.lsleditor.org/checkforupdate/Default.aspx? + + + http://www.lsleditor.org/examples/ + + + http://www.lsleditor.org/uploadscript/ + + + Resource.ConfLSL.xml + + + Resource.ConfCSharp.xml + + + new.lsl + + + ReleaseNotes.htm + + + C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects + + + About.htm + + + 4 + + + 100 + + + http://www.lsleditor.org/CheckForUpdate/Manifest.aspx + + + 60 + + + default.lsl + + + LSLEditorHelp.chm + + + Resource.ToolsOptions.xml + + + http://www.lsleditor.org/mail/ + + + http://www.lsleditor.org/donate.htm + + + http://wiki.secondlife.com/wiki/Special:Search?go=Go&search= + + + http://www.lslwiki.net/lslwiki/wakka.php?wakka= + + + http://www.lsleditor.org/forum/ + + + + \ No newline at end of file diff --git a/bin/Debug/LSLEditorHelp.chm b/bin/Debug/LSLEditorHelp.chm new file mode 100644 index 0000000..18e7cd5 Binary files /dev/null and b/bin/Debug/LSLEditorHelp.chm differ diff --git a/bin/Debug/LsLEditor-beta.exe b/bin/Debug/LsLEditor-beta.exe new file mode 100644 index 0000000..6f53499 Binary files /dev/null and b/bin/Debug/LsLEditor-beta.exe differ diff --git a/bin/Debug/Plugins/ConsolePlugin.exe b/bin/Debug/Plugins/ConsolePlugin.exe new file mode 100644 index 0000000..90fe9b8 Binary files /dev/null and b/bin/Debug/Plugins/ConsolePlugin.exe differ diff --git a/bin/Debug/Plugins/LSLSnippetsPlugin.exe b/bin/Debug/Plugins/LSLSnippetsPlugin.exe new file mode 100644 index 0000000..c777b13 Binary files /dev/null and b/bin/Debug/Plugins/LSLSnippetsPlugin.exe differ diff --git a/bin/Debug/Plugins/Particles.exe b/bin/Debug/Plugins/Particles.exe new file mode 100644 index 0000000..2daab21 Binary files /dev/null and b/bin/Debug/Plugins/Particles.exe differ diff --git a/bin/Debug/Plugins/TestPlugin.exe b/bin/Debug/Plugins/TestPlugin.exe new file mode 100644 index 0000000..e5eabce Binary files /dev/null and b/bin/Debug/Plugins/TestPlugin.exe differ diff --git a/bin/Debug/Plugins/en/Particles.resources.dll b/bin/Debug/Plugins/en/Particles.resources.dll new file mode 100644 index 0000000..b26fe49 Binary files /dev/null and b/bin/Debug/Plugins/en/Particles.resources.dll differ diff --git a/bin/Debug/Plugins/fr/Particles.resources.dll b/bin/Debug/Plugins/fr/Particles.resources.dll new file mode 100644 index 0000000..e722fcc Binary files /dev/null and b/bin/Debug/Plugins/fr/Particles.resources.dll differ diff --git a/bin/Debug/Plugins/lslSnippetsLib.dll b/bin/Debug/Plugins/lslSnippetsLib.dll new file mode 100644 index 0000000..4e9e664 Binary files /dev/null and b/bin/Debug/Plugins/lslSnippetsLib.dll differ diff --git a/bin/Debug/Plugins/lslint.exe b/bin/Debug/Plugins/lslint.exe new file mode 100644 index 0000000..d876feb Binary files /dev/null and b/bin/Debug/Plugins/lslint.exe differ diff --git a/bin/Debug/Plugins/plugins/License.txt b/bin/Debug/Plugins/plugins/License.txt new file mode 100644 index 0000000..f7a09ad --- /dev/null +++ b/bin/Debug/Plugins/plugins/License.txt @@ -0,0 +1,23 @@ +// LSLSnippetsPlugin v1.1.0 +// by Seneca Taliaferro/Joseph P. Socoloski III (Minoa) +// Copyright 2008. All Rights Reserved. +// http://lslsnippets.googlecode.com +// NOTE: Add your own LSL snippets to an existing script. +// Plugin for LSLEditor v2.34+ +// WHAT'S NEW: +// - Bug Fix issue#1: Added state_entry to dropdown list +// LIMITS: +// TODO: +//LICENSE +//BY DOWNLOADING AND USING, YOU AGREE TO THE FOLLOWING TERMS: +//If it is your intent to use this software for non-commercial purposes, +//such as in academic research, this software is free and is covered under +//the GNU GPL License, given here: +//////////////////////////////////////////////////////////////////////////// + +lslSnippetsApp is an application to demostrate lslSnippetsLib. +lslSnippetsLib is a dll that can read your own custom LSL snippets and +insert them into an existing LSL script. +---------------------------------------------------------------------------- +You may need to install Microsoft .NET Framework 3.5 before running +http://www.microsoft.com/downloads/details.aspx?FamilyID=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en \ No newline at end of file diff --git a/bin/Debug/Plugins/scripts/new.lsl b/bin/Debug/Plugins/scripts/new.lsl new file mode 100644 index 0000000..30a086f --- /dev/null +++ b/bin/Debug/Plugins/scripts/new.lsl @@ -0,0 +1,11 @@ +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } +} \ No newline at end of file diff --git a/bin/Debug/Plugins/scripts/tinyscript.lsl b/bin/Debug/Plugins/scripts/tinyscript.lsl new file mode 100644 index 0000000..92c6584 --- /dev/null +++ b/bin/Debug/Plugins/scripts/tinyscript.lsl @@ -0,0 +1,7 @@ +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } +} \ No newline at end of file diff --git a/bin/Debug/Plugins/scripts/touch.lsl b/bin/Debug/Plugins/scripts/touch.lsl new file mode 100644 index 0000000..30a086f --- /dev/null +++ b/bin/Debug/Plugins/scripts/touch.lsl @@ -0,0 +1,11 @@ +default +{ + state_entry() + { + llSay(0, "Hello, Avatar!"); + } + touch_start(integer total_number) + { + llSay(0, "Touched: "+(string)total_number); + } +} \ No newline at end of file diff --git a/bin/Debug/Plugins/snippets/NotecardReaderv3.xml b/bin/Debug/Plugins/snippets/NotecardReaderv3.xml new file mode 100644 index 0000000..cc73e1c --- /dev/null +++ b/bin/Debug/Plugins/snippets/NotecardReaderv3.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + +///Loads and xmlcard into the main list variable +/// +/// +state NotecardtoList +{ + //Start at beginning of xmlcard + state_entry() + { + integer ready = TRUE; + if (llGetInventoryKey(NOTE_CARD) == NULL_KEY) + { + llOwnerSay("Error: \"" + NOTE_CARD + "\" does not exist in the object's inventory."); + ready = FALSE; + } + + if (ready) + { + if(curLine == 0) + llWhisper(0, "Please wait. Reading data from "+NOTE_CARD+"...."); + + llGetNotecardLine(NOTE_CARD, curLine); // request first line + } + } + + //dataserver event is triggered when the requested data is returned to the script. + dataserver(key queryid, string data) + { + if (data == EOF) + { + llOwnerSay("Completed loading " + NOTE_CARD); + state default; + } + else + { + if(data != "") + { + //Check to see if the line begins with a '#' (comment line) + if (llSubStringIndex(data, "#") == -1) + { + notecard += data; // Add the current notecard line to the string + } + } + + //Always advance the reading of the card... + ++curLine; // increase line count + state __getnotecardtolist; + } + } +}]]> + + + \ No newline at end of file diff --git a/bin/Debug/Plugins/snippets/llPlaySound.xml b/bin/Debug/Plugins/snippets/llPlaySound.xml new file mode 100644 index 0000000..24b1e3b --- /dev/null +++ b/bin/Debug/Plugins/snippets/llPlaySound.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bin/Debug/Plugins/snippets/llsay.xml b/bin/Debug/Plugins/snippets/llsay.xml new file mode 100644 index 0000000..fe67a6a --- /dev/null +++ b/bin/Debug/Plugins/snippets/llsay.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bin/Debug/Plugins/snippets/llstateentry.xml b/bin/Debug/Plugins/snippets/llstateentry.xml new file mode 100644 index 0000000..fab3392 --- /dev/null +++ b/bin/Debug/Plugins/snippets/llstateentry.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bin/Debug/Plugins/unins000.dat b/bin/Debug/Plugins/unins000.dat new file mode 100644 index 0000000..b1d3c5a Binary files /dev/null and b/bin/Debug/Plugins/unins000.dat differ diff --git a/bin/Debug/Plugins/unins000.exe b/bin/Debug/Plugins/unins000.exe new file mode 100644 index 0000000..60fc2f8 Binary files /dev/null and b/bin/Debug/Plugins/unins000.exe differ diff --git a/bin/Debug/UTF8/Project/Object/Notecard.txt b/bin/Debug/UTF8/Project/Object/Notecard.txt new file mode 100644 index 0000000..e33aabd --- /dev/null +++ b/bin/Debug/UTF8/Project/Object/Notecard.txt @@ -0,0 +1,115 @@ +#Greek kosme +%ce%ba%e1%bd%b9%cf%83%ce%bc%ce%b5|5 + +#Boundary condition test cases - First possible sequence of a certain length +%00|0 +%c2%80|1 +%e0%a0%80|1 +%f0%90%80%80|1 +%f8%88%80%80%80|1 +%fc%84%80%80%80%80|1 + +#Last Possible Sequence of a certain length +%7f|1 +%df%bf|1 +%ef%bf%bf|1 +%f7%bf%bf%bf|1 +%fb%bf%bf%bf%bf|1 +%fd%bf%bf%bf%bf%bf|1 + +#Other boundary conditions +%ed%9f%bf|1 +%ee%80%80|1 +%ef%bf%bd|1 +%f4%8f%bf%bf|1 +%f4%90%80%80|1 + +#Unexpected continuation bytes +%80|1 +%bf|1 +%80%bf|2 +%80%bf%80|3 +%80%bf%80%bf|4 +%80%bf%80%bf%80|5 +%80%bf%80%bf%80%bf|6 +%80%bf%80%bf%80%bf%80|7 + +#All 64 possible continuation bytes +%80%81%82%83%84%85%86%87%88%89%8a%8b%8c%8d%8e%8f%90%91%92%93%94%95%96%97%98%99%9a%9b%9c%9d%9e%9f%a0%a1%a2%a3%a4%a5%a6%a7%a8%a9%aa%ab%ac%ad%ae%af%b0%b1%b2%b3%b4%b5%b6%b7%b8%b9%ba%bb%bc%bd%be%bf|64 + +#All 32 first bytes of 2-byte sequences +%c0%20%c1%20%c2%20%c3%20%c4%20%c5%20%c6%20%c7%20%c8%20%c9%20%ca%20%cb%20%cc%20%cd%20%ce%20%cf%20%d0%20%d1%20%d2%20%d3%20%d4%20%d5%20%d6%20%d7%20%d8%20%d9%20%da%20%db%20%dc%20%dd%20%de%20%df%20|64 + +#All 16 first bytes of 3-byte sequences +%e0%20%e1%20%e2%20%e3%20%e4%20%e5%20%e6%20%e7%20%e8%20%e9%20%ea%20%eb%20%ec%20%ed%20%ee%20%ef%20|32 + +#All 8 first bytes of 4-byte sequences +%f0%20%f1%20%f2%20%f3%20%f4%20%f5%20%f6%20%f7%20|16 + +#All 4 first bytes of 5-byte sequences +%f8%20%f9%20%fa%20%fb%20|8 + +#All 2 first bytes of 6-byte sequences +%fc%20%fd%20|4 + +#Sequences with last continuation byte missing +%c0|1 +%e0%80|1 +%f0%80%80|1 +%f8%80%80%80|1 +%fc%80%80%80%80|1 +%df|1 +%ef%bf|1 +%f7%bf%bf|1 +%fb%bf%bf%bf|1 +%fd%bf%bf%bf%bf|1 +%c0%e0%80%f0%80%80%f8%80%80%80%fc%80%80%80%80%df%ef%bf%f7%bf%bf%fb%bf%bf%bf%fd%bf%bf%bf%bf|10 + +#Impossible bytes +%fe|1 +%ff|1 +%fe%fe%ff%ff|4 + +#Examples of an overlong ASCII character +%c0%af|1 +%e0%80%af|1 +%f0%80%80%af|1 +%f8%80%80%80%af|1 +%fc%80%80%80%80%af|1 + +#Maximum overlong sequences +%c1%bf|1 +%e0%9f%bf|1 +%f0%8f%bf%bf|1 +%f8%87%bf%bf%bf|1 +%fc%83%bf%bf%bf%bf|1 + +#Overlong sequences - Overlong representation of the NUL character +%c0%80|1 +%e0%80%80|1 +%f0%80%80%80|1 +%f8%80%80%80%80|1 +%fc%80%80%80%80%80|1 + +#Illegal code positions - Single UTF-16 surrogates +%ed%a0%80|1 +%ed%ad%bf|1 +%ed%ae%80|1 +%ed%af%bf|1 +%ed%b0%80|1 +%ed%be%80|1 +%ed%bf%bf|1 + +#Illegal code positions - Paired UTF-16 surrogates +%ed%a0%80%ed%b0%80|2 +%ed%a0%80%ed%bf%bf|2 +%ed%ad%bf%ed%b0%80|2 +%ed%ad%bf%ed%bf%bf|2 +%ed%ae%80%ed%b0%80|2 +%ed%ae%80%ed%bf%bf|2 +%ed%af%bf%ed%b0%80|2 +%ed%af%bf%ed%bf%bf|2 + +#Illegal code positions - Other illegal code positions +%ef%bf%be|1 +%ef%bf%bf|1 diff --git a/bin/Debug/UTF8/Project/Object/Script.lsl b/bin/Debug/UTF8/Project/Object/Script.lsl new file mode 100644 index 0000000..998c604 --- /dev/null +++ b/bin/Debug/UTF8/Project/Object/Script.lsl @@ -0,0 +1,83 @@ +string card; +integer lines = -1; +integer line = 0; +list resuts; +integer pass; +integer fail; + +default +{ + state_entry() + { + if(llGetInventoryNumber(INVENTORY_NOTECARD)) + { + llGetNumberOfNotecardLines( + card = llGetInventoryName(INVENTORY_NOTECARD,0)); + llOwnerSay("Test-Starting: "+card); + } + } + on_rez(integer a) + { + llResetScript(); + } + touch_start(integer a) + { + llResetScript(); + } + changed(integer a) + { + if(a & CHANGED_INVENTORY) + llResetScript(); + } + + dataserver(key a, string b) + { + if(lines == -1) + { + lines = (integer)b; + llGetNotecardLine(card,line); + } + else + { + list c = llParseString2List(a=(string)llParseString2List(b,[" "],[]),["|"],[EOF]); + integer d; + integer e; + integer f; + if(llGetSubString(a,0,0) == "#") + llOwnerSay(llDeleteSubString(b,0,0)); + else if(llGetListLength(c) >= 2) + { + d = llStringLength(b = llUnescapeURL(llList2String(c,0))); + f = llList2Integer(c,1); + e = (d == f); + pass += e; + fail += !e; + string out = (string)line +": "; + out += llList2String(["Fail","Pass"],e) + " "; + out += "(" + (string)d + " - " + (string)f + ") "; + //Enable this section to test llUnescapeURL + // out += "(" + (string)(( + // llStringLength( + // (string)llParseString2List( //strips off the evil pad + // llStringToBase64(b),["="],[] + // ) + // ) * 3 ) / 4); //thats how many bytes should be in it (assuming all escaped) + // out += " - "; + // out += (string)(llStringLength(llList2String(c,0))/3) + ")"; + + + // This will IM all the tests to the owner! This is slow because IM sleeps the script for 2 seconds. + llInstantMessage(llGetOwner(),b); + llOwnerSay(out); + } + if(llListFindList(c,[EOF]) == -1 && ++line < lines) + llGetNotecardLine(card,line); + else + { + llOwnerSay("Finished"); + llOwnerSay("Passed: "+(string)pass); + llOwnerSay("Failed: "+(string)fail); + } + } + } +} diff --git a/bin/Debug/UTF8/Project/Object/new.lsl b/bin/Debug/UTF8/Project/Object/new.lsl new file mode 100644 index 0000000..3ecc610 --- /dev/null +++ b/bin/Debug/UTF8/Project/Object/new.lsl @@ -0,0 +1,11 @@ +integer verbose=1; +s(string s){if (verbose){ s=""; }} +st(string s){s="";} + +default +{ + state_entry() + { + + } +} diff --git a/bin/Debug/UTF8/Project/Project.prj b/bin/Debug/UTF8/Project/Project.prj new file mode 100644 index 0000000..f1d9718 --- /dev/null +++ b/bin/Debug/UTF8/Project/Project.prj @@ -0,0 +1,8 @@ + + + + + + + diff --git a/bin/Debug/UTF8/UTF8.sol b/bin/Debug/UTF8/UTF8.sol new file mode 100644 index 0000000..710af08 --- /dev/null +++ b/bin/Debug/UTF8/UTF8.sol @@ -0,0 +1,3 @@ + + + diff --git a/bin/Debug/new.lsl b/bin/Debug/new.lsl new file mode 100644 index 0000000..c4876d4 --- /dev/null +++ b/bin/Debug/new.lsl @@ -0,0 +1,12 @@ +// www.lsleditor.org by Alphons van der Heijden (SL: Alphons Jano) +default +{ + state_entry() + { + llSay(0, "Ready to test!"); + } + touch_start(integer total_number) + { + llSay(0, "Length of \\t (tab) character: "+(string)llStringLength("\t")); + } +} diff --git a/gpl-2.0.txt b/gpl-2.0.txt new file mode 100644 index 0000000..89e08fb --- /dev/null +++ b/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 of the License, 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/llDialogForm.Designer.cs b/llDialogForm.Designer.cs new file mode 100644 index 0000000..21bf249 --- /dev/null +++ b/llDialogForm.Designer.cs @@ -0,0 +1,288 @@ +namespace LSLEditor +{ + partial class llDialogForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button7 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.button8 = new System.Windows.Forms.Button(); + this.button9 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.button12 = new System.Windows.Forms.Button(); + this.button13 = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // button1 + // + this.button1.BackColor = System.Drawing.Color.SlateBlue; + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Location = new System.Drawing.Point(16, 232); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(80, 23); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = false; + this.button1.Visible = false; + // + // button7 + // + this.button7.BackColor = System.Drawing.Color.SlateBlue; + this.button7.ForeColor = System.Drawing.Color.White; + this.button7.Location = new System.Drawing.Point(16, 184); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(80, 23); + this.button7.TabIndex = 6; + this.button7.Text = "button7"; + this.button7.UseVisualStyleBackColor = false; + this.button7.Visible = false; + // + // button10 + // + this.button10.BackColor = System.Drawing.Color.SlateBlue; + this.button10.ForeColor = System.Drawing.Color.White; + this.button10.Location = new System.Drawing.Point(16, 160); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(80, 23); + this.button10.TabIndex = 9; + this.button10.Text = "button10"; + this.button10.UseVisualStyleBackColor = false; + this.button10.Visible = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 8); + this.label1.MaximumSize = new System.Drawing.Size(260, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 13; + this.label1.Text = "label1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 64); + this.label2.MaximumSize = new System.Drawing.Size(260, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 14; + this.label2.Text = "label2"; + // + // button2 + // + this.button2.BackColor = System.Drawing.Color.SlateBlue; + this.button2.ForeColor = System.Drawing.Color.White; + this.button2.Location = new System.Drawing.Point(104, 232); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(80, 23); + this.button2.TabIndex = 15; + this.button2.Text = "button2"; + this.button2.UseVisualStyleBackColor = false; + this.button2.Visible = false; + // + // button3 + // + this.button3.BackColor = System.Drawing.Color.SlateBlue; + this.button3.ForeColor = System.Drawing.Color.White; + this.button3.Location = new System.Drawing.Point(192, 232); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(80, 23); + this.button3.TabIndex = 16; + this.button3.Text = "button3"; + this.button3.UseVisualStyleBackColor = false; + this.button3.Visible = false; + // + // button4 + // + this.button4.BackColor = System.Drawing.Color.SlateBlue; + this.button4.ForeColor = System.Drawing.Color.White; + this.button4.Location = new System.Drawing.Point(16, 208); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(80, 23); + this.button4.TabIndex = 17; + this.button4.Text = "button4"; + this.button4.UseVisualStyleBackColor = false; + this.button4.Visible = false; + // + // button5 + // + this.button5.BackColor = System.Drawing.Color.SlateBlue; + this.button5.ForeColor = System.Drawing.Color.White; + this.button5.Location = new System.Drawing.Point(104, 208); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(80, 23); + this.button5.TabIndex = 18; + this.button5.Text = "button5"; + this.button5.UseVisualStyleBackColor = false; + this.button5.Visible = false; + // + // button6 + // + this.button6.BackColor = System.Drawing.Color.SlateBlue; + this.button6.ForeColor = System.Drawing.Color.White; + this.button6.Location = new System.Drawing.Point(192, 208); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(80, 23); + this.button6.TabIndex = 19; + this.button6.Text = "button6"; + this.button6.UseVisualStyleBackColor = false; + this.button6.Visible = false; + // + // button8 + // + this.button8.BackColor = System.Drawing.Color.SlateBlue; + this.button8.ForeColor = System.Drawing.Color.White; + this.button8.Location = new System.Drawing.Point(104, 184); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(80, 23); + this.button8.TabIndex = 20; + this.button8.Text = "button8"; + this.button8.UseVisualStyleBackColor = false; + this.button8.Visible = false; + // + // button9 + // + this.button9.BackColor = System.Drawing.Color.SlateBlue; + this.button9.ForeColor = System.Drawing.Color.White; + this.button9.Location = new System.Drawing.Point(192, 184); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(80, 23); + this.button9.TabIndex = 21; + this.button9.Text = "button9"; + this.button9.UseVisualStyleBackColor = false; + this.button9.Visible = false; + // + // button11 + // + this.button11.BackColor = System.Drawing.Color.SlateBlue; + this.button11.ForeColor = System.Drawing.Color.White; + this.button11.Location = new System.Drawing.Point(104, 160); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(80, 23); + this.button11.TabIndex = 22; + this.button11.Text = "button11"; + this.button11.UseVisualStyleBackColor = false; + this.button11.Visible = false; + // + // button12 + // + this.button12.BackColor = System.Drawing.Color.SlateBlue; + this.button12.ForeColor = System.Drawing.Color.White; + this.button12.Location = new System.Drawing.Point(192, 160); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(80, 23); + this.button12.TabIndex = 23; + this.button12.Text = "button12"; + this.button12.UseVisualStyleBackColor = false; + this.button12.Visible = false; + // + // button13 + // + this.button13.BackColor = System.Drawing.Color.SlateBlue; + this.button13.ForeColor = System.Drawing.Color.White; + this.button13.Location = new System.Drawing.Point(192, 264); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(80, 23); + this.button13.TabIndex = 24; + this.button13.Text = "Ignore"; + this.button13.UseVisualStyleBackColor = false; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // panel1 + // + this.panel1.AutoScroll = true; + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.label1); + this.panel1.Location = new System.Drawing.Point(16, 8); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(264, 144); + this.panel1.TabIndex = 25; + // + // llDialogForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.CornflowerBlue; + this.ClientSize = new System.Drawing.Size(290, 300); + this.Controls.Add(this.panel1); + this.Controls.Add(this.button13); + this.Controls.Add(this.button12); + this.Controls.Add(this.button11); + this.Controls.Add(this.button9); + this.Controls.Add(this.button8); + this.Controls.Add(this.button6); + this.Controls.Add(this.button5); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button10); + this.Controls.Add(this.button7); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "llDialogForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "llDialogForm"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button button13; + private System.Windows.Forms.Panel panel1; + } +} \ No newline at end of file diff --git a/llDialogForm.cs b/llDialogForm.cs new file mode 100644 index 0000000..e4f5bf2 --- /dev/null +++ b/llDialogForm.cs @@ -0,0 +1,105 @@ +// /** +// ******** +// * +// * ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +// * The code was donated on 4/28/2010 by Alphons van der Heijden +// * To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +// * In agreement to Alphons van der Heijden wishes. +// * +// * The community would like to thank Alphons for all of his hard work, blood sweat and tears. +// * Without his work the community would be stuck with crappy editors. +// * +// * The source code in this file ("Source Code") is provided by The LSLEditor Group +// * to you under the terms of the GNU General Public License, version 2.0 +// * ("GPL"), unless you have obtained a separate licensing agreement +// * ("Other License"), formally executed by you and Linden Lab. Terms of +// * the GPL can be found in the gplv2.txt document. +// * +// ******** +// * GPLv2 Header +// ******** +// * LSLEditor, a External editor for the LSL Language. +// * Copyright (C) 2010 The LSLEditor Group. +// +// * 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 +// * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// ******** +// * +// * The above copyright notice and this permission notice shall be included in all +// * copies or substantial portions of the Software. +// * +// ******** +// */ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace LSLEditor +{ + public partial class llDialogForm : Form + { + private SecondLifeHost host; + private int Channel; + private string ObjectName; + private string OwnerName; + private SecondLife.key id; + + public llDialogForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.list buttons, SecondLife.integer intChannel) + { + InitializeComponent(); + + this.host = host; + this.Channel = intChannel; + this.OwnerName = strOwner; + this.ObjectName = strObjectName; + this.id = id; + + for (int intI = 1; intI <= 12; intI++) + { + Button button = this.Controls["Button" + intI] as Button; + button.Visible = false; + } + + this.label1.Text = strOwner + "'s '" + strObjectName +"'"; + this.label2.Text = strMessage.ToString().Replace("&","&&"); + + for (int intI = 1; intI <= buttons.Count; intI++) + { + Button button = this.Controls["Button" + intI] as Button; + if (button == null) + continue; + button.Text = buttons[intI - 1].ToString().Replace("&","&&"); + button.Visible = true; + button.Click += new EventHandler(button_Click); + } + } + + void button_Click(object sender, EventArgs e) + { + Button button = sender as Button; + if (button == null) + return; + host.Chat(this,this.Channel, this.OwnerName, this.id, button.Text.Replace("&&","&"), CommunicationType.Say); + this.Close(); + } + + private void button13_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} \ No newline at end of file diff --git a/llDialogForm.resx b/llDialogForm.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/llDialogForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/lsleditor.5.0.ReSharper.user b/lsleditor.5.0.ReSharper.user new file mode 100644 index 0000000..515ea98 --- /dev/null +++ b/lsleditor.5.0.ReSharper.user @@ -0,0 +1,28 @@ + + + + + + False + + + + + + + + + + + + + + + + + + + + Never + + \ No newline at end of file diff --git a/lsleditor.csproj b/lsleditor.csproj new file mode 100644 index 0000000..e74734a --- /dev/null +++ b/lsleditor.csproj @@ -0,0 +1,672 @@ + + + Local + 8.0.50727 + 2.0 + {59468D25-6E68-4113-B740-C6EF4695045B} + Debug + AnyCPU + + + + + LSLEditor + Resource\Test.snk + JScript + Grid + IE50 + false + WinExe + LSLEditor + OnBuildSuccess + + + + + + + true + C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\LSLEditor.RES + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + + System.Drawing + + + + System.Windows.Forms + + + System.XML + + + + + Form + + + About.cs + + + Form + + + BugReportForm.cs + + + + + + + + + + + + + + + + + + Form + + + GuidProperty.cs + + + + + + + + + + + + Form + + + NewProject.cs + + + Form + + + PermissionsForm.cs + + + Form + + + GotoWindow.cs + + + UserControl + + + Numbered.cs + + + Form + + + TooltipWindow.cs + + + Component + + + GListBox.cs + + + Form + + + GListBoxWindow.cs + + + UserControl + + + RichLabel.cs + + + Form + + + llDialogForm.cs + + + + + Code + + + Form + + + Browser.cs + + + + Form + + + EditForm.cs + + + Form + + + FindWindow.cs + + + Form + + + LSLEditorForm.cs + + + True + True + Resources.resx + + + True + True + Settings.settings + + + + Component + + + + UserControl + + + NumberedTextBoxUC.cs + + + UserControl + + + RuntimeConsole.cs + + + + Code + + + + + + + + + + Component + + + Code + + + Designer + About.cs + + + Code + + + Component + + + TabControlExtended.cs + + + UserControl + + + SimulatorConsole.cs + + + UserControl + + + SolutionExplorer.cs + + + Form + + + SvnAguments.cs + + + + UserControl + + + SyntaxError.cs + + + UserControl + + + EnvironmentPlugins.cs + + + UserControl + + + RuntimeGeneral.cs + + + UserControl + + + TextEditorCodeCompletion.cs + + + UserControl + + + EnvironmentBrowser.cs + + + UserControl + + + ProjectSettings.cs + + + UserControl + + + RuntimeInternal.cs + + + UserControl + + + RuntimeSmtp.cs + + + UserControl + + + RuntimeExternal.cs + + + UserControl + + + EnvironmentGeneral.cs + + + UserControl + + + TextEditorFontColors.cs + + + UserControl + + + EnvironmentHelp.cs + + + UserControl + + + TextEditorGeneral.cs + + + Form + + + ToolsOptions.cs + + + UserControl + + + VersionControlGeneral.cs + + + Form + + + UpdateApplicationForm.cs + + + True + True + Reference.map + + + Designer + Browser.cs + + + Designer + BugReportForm.cs + + + Designer + GuidProperty.cs + + + Designer + NewProject.cs + + + PermissionsForm.cs + Designer + + + GotoWindow.cs + Designer + + + Designer + EditForm.cs + + + TooltipWindow.cs + Designer + + + GListBoxWindow.cs + Designer + + + Designer + RichLabel.cs + + + Designer + FindWindow.cs + + + Designer + llDialogForm.cs + + + Designer + LSLEditorForm.cs + + + Designer + ResXFileCodeGenerator + Resources.Designer.cs + + + NumberedTextBoxUC.cs + Designer + + + Code + + + + GroupboxEvent.cs + Designer + + + + + + + + + + + + Designer + RuntimeConsole.cs + + + SyntaxRichTextBox.cs + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + SimulatorConsole.cs + + + SolutionExplorer.cs + Designer + + + Designer + SvnAguments.cs + + + Designer + SyntaxError.cs + + + Designer + EnvironmentPlugins.cs + + + RuntimeGeneral.cs + Designer + + + TextEditorCodeCompletion.cs + Designer + + + Designer + EnvironmentBrowser.cs + + + Designer + ProjectSettings.cs + + + RuntimeInternal.cs + Designer + + + RuntimeSmtp.cs + Designer + + + RuntimeExternal.cs + Designer + + + Designer + EnvironmentGeneral.cs + + + Designer + TextEditorFontColors.cs + + + Designer + EnvironmentHelp.cs + + + Designer + TextEditorGeneral.cs + + + Designer + ToolsOptions.cs + + + Designer + VersionControlGeneral.cs + + + Designer + UpdateApplicationForm.cs + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + MSDiscoCodeGenerator + Reference.cs + + + + + + + + + Static + Web References\org.lsleditor.www\ + http://www.lsleditor.org/UploadBugReport/Service1.asmx + + + + + Settings + LSLEditor_org_lsleditor_www_Service1 + + + + + "$(DevEnvDir)..\..\SDK\v2.0\bin\rc.exe" /r "$(ProjectDir)$(TargetName).rc" + + + + \ No newline at end of file diff --git a/lsleditor.csproj.user b/lsleditor.csproj.user new file mode 100644 index 0000000..5e96819 --- /dev/null +++ b/lsleditor.csproj.user @@ -0,0 +1,70 @@ + + + LSLEditor.RES + 7.10.3077 + Debug + AnyCPU + D:\Documents and Settings\Administrator\Mijn documenten\Mijn SecondLife\src\Editor2\bin\Debug\ + + + + + 0 + ProjectFiles + 0 + publish\|http://localhost/LSLEditor/ + + + + + + + + + 0 + en-US + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + \ No newline at end of file diff --git a/lsleditor.sln b/lsleditor.sln new file mode 100644 index 0000000..61815d8 --- /dev/null +++ b/lsleditor.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lsleditor", "lsleditor.csproj", "{59468D25-6E68-4113-B740-C6EF4695045B}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Any CPU.Build.0 = Release|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {59468D25-6E68-4113-B740-C6EF4695045B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/lsleditor.suo b/lsleditor.suo new file mode 100644 index 0000000..1706414 Binary files /dev/null and b/lsleditor.suo differ diff --git a/obj/Debug/Editor2.projdata b/obj/Debug/Editor2.projdata new file mode 100644 index 0000000..3bb037d Binary files /dev/null and b/obj/Debug/Editor2.projdata differ diff --git a/obj/Debug/Editor2.projdata1 b/obj/Debug/Editor2.projdata1 new file mode 100644 index 0000000..cd962df Binary files /dev/null and b/obj/Debug/Editor2.projdata1 differ diff --git a/obj/Debug/LSLEditor.About.resources b/obj/Debug/LSLEditor.About.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.About.resources differ diff --git a/obj/Debug/LSLEditor.Browser.resources b/obj/Debug/LSLEditor.Browser.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Browser.resources differ diff --git a/obj/Debug/LSLEditor.BugReport.BugReportForm.resources b/obj/Debug/LSLEditor.BugReport.BugReportForm.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.BugReport.BugReportForm.resources differ diff --git a/obj/Debug/LSLEditor.EditForm.resources b/obj/Debug/LSLEditor.EditForm.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.EditForm.resources differ diff --git a/obj/Debug/LSLEditor.FindWindow.resources b/obj/Debug/LSLEditor.FindWindow.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.FindWindow.resources differ diff --git a/obj/Debug/LSLEditor.GListBoxWindow.resources b/obj/Debug/LSLEditor.GListBoxWindow.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.GListBoxWindow.resources differ diff --git a/obj/Debug/LSLEditor.GotoWindow.resources b/obj/Debug/LSLEditor.GotoWindow.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.GotoWindow.resources differ diff --git a/obj/Debug/LSLEditor.GroupboxEvent.resources b/obj/Debug/LSLEditor.GroupboxEvent.resources new file mode 100644 index 0000000..3bc7bd2 Binary files /dev/null and b/obj/Debug/LSLEditor.GroupboxEvent.resources differ diff --git a/obj/Debug/LSLEditor.Images.Class.gif b/obj/Debug/LSLEditor.Images.Class.gif new file mode 100644 index 0000000..d55a72d Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Class.gif differ diff --git a/obj/Debug/LSLEditor.Images.Close-Active.gif b/obj/Debug/LSLEditor.Images.Close-Active.gif new file mode 100644 index 0000000..aaf4949 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Close-Active.gif differ diff --git a/obj/Debug/LSLEditor.Images.Close-Disabled.gif b/obj/Debug/LSLEditor.Images.Close-Disabled.gif new file mode 100644 index 0000000..fbbe6b3 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Close-Disabled.gif differ diff --git a/obj/Debug/LSLEditor.Images.Close-Inactive.gif b/obj/Debug/LSLEditor.Images.Close-Inactive.gif new file mode 100644 index 0000000..7028d74 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Close-Inactive.gif differ diff --git a/obj/Debug/LSLEditor.Images.Constants.gif b/obj/Debug/LSLEditor.Images.Constants.gif new file mode 100644 index 0000000..63724c2 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Constants.gif differ diff --git a/obj/Debug/LSLEditor.Images.Enum.gif b/obj/Debug/LSLEditor.Images.Enum.gif new file mode 100644 index 0000000..619865f Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Enum.gif differ diff --git a/obj/Debug/LSLEditor.Images.Events.gif b/obj/Debug/LSLEditor.Images.Events.gif new file mode 100644 index 0000000..99cd7cb Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Events.gif differ diff --git a/obj/Debug/LSLEditor.Images.Functions.gif b/obj/Debug/LSLEditor.Images.Functions.gif new file mode 100644 index 0000000..8fde0c3 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Functions.gif differ diff --git a/obj/Debug/LSLEditor.Images.Namespace.gif b/obj/Debug/LSLEditor.Images.Namespace.gif new file mode 100644 index 0000000..bac956e Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Namespace.gif differ diff --git a/obj/Debug/LSLEditor.Images.Properties.gif b/obj/Debug/LSLEditor.Images.Properties.gif new file mode 100644 index 0000000..dd4b641 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Properties.gif differ diff --git a/obj/Debug/LSLEditor.Images.SealedClass.gif b/obj/Debug/LSLEditor.Images.SealedClass.gif new file mode 100644 index 0000000..66f3e3b Binary files /dev/null and b/obj/Debug/LSLEditor.Images.SealedClass.gif differ diff --git a/obj/Debug/LSLEditor.Images.Unknown.gif b/obj/Debug/LSLEditor.Images.Unknown.gif new file mode 100644 index 0000000..d90ab95 Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Unknown.gif differ diff --git a/obj/Debug/LSLEditor.Images.Vars.gif b/obj/Debug/LSLEditor.Images.Vars.gif new file mode 100644 index 0000000..619865f Binary files /dev/null and b/obj/Debug/LSLEditor.Images.Vars.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animation.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animation.gif new file mode 100644 index 0000000..0fd284f Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animation.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animations.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animations.gif new file mode 100644 index 0000000..69794ab Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Animations.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Body Parts.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Body Parts.gif new file mode 100644 index 0000000..df1dc73 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Body Parts.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Calling Cards.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Calling Cards.gif new file mode 100644 index 0000000..3c751c7 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Calling Cards.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Clothes.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Clothes.gif new file mode 100644 index 0000000..9099f1c Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Clothes.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Eyes.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Eyes.gif new file mode 100644 index 0000000..151e101 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Eyes.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Folder.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Folder.gif new file mode 100644 index 0000000..18c83dd Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Folder.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gesture.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gesture.gif new file mode 100644 index 0000000..7314a39 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gesture.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gestures.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gestures.gif new file mode 100644 index 0000000..36ba7d9 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gestures.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gloves.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gloves.gif new file mode 100644 index 0000000..63d1999 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Gloves.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Hair.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Hair.gif new file mode 100644 index 0000000..8cb1fde Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Hair.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Inventory.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Inventory.gif new file mode 100644 index 0000000..18c83dd Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Inventory.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Jacket.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Jacket.gif new file mode 100644 index 0000000..ddaf8ee Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Jacket.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmark.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmark.gif new file mode 100644 index 0000000..b6d62ee Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmark.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmarks.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmarks.gif new file mode 100644 index 0000000..069677f Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Landmarks.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Lost And Found.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Lost And Found.gif new file mode 100644 index 0000000..1ba8dc7 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Lost And Found.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecard.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecard.gif new file mode 100644 index 0000000..f411fcd Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecard.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecards.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecards.gif new file mode 100644 index 0000000..3bc9e19 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Notecards.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Object.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Object.gif new file mode 100644 index 0000000..d26b4ad Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Object.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Objects.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Objects.gif new file mode 100644 index 0000000..09882c8 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Objects.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Pants.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Pants.gif new file mode 100644 index 0000000..e01e42f Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Pants.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Photo Album.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Photo Album.gif new file mode 100644 index 0000000..8fb54ff Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Photo Album.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Prim.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Prim.gif new file mode 100644 index 0000000..d26b4ad Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Prim.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Project.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Project.gif new file mode 100644 index 0000000..fe252af Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Project.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Script.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Script.gif new file mode 100644 index 0000000..90f2467 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Script.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Scripts.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Scripts.gif new file mode 100644 index 0000000..e0a61f1 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Scripts.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shape.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shape.gif new file mode 100644 index 0000000..8b4c113 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shape.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shirt.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shirt.gif new file mode 100644 index 0000000..7c6e6d4 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shirt.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shoes.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shoes.gif new file mode 100644 index 0000000..a74ee6e Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Shoes.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skin.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skin.gif new file mode 100644 index 0000000..ba2b0c6 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skin.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skirt.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skirt.gif new file mode 100644 index 0000000..a785d00 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Skirt.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Snapshot.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Snapshot.gif new file mode 100644 index 0000000..6f51085 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Snapshot.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Socks.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Socks.gif new file mode 100644 index 0000000..caed41f Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Socks.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Solution.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Solution.gif new file mode 100644 index 0000000..f230f5b Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Solution.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sound.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sound.gif new file mode 100644 index 0000000..71f8f41 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sound.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sounds.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sounds.gif new file mode 100644 index 0000000..841c56a Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Sounds.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Texture.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Texture.gif new file mode 100644 index 0000000..a1185f7 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Texture.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Textures.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Textures.gif new file mode 100644 index 0000000..11bee71 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Textures.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Trash.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Trash.gif new file mode 100644 index 0000000..e2f1f93 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Trash.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Underpants.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Underpants.gif new file mode 100644 index 0000000..0d8d876 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Underpants.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Undershirt.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Undershirt.gif new file mode 100644 index 0000000..4505002 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Undershirt.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.Unknown.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Unknown.gif new file mode 100644 index 0000000..8412424 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.Unknown.gif differ diff --git a/obj/Debug/LSLEditor.ImagesSolutionExplorer.question.gif b/obj/Debug/LSLEditor.ImagesSolutionExplorer.question.gif new file mode 100644 index 0000000..8412424 Binary files /dev/null and b/obj/Debug/LSLEditor.ImagesSolutionExplorer.question.gif differ diff --git a/obj/Debug/LSLEditor.LSLEditorForm.resources b/obj/Debug/LSLEditor.LSLEditorForm.resources new file mode 100644 index 0000000..c87de1b Binary files /dev/null and b/obj/Debug/LSLEditor.LSLEditorForm.resources differ diff --git a/obj/Debug/LSLEditor.NewProject.resources b/obj/Debug/LSLEditor.NewProject.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.NewProject.resources differ diff --git a/obj/Debug/LSLEditor.PermissionsForm.resources b/obj/Debug/LSLEditor.PermissionsForm.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.PermissionsForm.resources differ diff --git a/obj/Debug/LSLEditor.Properties.Resources.resources b/obj/Debug/LSLEditor.Properties.Resources.resources new file mode 100644 index 0000000..6b8c1da Binary files /dev/null and b/obj/Debug/LSLEditor.Properties.Resources.resources differ diff --git a/obj/Debug/LSLEditor.Resource.About.htm b/obj/Debug/LSLEditor.Resource.About.htm new file mode 100644 index 0000000..3602b03 --- /dev/null +++ b/obj/Debug/LSLEditor.Resource.About.htm @@ -0,0 +1,212 @@ + + + About LSL-Editor + + + + Special thanks to:
+
+ +
    + +
  • Vlad Bjornson
  • +
  • Mazok Nishi
  • +
  • Sonja Manatiso
  • +
  • Hippi Hammerer
  • + +
  • Baron Hauptmann
  • +
  • Arfim Balut
  • +
  • Thelma Huet
  • + +
  • Rand Charleville
  • +
  • MeAm Okelly
  • +
  • krishna Kanik
  • +
  • Smoere Broek
  • + +
  • Frederick Zanzibar
  • +
  • Andon Beattie
  • +
  • Rejha Vuckovic
  • +
  • Alidar Moxie
  • +
  • Al Supercharge
  • + +
  • Krissmas Merryman
  • +
  • Jolan Fonda
  • +
  • Hippi Hammerer
  • +
  • Sonja Manatiso
  • + +
  • Chase Marellan
  • +
  • Dui Zhang
  • +
  • Scott Diener
  • +
  • Nakiakekai Heliosense
  • + +
  • Adalace Jewell
  • +
  • Dave Dennis
  • +
  • Scythe Elfenbeim
  • +
  • Rynnan Riggles
  • +
  • SynCere Talon
  • +
  • Maxis Neely
  • + +
  • Nightwind Redgrave
  • +
  • WaMark Basevi
  • +
  • Brett Henley
  • +
  • Wam7c Macchi
  • +
  • Wen Grian
  • +
  • Reno Folland
  • +
  • Deven Lefavre
  • +
  • Suepahfly Streeter
  • +
  • Hector Greenspan
  • + +
  • Ricky Lucero
  • +
  • Miguel Yesheyev
  • +
  • Lisa Flatley
  • +
  • Vico Torok
  • +
  • Indigo Mertel
  • +
  • JenniferD Noel
  • +
  • Tabitha Greenspan
  • +
  • Pol McLaglen
  • + +
  • Mitchmiester Slade
  • +
  • Murie Lynagh
  • + +
  • Madgeek Nixdorf
  • +
  • Alexin Auer
  • +
  • Trance Broek
  • +
  • Blackstone Market
  • +
  • Dana Mureaux
  • + +
  • Dig Somme
  • +
  • ichiro Kiama
  • +
  • Theo Outlander
  • + +
  • Saul Kish
  • +
  • Sempronio Barbosa
  • +
  • Capt Blinker
  • +
  • Debbie Trilling
  • +
  • Nigel Beaumont
  • +
  • Billboard Kidd
  • + +
  • Ryder Dryke
  • +
  • Sylvia Baxter
  • + +
  • Wolt Amat
  • +
  • Matthew White
  • +
  • Ruth Chabay
  • +
  • Ricky Lucero
  • +
  • Nico van Klaveren
  • +
  • SummerDale Beckstrand
  • + +
  • Wen Grian
  • +
  • SK Decosta
  • +
  • Agathos Frascati
  • + +
  • Rhianne Darkstone
  • +
  • Wolt Amat
  • + +
  • Tarquin Janus
  • +
  • Costas Menico
  • +
  • Piet Garfield
  • +
  • Stephane Zugzwang
  • + +
  • WaMark Basevi
  • +
  • Agathos Frascati
  • +
  • Al Supercharge
  • +
  • Pencilsky Germi
  • +
  • Kii Lilliehook
  • + +
  • Metal Gynoid
  • +
  • Indigo Mertel
  • +
  • Tee Tulip
  • +
  • Frans Carbaat
  • +
  • Orcian Longstaff
  • +
  • Salid Sewell
  • +
  • AnnMarie Coronet
  • +
  • constantin klein
  • +
  • Dan Hartshorn
  • +
  • Second Nature 3
  • +
  • Trevor Langdon
  • +
  • Lecalat Starbrook
  • +
  • Jesse Barnett
  • +
  • Daniel Quigley
  • +
  • Chavo Raven
  • +
  • Gerral Hubbard
  • +
  • DrDoug Pennell
  • +
  • Forest Klaar
  • +
  • Gearsawe Stonecutter
  • + +
  • Avian Islands
  • +
  • Bernard Davis
  • +
  • DangerDave Writer
  • +
  • Olivier Jeanjean
  • +
  • Mo Hax
  • +
  • Salahzar Stenvaag
  • + +
  • Kirrineth Dragonash
  • +
  • Rock Vacirca
  • +
  • Maeva Anatine
  • +
  • Lois Laughton
  • + +
  • Elizabeth Didier
  • +
  • Hiroshi Iuga
  • +
  • Susan Koltai
  • +
  • Klaus-E Klingner
  • +
  • Bimble
  • + +
  • Richard Collins
  • +
  • Ralph Brown
  • + +
  • Igorbar Barbosa
  • +
  • Ichiro Kiama
  • +
  • Fletcher Rock
  • + +
  • Zoe Gauvreau
  • +
  • Luca Peck
  • +
  • James Leach
  • +
  • Michael Schneider
  • + +
  • Basel Janus
  • +
  • Petersnow Hyun
  • +
  • Itsme Frederix
  • +
  • Moard Ling
  • + +
  • Diosnegro Bertolucci
  • +
  • Hiroza Hird
  • + +
  • Cale Vinson
  • +
  • Yenzo Cortes
  • +
  • Malcolm J. Kudra
  • +
  • Robert Hayden
  • +
  • John Stout
  • +
  • Jim McElhiney
  • +
  • Sergey Mirontsev
  • +
  • David S
  • +
  • Never 30
  • +
  • Maurice 'colorstonic'
  • +
  • Ricc Harding
  • +
  • Thomas 'Angeldust'
  • +
  • Sally LaSalle
  • +
  • Sebastian Fuentes
  • +
  • Sandra Lee
  • +
  • Dimentox Travanti
  • +
  • Peter Swales
  • +
  • Nicole Wells
  • +
  • Matthew Oberlin
  • +
  • Lee 'Sailer' Ponzu
  • +
  • Marco Piazza
  • +
  • Darek Deluca
  • +
  • Johannes Rajala
  • +
  • Till Stirling
  • +
  • CharlyM3 Foden
  • +
  • Gerry Woolfenden
  • +
  • Michael Powell
  • +
  • Ronin DeVinna www.slportugal.com
  • +
  • Toran Cult
  • +
  • Strife Onizuka
  • +
  • Sandra Tsure
  • +
+
+ + + + \ No newline at end of file diff --git a/obj/Debug/LSLEditor.Resource.ConfCSharp.xml b/obj/Debug/LSLEditor.Resource.ConfCSharp.xml new file mode 100644 index 0000000..03186fc --- /dev/null +++ b/obj/Debug/LSLEditor.Resource.ConfCSharp.xml @@ -0,0 +1,102 @@ + + + + + //.* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/obj/Debug/LSLEditor.Resource.ConfLSL.xml b/obj/Debug/LSLEditor.Resource.ConfLSL.xml new file mode 100644 index 0000000..d6950c0 --- /dev/null +++ b/obj/Debug/LSLEditor.Resource.ConfLSL.xml @@ -0,0 +1,4118 @@ + + + + //.* + + + "[^"\\]* (?>\\.[^"\\]*)*" + + + \+\+|\-\-|\<\<|\>\>|\<\=|\>\=|\=\=|\!\=|\&\&|\|\||\+\=|\-\=|\*\=|\/\=|\%\= + + + [+-]?0x[\da-fA-F.p]+ | [-+]?\d* \.?\d+([eE][-+]?\d+)? + + + + + + + + + + + + All scripts must have a default state, + which also must be the first state entered when the script starts. + If another state is defined before the default state, + the compiler will report a syntax error. + + + + + + + + + + + + + + + + + + + + + + + + Complete listing of the Linden Library function calls available in lsl. + + + string llStringTrim(string text, integer trim_type); + + Outputs a string eliminating whitespace from the start and/or end of the specified string. + + Constants for trim_type: + STRING_TRIM_HEAD: trim all leading spaces in text + STRING_TRIM_TAIL: trim all trailing spaces in text + STRING_TRIM: trim all leading and trailing spaces in text + string to trim + STRING_TRIM_HEAD,STRING_TRIM_TAIL or STRING_TRIM + + + + void llSetLinkPrimitiveParams(integer linknumber, list rules); + + Sets the parameters (or properties) of any linked prim in none step + + + + void llSetLinkTexture(integer linknumber, string texture, integer face); + + Sets the texture of linked prims + + + + integer llGetObjectPrimCount(key id); + + Returns the prim count for any object id in the same sim. + + + + list llGetParcelDetails(vector pos, list details); + + Returns of a list of the details in the order they are in the details list, + for the parcel at pos. pos is in absolute region coordinates. + + + + integer llGetParcelMaxPrims(vector pos, integer sim_wide); + + + + integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide); + + Returns the number of prims used on the parcel at pos which are in category. + + If sim_wide is TRUE, it returns the number of objects + for the entire sim in the category specified. + If sim_wide is FALSE, it returns the number of objects + on this specific parcel in the category specified + region coordinate + a PARCEL_COUNT_* flag + Can be TRUE or FALSE + + + + list llGetParcelPrimOwners(vector pos); + + Returns a strided list of keys and integers of up to 100 + agents who own objects in the parcel at pos. + The list is formatted as + [ key agentKey1, integer agentCount1, key agentKey2, integer agentCount2, ... ], + sorted by agent key. + The integers are counts of the number of prims (not objects) + owned by the corresponding agents. + Sleeps the script for 2.0 seconds. + Function only works when the object owner is in the sim + (likely the reason it doesn't work when deeded to group). + + + + integer llAbs(integer val); + + Returns the absolute value of val. + + + float llAcos(float val); + + Returns the arccosine in radians of val. + + + llAddToLandPassList(key avatar, float hours); + + Add avatar to the land pass list for hours. + + + llAdjustSoundVolume(float volume); + + Adjusts the volume of the currently playing attached sound started + with llPlaySound or llLoopSound. + This function Has no effect on sounds started with llTriggerSound. + + + llAllowInventoryDrop(integer add); + + If add == TRUE, users that do no have object modify permissions can + still drop inventory items onto object. + + + float llAngleBetween(rotation a, rotation b); + + Returns the angle in radians between rotations a and b. + + + llApplyImpulse(vector force, integer local); + + Applies the impulse in local coordinates if local == TRUE. + Otherwise the impulse is applied in global coordinates. + This function only works on physical objects. + + + llApplyRotationalImpulse(vector force, integer local); + + Applies a rotational impulse force in local coordinates if local == TRUE. + Otherwise the impulse is applied in global coordinates. + This function only works on physical objects. + + + float llAsin(float val); + + Returns the arcsine in radians of val. + + + float llAtan2(float y, float x); + + returns the arctangent2 of y, x + + + llAttachToAvatar(integer attachment); + + Attach to avatar at point attachment. + Requires the PERMISSION_ATTACH runtime permission. + + + + key llAvatarOnSitTarget(void); + + If an avatar is sitting on the sit target, return the avatars key, + NULL_KEY otherwise. This only will detect + avatars sitting on sit targets defined with llSitTarget. + + + rotation llAxes2Rot(vector fwd, vector left, vector up); + + Returns the rotation represented by coordinate axes fwd, left, and up. + + + rotation llAxisAngle2Rot(vector axis, float angle); + + Returns the rotation generated angle about axis. + + + llBreakAllLinks(void); + + Delinks all objects in the link set. + Requires the permission PERMISSION_CHANGE_LINKS be set. + + + llBreakLink(integer linknum); + + Delinks the object with the given link number. + Requires permission PERMISSION_CHANGE_LINKS be set. + + + list llCSV2List(string src); + + Create a list from a string of comma separated values specified in src. + + + integer llCeil(float val); + + Returns largest integer value >= val. + + + float llCloud(vector offset); + + Returns the cloud density at the object position + offset. + + + llCollisionFilter(string name, key id, iteger accept); + + If accept == TRUE, only accept collisions with objects name and id, + otherwise with objects not name or id. + Specify an empty string or NULL_KEY to not filter + on the corresponding parameter. + + + llCollisionSound(string impact_sound, float impact_volume); + + Suppress default collision sounds, replace default impact sounds + with impact_sound found in the object inventory. + Supply an empty string to suppress collision sounds. + + + llCollisionSprite(string impact_sprite); + + Suppress default collision sprites, replace default impact sprite + with impact_sprite found in the object inventory. + Supply an empty string to just suppress. + + + float llCos(float theta); + + Returns the cosine of thetaradians. + + + llCreateLink(key target, integer parent); + + Attempt to link object script is attached to and target. + Requires permission PERMISSION_CHANGE_LINKS be set. + If parent== TRUE, object script is attached to is the root. + + + + + list llDeleteSubList(list src, integer start, integer end); + + Remove the slice from the list and return the remainder. + The start and end are inclusive, so 0, length -1 would delete the + entire list and 0,0 would delete the first list entry. + Using negative numbers for start and/or end causes the index to count + backwards from the length of the list, so 0,-1 would delete the entire + list. If start is larger than end the list deleted is the exclusion + of the entries, so 6,4 would delete the entire list except + for the 5th list entry. + + + string llDeleteSubString(string src, integer start, integer end); + + Removes the indicated substring and returns the result. + The start and end are inclusive, so 0,length-1 would + delete the entire string and 0,0 would delete the first character. + Using negative numbers for start and/or end causes the index to + count backwards from the length of the string, so 0,-1 would + delete the entire string. If start is larger than end the sub string + is the exclusion of the entries, so 6,4 would delete the entire string + except for the 5th character. + + + llDetachFromAvatar(void); + + Drop off of avatar. + + + vector llDetectedGrab(integer number); + + Returns the grab offset of detected object number. + Returns <0,0,0> if number is not valid sensed object. + + + key llDetectedKey(integer number); + + Returns the key of detected object number. + Returns NULL_KEY if number is not valid sensed object. + + + integer llDetectedLinkNumber(integer number); + + Returns the link position of the triggered event for touches. + 0 for a non-linked object, 1 for the root of a linked + object, 2 for the first child, etc. + + + string llDetectedName(integer number); + + Returns the name of detected object number. + Returns empty string if number is not valid sensed object. + + + key llDetectedOwner(integer number); + + Returns the key of detected number objects owner. + Returns invalid key if number is not valid sensed object. + + + vector llDetectedPos(integer number); + + Returns the position of detected object number. + Returns <0,0,0> if number is not valid sensed object. + + + rotation llDetectedRot(integer number); + + Returns the rotation of detected object number. + Returns <0,0,0,1> if number is not valid sensed object. + + + integer llDetectedType(integer number); + + Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object + number. Returns 0 if number is not valid sensed object. + Note that number is a bitfield, so comparisons need to be a bitwise + and check. eg: + integer type = llDetectedType(0); + if (type and AGENT) + { + // ...do stuff with the agent + } + + + vector llDetectedVel(integer number); + + Returns the velocity of detected object number. + Returns <0,0,0 and > + if number is not valid sensed object. + + + llDialog(key avatar, string message, list buttons, integer channel); + + Opens a "notify box" in the top-right corner of the given avatars + screen displaying the message. Up to four + buttons can be specified in a list of strings. When the player + clicks a button, the name of the button is chatted on + the specified channel. Channels work just like llSay(), + so channel 0 can be heard by everyone. The chat + originates at the objects position, not the avatars position. e.g. + llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], 4913); + llDialog(who, "This shows only an OK button.", [], 192); + llDialog(who, "This chats so you can hear it.", ["Hooray"], 0); + + + llDie(void); + + Delete the object which holds the script. + + + string llDumpList2String(list src, string separator); + + Write the list out in a single string using separator between values. + + + integer llEdgeOfWorld(vector pos, vector dir); + + Returns TRUE if the line along dir from poshits the edge + of the world in the current simulator and returns + FALSE if that edge crosses into another simulator. + + + llEjectFromLand(key pest); + + Ejects pestfrom land that you own. + + + llEmail(string address, string subject, string message); + + Sends email to addresswith subjectand message. + + + rotation llEuler2Rot(vector vec); + + Returns the rotation represented by Euler Angle vec. + + + float llFabs(float val); + + Returns the absolute value of val. + + + integer llFloor(float val); + + Returns largest integer value<= val. + + + float llFrand(float mag); + + Returns a pseudo-random number between [0, mag). + + + vector llGetAccel(void); + + Gets the acceleration. + + + integer llGetAttached(void); + + Returns the object attachment point or 0 if not attached. + + + integer llGetAgentInfo(key id); + + Returns information about the given agent id. Returns a bitfield + of agent info constants. + + + vector llGetAgentSize(key id); + + If the agent id is in the same sim as the object, returns + the size of the avatar. + + + float llGetAlpha(integer face); + + Returns the alpha of the given face. If faceis ALL_SIDES + the value returned is the mean average of all faces. + + + float llGetAndResetTime(void); + + Gets the time in seconds since creation and sets the time to zero. + + + string llGetAnimation(key id); + + Returns the currently playing animation for avatar id. + + + vector llGetCenterOfMass(void); + + Returns the center of mass of the root object. + + + vector llGetColor(integer face); + + Returns the color of face as a vector of red, green, and blue values + between 0 and 1. If face is ALL_SIDES + the color returned is the mean average of each channel. + + + string llGetDate(void); + + Returns the current UTC date as YYYY-MM-DD. + + + float llGetEnergy(void); + + Returns how much energy is in the object as a percentage of maximum. + + + vector llGetForce(void); + + Returns the current force if the script is physical. + + + integer llGetFreeMemory(void); + + Returns the available heap space for the current script. + + + key llGetInventoryKey(string name); + + Returns the key of the inventory name. + + + string llGetInventoryName(integer type, integer number); + + Get the name of the inventory item number of type. + Use the inventory constants to specify the type. + inventory item type + inventory item number + + + integer llGetInventoryNumber(integer type); + + Get the number of items of type in the object inventory. + Use the inventory constants to specify the type. + inventory item type + + + key llGetKey(void); + + Get the key for the object which has this script. + + + key llGetLandOwnerAt(vector pos); + + Returns the key of the land owner at posor NULL_KEY if public. + + + key llGetLinkKey(integer linknum); + + Returns the key of linknumin the link set. + + + string llGetLinkName(integer linknum); + + Returns the name of linknumin the link set. + + + integer llGetLinkNumber(void); + + Returns what link number in a link set the for the object + which has this script. 0 means no link, 1 the root, 2 for + first child, etc. + + + integer llGetListEntryType(list src, integer index); + + Returns the type of the variable at index in src. + + + integer llGetListLength(list src); + + Returns the number of elements in src. + + + vector llGetLocalPos(void); + + Returns the local position of a child object relative to the root. + + + rotation llGetLocalRot(void); + + Returns the local rotation of a child object relative to the root. + + + llGetNextEmail(string address, string subject); + + Get the next waiting email with appropriate addressand/or subject. + If the parameters are blank, they are not used for filtering. + + + key llGetNotecardLine(string name, integer line); + + This function fetches line number line of notecard name and returns + the data through the dataserver event. The line count starts at zero. + If the requested line is past the end of the notecard the dataserver + event will return the constant EOF string. + The key returned by this function is a unique identifier which will + be supplied to the dataserver event in the requested parameter. + + + integer llGetNumberOfSides(void); + + Returns the number of sides of the current object which has the script. + + + string llGetObjectName(void); + + Returns the name of the object which has the script. + + + vector llGetOmega(void); + + Returns the omega. + + + key llGetOwner(void); + + Returns the owner of the object. + + + key llGetOwnerKey(key id); + + Returns the owner of object id. + + + integer llGetPermissions(void); + + Returns what permissions have been enabled.eg: + + integer perm = llGetPermissions(); + if((perm and PERMISSION_DEBIT) == PERMISSION_DEBIT) + { + // code goes here + } + + + key llGetPermissionsKey(void); + + Returns avatar that has enabled permissions. + Returns NULL_KEY if not enabled. + + + vector llGetPos(void); + + Returns the position. + + + llGetRegionFPS(void); + + Returns the mean region frames per second. + + + string llGetRegionName(void); + + Returns the current region name. + + + float llGetRegionTimeDilation(void); + + Returns the current time dilation as a float between 0 and 1. + + + rotation llGetRot(void); + + Returns the rotation. + + + vector llGetScale(void); + + Returns the scale. + + + string llGetScriptName(void); + + Returns the name of this script. + + + integer llGetStartParameter(void); + + Returns the start parameter passed to llRezObject. + If the object was created from agent inventory, this function + returns 0. + + + integer llGetScriptState(string name); + + Resets TRUE if script nameis running + + + integer llGetStatus(integer status); + + Returns the value of status. + The value will be one of the status constants. + + + string llGetSubString(string src, integer start, integer end); + + Returns the indicated substring from src. The startand end are + inclusive, so 0,length-1 would capture the entire string and 0,0 + would capture the first character. Using negative numbers for + start and/or end causes the index to count backwards from the length + of the string, so 0,-1 would capture the entire string. + If start is larger than end the sub string is the exclusion of the + entries, so 6,4 would give the entire string + except for the 5th character. + + + vector llGetSunDirection(void); + + Returns the sun direction on the simulator. + + + string llGetTexture(integer face); + + Returns the texture of faceif it is found in object inventory. + + + vector llGetTextureOffset(integer side); + + Returns the texture offset of sidein the x and y components of a vector. + + + float llGetTextureRot(integer side); + + Returns the texture rotation of side. + + + vector llGetTextureScale(integer side); + + Returns the texture scale of sidein the x and y components of a vector. + + + float llGetTime(void); + + Returns the time in seconds since creation of this script. + + + float llGetTimeOfDay(void); + + Gets the time in seconds since midnight in Second Life. + + + vector llGetTorque(void); + + Returns the torque if the script is physical. + + + vector llGetVel(); + + Returns the velocity. + + + float llGetWallclock(void); + + Returns the time in seconds since simulator timezone midnight. + + + llGiveInventory(key destination, string inventory); + + Give the named inventory item to the keyed avatar or object in the + same simulator as the giver. If the recipient is an avatar, + the avatar then follows the normal procedure of accepting + or denying the offer. If the recipient is an object, + the same permissions apply as if you were dragging inventory + onto the object by hand, ie if llAllowInventoryDrop has been called + with TRUE, any other object can pass objects to its inventory. + + + llGiveInventoryList(key destination, string category, list inventory); + + Give the list of named inventory items to the keyed avatar or object + in the same simulator as the giver. If the recipient is an avatar, + the avatar then follows the normal procedure of accepting or denying + the offer. The offered inventory is then placed in a folder named + category in the recipients inventory. If the recipient is an object, + the same permissions apply as if you were dragging inventory onto the + object by hand, ie if llAllowInventoryDrop has been called with TRUE, + any other object can pass objects to its inventory.If the + recipient is an object, the category parameter is ignored. + + + llGiveMoney(key destination, integer amount); + + Transfer amountfrom the script owner to destination. + This call will fail if PERMISSION_DEBIT has not been set. + + + float llGround(vector offset); + + Retuns the ground hieght at the object position + offset. + + + vector llGroundContour(vector offset); + + Retuns the ground contour at the object position + offset. + + + vector llGroundNormal(vector offset); + + Retuns the ground contour at the object position + offset. + + + llGroundRepel(float height, integer water, float tau); + + Critically damps to heightif within height* 0.5 of level. + The heightis above ground level if water + is FALSE or above the higher of land and water if water is TRUE. + + + vector llGroundSlope(vector offset); + + Returns the ground slope at the object position + offset. + + + string llInsertString(string dst, integer position, string src); + + Inserts src into dst at position and returns the result. + + + llInstantMessage(key user, string message); + + Send messageto the user as an instant message. + + + string llKey2Name(key id); + + If object id is in the same simulator, return the name of the object. + + + string llList2CSV(list src); + + Create a string of comma separated values from list. + + + float llList2Float(list src, integer index); + + Returns the float at index in the list src. + + + integer llList2Integer(list src, integer index); + + Returns the integer at index in the list src. + + + key llList2Key(list src, integer index); + + Returns the key at index in the list src. + + + list llList2List(list src, integer start, integer end); + + Returns the slice of the list from startto end from the list + srcas a new list. The startand end parameters + are inclusive, so 0,length-1 would copy the entire list and 0,0 + would capture the first list entry. Using negative + numbers for startand/or end causes the index to count backwards + from the length of the list, so 0,-1 would + capture the entire list. If startis larger than end the list + returned is the exclusion of the entries, so 6,4 would + give the entire list except for the 5th entry. + + + list llList2ListStrided(list src, integer start, integer end, integer stride); + + Copy the strided slice of src from start to end. + + + rotation llList2Rot(list src, integer index); + + Returns the rotation at index in src. + + + string llList2String(list src, integer index); + + Returns the string at index in src. + + + llList2Vector(list src, integer index); + + Returns the vector at index in src. + + + integer llListFindList(list src, list test); + + Returns the position of the first instance of testin src. + Returns -1 if test is not in src. + + + list llListInsertList(list dest, list src, integer pos); + + Returns the list created by inserting src into dest at pos. + + + list llListRandomize(list src, integer stride); + + Returns srcrandomized into blocks of size stride. + If the length of srcdividided by strideis non-zero, + this function does not randomize the list. + + + list llListSort(list src, integer stride, integer ascending); + + Returns src sorted into blocks of stride in ascending order if + ascending is TRUE. Note that sort only + works in the head of each sort block is the same type. + list to sort + blocks of stride length + TRUE ascending sort result, FALSE = descending sort result + + + integer llListen(integer channel, string name, key id, string msg); + + Sets a listen event callback for msg on channel from name and + returns an identifier that can be used to + deactivate or remove the listen. The name, id and/or msg parameters + can be blank to indicate not to filter on + that argument. Channel 0 is the public chat channel that all avatars + see as chat text. Channels 1 to 2,147,483,648 + are hidden channels that are not sent to avatars. + + + llListenControl(integer number, integer active); + + Make a listen event callback active or inactive. Pass in the value + returned from llListen to the number parameter + to specify which event you are controlling. + Use boolean values to spcify active + + + llListenRemove(integer number); + + Removes a listen event callback. Pass in the value returned from + llListen to the number parameter to specify + which event you are removing. + + + llLookAt(vector target, float strength, float damping); + + Cause object to point the forward axis toward target. + Good strengthvalues are around half the mass of the + object and good damping values are less than 1/10th of the strength. + Asymmetrical shapes require smaller + damping. A strength of 0.0 cancels the look at. + + + llLoopSound(string sound, flaot volume); + + Similar to llPlaySound, this function plays a sound attached to an + object, but will continuously loop that sound + until llStopSound or llPlaySound is called. Only one sound may be + attached to an object at a time. A second call + to llLoopSound with the same key will not restart the sound, but the + new volume will be used. This allows + control over the volume of already playing sounds. Setting the + volumeto 0 is not the same as calling + llStopSound; a sound with 0 volume will continue to loop. + To restart the sound from the beginning, call + llStopSound before calling llLoopSound again. + + + llLoopSoundMaster(string sound, flaot volume); + + Behaviour is identical to llLoopSound, with the addition of marking + the source as a "Sync Master", causing + "Slave" sounds to sync to it. If there are multiple masters within + a viewers interest area, the most audible one (a + function of both distance and volume) will win out as the master. + The use of multiple masters within a small area + is unlikely to produce the desired effect. + + + llLoopSoundSlave(string sound, flaot volume); + + Behaviour is identical to llLoopSound, + unless there is a "Sync Master" present. If a Sync Master is already + playing the Slave sound will begin playing from the same point + the master is in its loop syncronizing the loop + points of both sounds. If a Sync Master is started when the Slave + is already playing, the Slave will skip to the + correct position to sync with the Master. + + + llMakeExplosion(integer particles, float scale, float velocity, float lifetime,float arc, string texture, vector offset); + + Make a round explosion of particles using texture from the objects inventory. + + + llMakeFire(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make fire particles using texturefrom the objects inventory. + + + llMakeFountain(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make a fountain of particles using texturefrom the objects inventory. + + + llMakeSmoke(integer particles, float scale, float velocity, float lifetime, float arc, string texture, vector offset); + + Make smoky particles using texturefrom the objects inventory. + + + llMessageLinked(integer linknum, integer num, string str, key id); + + Sends num, str, and id to members of the link set. + The linknumparameter is either the linked number + available through llGetLinkNumber or a link constant. + + + llMinEventDelay(float delay); + + Set the minimum time between events being handled. + + + llModifyLand(integer action, integer size); + + Modify land with action on size area. + The parameters can be chosen from the land constants. + LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT + LAND_SMALL_BRUSH, LAND_MEDIUM_BRUSH or LAND_LARGE_BRUSH + + + llMoveToTarget(vector target, float tau); + + Critically damp to position targetin tau-seconds if the + script is physical. Good tau-values are greater than 0.2. + A tau of 0.0 stops the critical damping. + + + llOffsetTexture(float offset_s, float offset_t, integer face); + + Sets the texture s and t offsets of face. + If faceis ALL_SIDES this function sets the texture offsets for + all faces. + + + integer llOverMyLand(key id); + + Returns TRUE if id is over land owned by the object owner, + FALSE otherwise. + + + list llParseString2List(string src, list separators, list spacers); + + Breaks src into a list, discarding anything in separators, + keeping any entry in spacers. The + separators and spacers must be lists of strings with a maximum + of 8 entries each. So, if you had made the + call: + llParseString2List("Parsethisnow! I dare:you to.", ["this", "!", " "], [":"]); + You would get the list: + ["Parse", "now", "I", "dare", ":", "you", "to"] + + + llParticleSystem(list parameters); + + Makes a particle system based on the parameter list. + The parametersare specified as an ordered list of + parameter and value. Valid parameters and their expected + values can be found in the particle system constants. + Here is a simple example: + llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_WIND_MASK, + PSYS_PART_START_COLOR, <1,0,0>, + PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE]); + + + llPassCollisions(integer pass); + + If passis TRUE, land and object collisions are passed from + children on to parents. + + + llPassTouches(integer pass); + + If passis TRUE, touches are passed from children on to parents. + + + llPlaySound(string sound, float volume); + + Plays a sound once. The sound will be attached to an object and + follow object movement. Only one sound may + be attached to an object at a time, and attaching a new sound or + calling llStopSound will stop the previously + attached sound. A second call to llPlaySound with the same sound + will not restart the sound, but the new + volume will be used, which allows control over the volume + of already playing sounds. To restart the sound from + the beginning, call llStopSound before calling llPlaySound again. + + + llPlaySoundSlave(string sound, float volume); + + Behaviour is identical to llPlaySound, unless there is + a "Sync Master" present. If a Sync Master is already + playing the Slave sound will not be played until the Master + hits its loop point and returns to the beginning. + llPlaySoundSlave will play the sound exactly once; if it is + desired to have the sound play every time the Master + loops, either use llLoopSoundSlave with extra silence padded + on the end of the sound or ensure that + llPlaySoundSlave is called at least once per loop of the Master. + + + llPointAt(vector pos); + + Make avatar that owns object point at pos. + + + llPow(float base, float exp); + + Returns baseraised to the exp. + + + llPreloadSound(string sound); + + Preloads sound from object inventory on nearby viewers. + + + llPushObject(key id, vector impulse, vector angular_impulse, integer local); + + Applies impulseand angular_impulseto object id. + + + llReleaseControls(key avatar); + + Stop taking inputs from avatar. + + + llRemoteLoadScript(key target, string name, integer running, integer param); + + If the owner of the object this script is attached can modify target + and the objects are in the same region, copy + script nameonto target, if running == TRUE, start the script with param. + If namealready exists on target, it is replaced. + + + llRemoveInventory(string inventory); + + Remve the name inventory item from the object inventory. + + + llRemoveVehicleFlags(integer flags); + + Sets the vehicle flagsto FALSE. Valid parameters can be found in the vehicle flags constants section. + + + key llRequestAgentData(key id, integer data); + + This function requests data about agent id. If and when the information + is collected, the dataserver event is + called with the returned key returned from this function passed in + the requested parameter. See the agent data + constants for details about valid values of dataand what each will + return in the dataserver event. + + + key llRequestInventoryData(string name); + + Requests data from object inventory item name. When data is available + the dataserver event will be raised with + the key returned from this function in the requested parameter. + The only request currently implemented is to + request data from landmarks, where the data returned is in the + form "<float, float, float>" which can be cast to a + vector. This position is in region local coordinates. + + + llRequestPermissions(key avatar, iteger perm); + + Ask avatar to allow the script to do perm. The permparameter should + be a permission constant. Multiple + permissions can be requested simultaneously by oring the + constants together. Many of the permissions requests + can only go to object owner. This call will not stop script + execution -if the specified avatar grants the requested + permissions, the run_time_permissions event will be called. + + + llResetScript(void); + + Resets this script. + + + llResetOtherScript(string name); + + Resets the script name. + + + llResetTime(void); + + Sets the internal timer to zero. + + + llRezObject(string inventory, vector pos, vector vel, rotation rot, integer param); + + Creates objects inventory object at position poswith velocity + veland rotation rot. The paramvalue + will be available to the newly created object in the on_rez + event or through the llGetStartParameter library + function. The velparameter is ignored if the rezzed object + is not physical. + + + float llRot2Angle(rotation rot); + + Returns the rotation angle represented by rot. + + + vector llRot2Axis(rotation rot); + + Returns the rotation axis represented by rot. + + + vector llRot2Euler(rotation rot); + + Returns the Euler Angle representation of rot. + + + vector llRot2Fwd(rotation rot); + + Returns the forward axis represented by rot. + + + vector llRot2Left(rotation rot); + + Returns the left axis represented by rot. + + + vector llRot2Up(rotation rot); + + Returns the up axis represented by rot. + + + rotation llRotBetween(vector a, vector b); + + Returns the rotation needed to rotate ato b. + + + llRotLookAt(rotation rot, float strength, float damping); + + Cause object to rotate to rot. Good strengthvalues are around + half the mass of the object and good + damping values are less than 1/10th of the strength. + Asymmetrical shapes require smaller damping.A + strengthof 0.0 cancels the look at. + + + integer llRotTarget(rotation rot, float error); + + Set object rotation within error of rotationas a rotational + target and return an integer number for the + target. The number can be used in llRotTargetRemove. + + + llRotTargetRemove(integer number); + + Remove rotational target number. + + + llRotateTexture(float radians, integer face); + + Sets the texture rotation of faceto radians. + If faceALL_SIDES, rotate the texture of all faces. + + + integer llRound(float val); + + returns valrounded to the nearest integer. + + + integer llSameGroup(key id); + + Returns TRUE if the object or agen id is in the same simulator + and has the same active group as this object. + Otherwise, returns FALSE. + + + llRegionSay(integer channel, string text); + + Says the string text on channel number channel that can be heard + anywhere in the region by a script listening on channel. + + Any integer value other than zero + Message to be transmitted + + + llSay(integer channel, string text); + + Say text on channel. Channel 0 is the public chat channel that all + avatars see as chat text. Channels 1 to 2,147,483,648 are private + channels that are not sent to avatars but other scripts can listen + for through the llListen api. + Channel to use to say text on + Text to say + + + llScaleTexture(float horizontal, float vertical, integer side); + + Sets the horizontal and vertical repeats per face on side. + If side == ALL_SIDES, all sides are set in one call. + Negative values for horizontal and vertical will flip the texture. + + + integer llScriptDanger(vector pos); + + Returns true if pos is over public land, land that doesnt allow everyone + to edit and build, or land that doesnt allow outside scripts. + + + llSensor(string name, key id, integer type, float range, float arc); + + Performs a single scan for nameand id with typewithin + rangemeters and arcradians of forward vector. + Specifying a blank name or NULL_KEY id will not filter + results for any particular name or id A range of 0.0 + does not perform a scan. The typeparameter should be an + object type constant vlaue. + + + llSensorRemove(void); + + Removes the sensor. + + + llSensorRepeat(string name, key id, integer type, float range, float arc, float rate); + + Performs a repeating sensor scan for name and id with type + (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within range meters and arc + radians of forward vector (name and/or id can be empty or 0). + A range of 0.0m does perform a scan. The parameters have the same + function as llSensor, except rate, which defines the number of + seconds between repeated sensor or no_sensor event calls. + + + llSetAlpha(float alpha, integer face); + + Sets the alpha value for face. If face is ALL_SIDES, + set the alpha to all faces. The alphavalue is interpreted + as an opacity percentage -1.0 is fully opaque, and 0.2 is + mostly transparent. This api will clamp alphavalues + less 0.1 to .1 and greater than 1.0 to 1. + + + llSetBuoyancy(float buoyancy); + + Set the object buoyancy. A value of 0 is none, + less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises. + + + llSetCameraAtOffset(vector offset); + + Sets the camera at offset used in this object + if an avatar sits on it. + + + llSetCameraEyeOffset(vector offset); + + Sets the camera eye offset used in this object if an avatar sits on it. + + + llSetColor(vector color, integer face); + + Sets the color of face. If face is ALL_SIDES, set the color to all faces. + + + llSetDamage(float damage); + + Sets the amount of damage that will be done to an object + that this object hits. This object will be destoyed on + damaging another object. + + + llSetForce(vector force, integer local); + + If the object is physical, this function sets the force. + The vector is in loal coordinates if local is TRUE, global if + FALSE. + + + llSetForceAndTorque(vector force, vector torque, integer local); + + If the object is physical, this function sets the forceand + torque. The vectors are in loal coordinates if local is + TRUE, global if FALSE. + + + llSetHoverHeight(float height, float water, float tau); + + Critically damps to a height. The height is above ground + and water if water is TRUE. + + + llSetLinkColor(integer linknumber, vector color, integer face); + + Sets the color of the linked child specified by linknumber. + A value of 0 means no link, 1 the root, 2 for first + child, etc. If linknumber is ALL_SIDES, set the color + of all objects in the linked set. If faceis + ALL_SIDES, set the color of all faces. + + + llSetObjectName(string name); + + Sets the object name to name. + + + llSetPos(vector pos); + + If the object is not physical, this function sets the position + in region coordinates. If the object is a child, the + position is treated as root relative and the linked set is adjusted. + + + llSetRot(rotation rot); + + If the object is not physical, this function sets the rotation. + If the object is a child, the position is treated as root + relative and the linked set is adjusted. + + + llSetScale(vector scale); + + Sets the object scale. + + + llSetScriptState(string name, integer run); + + Control the state of a script on the object. + + + llSetSitText(string text); + + Displays textrather than sit in viewer pie menu. + + + llSetSoundQueueing(integer queue); + + Sets whether successive calls to llPlaySound, llLoopSound, + etc., (attached sounds) interrupt the playing sound. + The default for objects is FALSE. Setting this value to + TRUE will make the sound wait until the current playing + sound reaches its end. The queue is one level deep. + + + llSetStatus(integer status, integer value); + + Sets the statusto value. Use status constants for the values of status. + + + llSetText(string text, vector color, float alpha); + + Sets text that floats above object to text, + using the specified color and alpha. + + + llSetTexture(string texture, integer face); + + Sets the texturefrom object inventory of face. + If face is ALL_SIDES, set the texture to all faces. + + + llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate); + + Animates a texture by setting the texture scale and offset. + The mode is a mask of texture animation constants. + You can only have one texture animation on an object, + calling llSetTextureAnim more than once on an object + will reset it. + You can only do one traditional animation, ROTATE or SCALE + at a time, you cannot combine masks. In the case + of ROTATE or SCALE, sizex and sizey are ignored, and startand + lengthare used as the start and + length values of the animation. For rotation, startand lengthare + in radians. + The facespecified which face to animate. If faceis ALL_SIDES, + all textures on the object are animated. + The sizex and sizey describe the layout of the frames within + the texture. sizex specifies how many + horizontal frames and sizey is how many vertical frames. + startis the frame number to begin the animation on. Frames + are numbered from left to right, top to bottom, + starting at 0. + lengthis the number of frames to animate. 0 means to animate + all frames after the start frame. + rateis the frame rate to animate at. 1.0 means 1 frame per + second, 10.0 means 10 frames per second, etc. + + + llSetTimerEvent(float sec); + + Sets the timer event to be triggered every secseconds. + Passing in 0.0 stops further timer events. + + + llSetTorque(vector torque, integer local); + + If the object is physical, this function sets the torque. + The vector is in loal coordinates if local is TRUE, global + if FALSE. + + + llSetTouchText(string text); + + Displays textin viewer pie menu that acts as a touch. + + + llSetVehicleFlags(integer flags); + + Sets the vehicle flagsto TRUE. + Valid parameters can be found in the vehicle flags constants section. + + + llSetVehicleFloatParam(integer param_name, float param_value); + + Sets the vehicle floating point parameter param_nameto param_value. + Valid parameters and their expected + values can be found in the vehicle parameter constants section. + + + llSetVehicleType(integer type); + + Activates the vehicle action and choose vehicle type. + Valid types and an explination of their characteristeics + can be found in the vehicle type constants section. + + + llSetVehicleRotationParam(integer param_name, rotation param_value); + + Sets the vehicle rotation parameter param_nameto param_value. + Valid parameters can be found in the + vehicle parameter constants section. + + + llSetVehicleVectorParam(integer param_name, vector param_value); + + Sets the vehicle vector parameter param_nameto param_value. + Valid parameters can be found in the + vehicle paramter constants section. + + + llShout(integer channel, string text); + + Shout texton channel. Channel 0 is the public chat channel that + all avatars see as chat text. Channels 1 to + 2,147,483,648 are private channels that are not sent to + avatars but other scripts can listen for through the llListen api. + + + float llSin(float theta); + + Returns the sine of thetain radians. + + + llSitTarget(vector offset, rotation rot); + + Set the sit location for this object. If offset == ZERO_VECTOR + clear the sit target. + + + llSleep(float sec); + + Puts the script to sleep for secseconds. + + + float llSqrt(float val); + + Returns the square root of val. If valis less than 0.0, + this function returns 0.0 and raises a math runtime error. + + + llStartAnimation(string anim); + + This function starts animation anim for the avatar that owns the object. + + + llStopAnimation(string anim); + + Stop animation animfor avatar that owns object. + + + llStopHover(void); + + Stop hover to a height. + + + llStopLookAt(void); + + Stop causing object to look at target. + + + llStopMoveToTarget(void); + + Stops critically damped motion. + + + llStopPointAt(void); + + Stop avatar that owns object pointing. + + + llStopSound(void); + + Stops a currently playing attached sound started with + llPlaySound or llLoopSound. Has no effect on sounds + started with llTriggerSound. + + + integer llStringLength(string src); + + Returns the number of characters in src. + + + integer llSubStringIndex(string source, string pattern); + + Finds index in source where pattern first appears. + Returns -1 if no match is found found. + + + llTakeControls(integer controls, integer accept, integer pass_on); + + If (accept== (controls and input)), send input to object. + If the boolean pass_onis TRUE, also send input + to avatar. + + + float llTan(float theta); + + Returns the tangent of thetaradians. + + + integer llTarget(vector position, float range); + + Set object position within rangeof positionas a target + and returns an integer ID for the target. + + + llTargetOmega(vector axis, float spinrate, float gain); + + Attempt to spin at spinratewith strength gainon axis. + A spinrateof 0.0 cancels the spin. This + function always works in object local coordinates. + + + llTargetRemove(integer tnumber); + + Remove target number tnumber. + + + llTeleportAgentHome(key id); + + Teleport agent on the owners land to agents home location. + + + string llToLower(string src); + + Returns src in all lower case. + + + string llToUpper(string src); + + Returns src in all upper case. + + + llTriggerSound(string sound, float volume); + + Plays a transient sound NOT attached to an object. + The sound plays from a stationary position located at the + center of the object at the time of the trigger. + There is no limit to the number of triggered sounds which can be + generated by an object, and calling llTriggerSound does not affect + the attached sounds created by llPlaySound + and llLoopSound. This is very useful for things like collision noises, + explosions, etc. There is no way to stop or + alter the volume of a sound triggered by this function. + + + llTriggerSoundLimited(string sound, float volume, vector tne, vector bsw); + + Plays a transient sound NOT attached to an object with its + audible range limited by the axis aligned bounding + box define by tne(top-north-eash) and bsw (bottom-south-west). + The sound plays from a stationary position + located at the center of the object at the time of the trigger. + There is no limit to the number of triggered sounds + which can be generated by an object, and calling llTriggerSound + does not affect the attached sounds created by + llPlaySound and llLoopSound. This is very useful for things + like collision noises, explosions, etc. There is no + way to stop or alter the volume of a sound triggered by this function. + + + llUnSit(key id); + + If agent identified by id is sitting on the object the script + is attached to or is over land owned by the objects + owner, the agent is forced to stand up. + + + float llVecDist(vector a, vector b); + + Returns the distance from ato b + + + float llVecMag(vector vec); + + Returns the magnitude of vec. + + + vector llVecNorm(vector vec); + + Returns normalized vec. + + + llVolumeDetect(integer detect); + + When detect = TRUE, this makes the entire link set the script + is attached to phantom but if another object + interpenetrates it, it will get a collision_start event. + When an object stops interpenetrating, a collision_end event + is generated. While the other is interpenetrating, + collision events are NOT generated. The script must be applied + to the root object of the link set to get the collision events. + Collision filters work normally. + + + float llWater(vector offset); + + Returns the water height at the object position + offset. + + + llWhisper(integer channel, string text); + + Whisper texton channel. Channel 0 is the public chat channel that + all avatars see as chat text. Channels 1 to 2,147,483,648 are + private channels that are not sent to avatars but other scripts + can listen for through the llListen api. + + + vector llWind(vector offset); + + Returns the wind velocity below the object position + offset. + + + llAddToLandBanList(key agent, float hours); + + Adds agent to the parcel ban list for the specified number of hours. + A value of 0 for hours will add agent indefinitely. + The smallest value hours will accept is 0.01; + anything smaller will be seen as 0. + When values that small are used, it seems the function bans + in 30 second increments (Probably 36 second increments, + as 0.01 of an hour is 36 seconds). + Residents teleporting to a parcel where they are banned + will be redirected to a neighboring parcel. + + + integer llBase64ToInteger(string str); + + Little endian decode the 8 character Base64 string str into an integer. + + + string llBase64ToString(string str); + + Converts a Base 64 string to a conventional string. + If the conversion creates any unprintable characters, they are converted to question marks (this behavior is different then llUnescapeURL). + + + llClearCameraParams(); + + Resets all camera parameters to default values and turns + off scripted camera control. + + + llCloseRemoteDataChannel(key channel); + + Closes XML-RPC channel. + + + integer llDetectedGroup(integer number); + + Returns TRUE if detected object or agent number has the same + user group active as this object. + It will return FALSE if the object or agent is in the group, + but the group is not active. + + + string llEscapeURL(string url); + + Returns the string that is the URL-escaped version of url + (replacing spaces with %20, etc). + This function returns the UTF-8 encoded escape codes + for selected characters. + + + llForceMouselook(integer mouselook); + + After calling this function with mouselook set to TRUE, + any agent sitting down on the prim will be forced into mouselook. + Just like llSitTarget, this changes a permanent property + of the prim (not the object) and needs to be reset by calling + this function with mouselook set to FALSE in order to disable it. + + + list llGetAnimationList(key id); + + Returns a list of keys of all playing animations for avatar id. + + + list llGetBoundingBox(key object); + + Returns the bounding box around the object or avatar with + the key object (including any linked prims) relative to the + root prim, in a list: [ (vector) min_corner, (vector) max_corner ] + + + vector llGetCameraPos(); + Returns the position of the camera of the user that granted the + script PERMISSION_TRACK_CAMERA. If no user has granted the permission, + it returns ZERO_VECTOR. + + + rotation llGetCameraRot(); + + Returns the rotation of the camera of the user who's granted + this script PERMISSION_TRACK_CAMERA. If no user has granted the + permission, it returns ZERO_ROTATION. The key of the user whose + camera is being tracked can be obtained using llGetPermissionsKey. + + + key llGetCreator(); + + Returns the key of the object's original creator. Similar to llGetOwner. + + + vector llGetGeometricCenter(); + + Returns the geometric center of the linked set the + script is in relative to the object's position + (the position of the root prim of a linked set). + To get the object's position, use llGetPos. + + + float llGetGMTclock(); + + Gets the time in seconds since midnight in GMT/UTC. + + + key llGetInventoryCreator(string item); + + This function returns the UUID of the creator of item. + If item is not found in inventory, + the object says "No item named 'name' ". + + + integer llGetInventoryPermMask(string item, integer mask); + + Returns the requested permission mask for the inventory + item defined by item. If item is not in the object's inventory, + llGetInventoryPermMask returns 0 and causes the object to + say "No item named '<item>'", where "<item>" is item. + If this is used to determine whether or not an inventory item + exists within the object, it will have the side effect of spamming chat. + inventory item + MASK_BASE, MASK_OWNER,MASK_GROUP, MASK_EVERYONE or MASK_NEXT + + + integer llGetInventoryType(string name); + + Returns the type of the inventory item name. + Remember, like the other inventory functions, llGetInventoryType + is case-sensitive. + + + float llGetMass(); + + Returns the scripted object's mass. When called from a script + in a linkset, the parent will return the sum of the linkset weights, + while a child will return just its own mass. When called from + a script inside an attachment, this function will return the mass + of the avatar it's attached to, not its own. + + + key llGetNumberOfNotecardLines(string name); + + Returns number of lines in the notecard name via the dataserver event. + (Cast the value returned by the dataserver to an integer.) + The key returned is a query id for identifying the dataserver reply. + + + integer llGetNumberOfPrims(); + + Returns the number of prims in (and avatars seated on) + the object the script is in. + + + string llGetObjectDesc(); + + Returns the description of the scripted object/prim. + You can set the description using llSetObjectDesc. + + + float llGetObjectMass(key id); + + Gets the mass of the object or avatar corresponding to id. + + + integer llGetObjectPermMask(integer mask); + + Returns the requested permission mask for the root object + the task is attached to. + + + + integer llGetParcelFlags(vector pos); + + Returns a bitfield specifying the parcel flags + (PARCEL_FLAG_*) for the parcel under the position pos. + + + list llGetPrimitiveParams(list params); + + Returns primitive parameters specified in the params list. + + + vector llGetRegionCorner(); + + Returns the RegionCorner of the simulator containing the task. + + + integer llGetRegionFlags(); + + Returns a bitfield specifying the region flags + (REGION_FLAG_*) for the region the object is in. + + + vector llGetRootPosition(); + + Gets the position (in region coordinates) + of the root/parent prim of the object containing the script. + This is used to allow a child prim to determine where the root is. + + + rotation llGetRootRotation(); + + Gets the global rotation of the root object of the + object script is attached to. + + + string llGetSimulatorHostname(); + + Returns the host name (server) of the sim + in which the scripted object is located. + For example, "sim225.agni.lindenlab.com". + + + string llGetTimestamp(); + + Returns the current time-and-date (a timestamp) + in the format YYYY-MM-DDThh:mm:ss.ff..fZ, + for example: 2004-08-27T00:56:21.785886Z + The letter Z stands for Zulu, + the military time zone name for UTC. T is just + a separator between date and time. + + + integer llGetUnixTime(); + + Returns the number of seconds elapsed since 00:00 hours, + Jan 1, 1970 UTC from the system clock. + In UNIX terms, time_t. This is great for a monotonic + source of time that ticks once a second. + + + key llHTTPRequest(string url, list parameters, string body); + + Sends HTTP request to url with the specified body and parameters. + + url must always be a valid HTTP or HTTPS URL, pointing to a + location outside the Linden Lab and Second Life servers. + + + string llIntegerToBase64(integer number); + + Encodes number as an 8-character Base64 string. + + + list llListReplaceList(list dest, list src, integer start, integer end); + + Returns a list replacing the slice of the list dest from + start to end with the list src. start and end are inclusive, + so 0, 1 would replace the first two entries + and 0, 0 would replace only the first list entry. + + + float llListStatistics(integer operation, list input); + + This function allows a script to perform a statistical + operation as defined by operation on a list composed + of integers and floats. + One of LIST_STAT_* values + + + llLoadURL(key avatar_id, string message, string url); + + llLoadURL displays a dialog box to the user offering + to load a web page using the default web browser. + + + float llLog(float val); + + Returns the base e (natural) logarithm of val (value). + + + float llLog10(float val); + + Returns the base 10 (common) logarithm of val (value). + + + + llMapDestination(string simname, vector position, vector lookat); + + Shows a given location on the map. + Works in attachments, or during touch events. + Currently the function will open the map window whenever it is called. + There is no way to simply set the map position without + opening the window. + + + string llMD5String(string src, integer nonce); + + Performs a RSA Data Security, Inc. MD5 Message-Digest + Algorithm on string with nonce (also known as salt). + Returns a 32-character hex string. (128-bit in binary.) + + + integer llModPow(integer a, integer b, integer c); + + Returns a raised to the b power, mod c. ( (a ^ b)%c ). + b is capped at 0xFFFF (16 bits). + + + llOpenRemoteDataChannel(); + + Creates a channel to listen for XML-RPC calls. + Will trigger a remote_data event with type = REMOTE_DATA_CHANNEL + and a channel ID (key) once it is available. + This channel ID must be referenced in the XML-RPC call + to the script (from the outside internet)-- + so the key must somehow get to the scripter's XML-RPC client, + most often via llEmail, llHttpRequest or llLoadUrl. + + + llOwnerSay(string message); + + Says message to only the owner of the object running the script + if the owner has been within the object's simulator since + logging into Second Life, regardless of where they may be are in-world. + + + llParcelMediaCommandList(list command_list); + + Playing QuickTime movies (you have to own the land). + + + list llParcelMediaQuery(list query_list); + + Queries the texture and/or URL for QuickTime-playable + video on the land parcel. + This function will only work if the script is contained + within an object owned by the landowner (or if the land + is owned by a group, only if the object has been deeded + to the group). It will not work for group land if the + object owner is a member of the group. The object + actually has to be owned by the group. + + + list llParseStringKeepNulls(string src, list separators, list spacers); + + llParseStringKeepNulls works almost exactly the same as + llParseString2List, except that if a null is found + it will add a null string instead of discarding it + like llParseString2List does. + + + llReleaseCamera(key agent); + + A FollowCam function that returns the camera to the + key agent after permission to change it with + llSetCameraParams has been granted via + llRequestPermissions(agent_key, PERMISSION_CONTROL_CAMERA). + + + llRemoteDataReply(key channel, key message_id, string sdata, integer idata); + + Send an XML-RPC reply to the request with message_id + on channel with payload of string sdata and integer idata. + The size of sdata is limited to 254 characters. + + + llRemoteDataSetRegion(); + + does not work! + + + llRemoteLoadScriptPin(key target, string name, integer pin, integer running, integer start_param); + + If the owner of the object containing this script can modify + the object identified by the key target, and if the pin matches + the PIN previously set using llSetRemoteScriptAccessPin + (on the target prim), then the script name will be copied into target. + + + llRemoveFromLandBanList(key avatar); + + Remove avatar from the land parcel ban list. + + + llRemoveFromLandPassList(key avatar); + + Remove avatar from the land parcel pass list. + + + + llResetLandBanList(void) + + Removes all residents from the land ban list. + + + + llResetLandPassList(void) + + Removes all residents from the land access/pass list. + + + + key llRequestSimulatorData(string simulator, integer data); + + Requests data about the sim with the name simulator. + simulator is case-insensitive. + Returns a dataserver query ID and triggers the dataserver + event when data is found. The sim name is usually not case-sensitive, + but sometimes will return data for a similarly-named sim + if the supplied case doesn't match the intended sim's actual name. + + + llRezAtRoot(string inventory, vector pos, vector vel, rotation rot, integer param); + + Rezzes object's inventory item named inventory at + pos with velocity vel and rotation rot with start parameter param. + + + key llSendRemoteData(key channel, string dest, integer idata, string sdata); + + Send an XML-RPC request to dest (probably an URL) + through channel with payload of channel (in a string), + integer idata and string sdata. + + + llSetCameraParams(list rules); + + Sets multiple camera parameters at once. + List format is [rule1, value1, rule2, value2 . . . ruleN, valueN] + + + llSetLinkAlpha(integer linknumber, float alpha, integer face); + + Sets the side number face on the linked child linknumber + to the transparency alpha. + + + llSetLocalRot(rotation rot); + + Sets the rotation of a child prim relative to the root prim. + + + llSetObjectDesc(string name); + + Sets the description of the scripted prim to name. + You can get the description using llGetObjectDesc. + The description is limited to 127 characters. + + + llSetParcelMusicURL(string url) + + Sets the streaming audio URL for the parcel the + scripted object is on (the object must be owned + by the owner of the parcel, if the parcel is group + owned the object must be owned by that group). + + + llSetPayPrice(integer price, list quick_pay_buttons); + + Sets the values of the buttons and the text box default + for the Pay dialog -- when a user right-clicks on + the object and selects "Pay", llSetPayPrice will affect + what buttons exist, what their values are, and whether + or not there is a manual payment text entry box. + + + llSetPrimitiveParams(list rule); + + This function changes the many properties (or "parameters") + of a prim in one operation. The parameter is a list of changes. + (Don't confuse prim parameters with function parameters.) + + + llSetRemoteScriptAccessPin(integer pin); + + If pin is set to a non-zero number, the task will accept + remote script loads via llRemoteLoadScriptPin + if passed the matching PIN. + Otherwise llRemoteLoadScriptPin is ignored + + + string llStringToBase64(string str); + + Converts a string to the Base 64 representation of the string. + + + string llUnescapeURL(string url); + + Returns the string that is the URL unescaped version + of url, replacing "%20" with spaces, etc. + The function can output raw UTF-8 strings. + + + string llXorBase64StringsCorrect(string s1, string s2) + + Performs an xor on two Base64 strings and returns a Base64 string. + s2 repeats if it is shorter than s1. + This function is for encrypting data. Put your data in s1 and + your key in s2 to encrypt or put the encrypted data into s1 + with the same key in s2 to decrypt again. + + + llSetInventoryPermMask(string item, integer mask, integer value); + + Sets the given permission mask to the new value on the inventory item. + + + llSetObjectPermMask(integer mask, integer value); + + Sets the given permission mask to the new value on the root object + the task is attached to. + + + llSetSoundRadius(float radius); + + Establishes a hard cut-off radius for audibility of scripted + sounds (both attached and triggered) + + + llTakeCamera(key avatar); + + Move avatar's viewpoint to task + + + list llGetObjectDetails(key id, list params); + + Returns a list of the details specified in params for the object with key id. + prim or avatar UUID that is in the same region + list of OBJECT_* flags + + + + llSetClickAction(integer action); + + Sets the action performed when a prim is clicked upon. + a CLICK_ACTION_* flag + + + + integer llGetRegionAgentCount(); + + Returns an integer that is the number of avatars in the region. + + + + llTextBox( key avatar, string message, integer chat_channel ); + + *** Pre-release Documentation Warning *** + Shows a dialog box on avatar's screen with the text message. + It contains a text box for input, any text that is entered + is said on chat_channel when the "OK" button is clicked. + + + + string llGetAgentLanguage( key avatar ); + + Returns a string that is the language code of the preferred + interface language of the user avatar. + + + + vector llDetectedTouchUV( integer index ); + + Returns a vector that is the texture coordinates for where + the prim was touched. The x and y vector positions contain + the u and v face coordinates respectively. + + TOUCH_INVALID_TEXCOORD is returned + when the touch UV coordinates cannot be determined. + Index of detection information + + + + integer llDetectedTouchFace( integer index ); + + Returns an integer that is the index of the face the avatar clicked on. + Index of detection information + + + + vector llDetectedTouchPos( integer index ); + + Returns a vector that is the position where the object + was touched in region coordinates, unless it is attached to + the HUD, in which case it returns the position relative + to the attach point. + Index of detection information + + + + vector llDetectedTouchNormal( integer index ); + + Returns a vector that is the surface normal + (perpendicular to the surface) where the touch event was triggered. + Index of detection information + + + + vector llDetectedTouchBinormal( integer index ); + + Returns a vector that is the surface binormal + (tangent to the surface) where the touch event was triggered. + Index of detection information + + + + vector llDetectedTouchST( integer index ); + + Returns a vector that is the surface coordinates for where the prim was touched. + The x and y vector positions contain the horizontal (s) and vertical (t) face + coordinates respectively. + Each component is in the interval [0.0, 1.0]. + + TOUCH_INVALID_TEXCOORD is returned when the surface coordinates cannot be determined. + Index of detection information + + + + string llSHA1String( string src ); + + *** Pre-release Documentation Warning *** + Returns a string of 40 hex characters that is the SHA1 security hash of src. + + + + integer llGetFreeURLs( ); + + + key llRequestURL( ); + + + key llRequestSecureURL( ); + + + llReleaseURL( string url ); + + + llHTTPResponse( key request_id, integer status, string body ); + + + llHTTPResponse( key request_id, integer status, string body ); + + + + + Every state must have at least one handler. You can choose to + handle an event by defining one of the the reserved + event handlers named here. + + + at_target(integer tnum, vector targetpos, vector ourpos); + + This event handler is triggered when the scripted object comes within + a defined range of the target position targetpos + (defined by the llTarget function call). + + + + at_rot_target(integer number, rotation target_rotation, rotation our_rotation); + + This event is triggered when a script comes within a defined + angle of a target rotation. The range is set by a call + to llRotTarget. + + + + not_at_rot_target(void); + + When a target is set via the llRotTarget library call, + but the script is outside the specified angle this event is raised. + + + + not_at_target(void); + + When a target is set via the llTarget library call, + but the script is outside the specified range this event is raised. + + + attach(key attached); + + This event is triggered whenever a object with this script is + attached or detached from an avatar. If it is attached, + attached is the key of the avatar it is attached to, otherwise + attached is NULL_KEY. + + + changed(integer change); + + Triggered when various events change the object. The change + argument will be a bitfield of change constants. + + + collision(integer total_number); + + This event is raised while another object is colliding with + the object the script is attached to. The number of + detected objects is passed to the script. Information on + those objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + collision_end(integer total_number); + + This event is raised when another object stops colliding with + the object the script is attached to. The number of + detected objects is passed to the script. Information on those + objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + collision_start(integer total_number); + + This event is raised when another object begins to collide with + the object the script is attached to. The number of + detected objects is passed to the script. Information on + those objects may be gathered via the llDetected* library + functions. + (Collisions are also generated if a user walks into an object.) + + + control(key name, integer levels, integer edges); + + Once a script has the ability to grab control inputs from the avatar, + this event will be used to pass the commands + into the script. The levelsand edgesare bitfields + of control constsants. + + + dataserver(key requested, string data); + + This event is triggered when the requested data is returned + to the script. Data may be requested by the + llRequestAgentData, the llRequestInventoryData, + and the llGetNotecardLine function calls. + + + email(string time, string address, string subject, string body, integer remaining); + + This event is triggered when an email sent to this script arrives. + The remaining tells how many more emails are known as still pending. + + + land_collision(vector position); + + This event is raised when the object the script is attached + to is colliding with the ground. + + + land_collision_end(vector position); + + This event is raised when the object the script is attached + to stops colliding with the ground. + + + land_collision_start(vector position); + + This event is raised when the object the script is attached + to begins to collide with the ground. + + + link_message(integer sender_number, integer number, string message, key id); + + Triggered when object receives a link message via llMessageLinked + library function call. + + + listen(integer channel, string name, key id, string message); + + This event is raised whenever a chat message matching the + constraints passed in the llListen command is heard. + The nameand id of the speaker as well as the messageare passed + in as parameters. Channel 0 is the public + chat channel that all avatars see as chat text. + Channels 1 through 2,147,483,648 are private channels that are not + sent to avatars but other scripts can listen on those channels. + + + money(key giver, integer amount); + + This event is triggered when user giver has given an amount + of Linden dollars to the object. + + + moving_end(void); + + Triggered whenever a object with this script stops moving. + + + moving_start(void); + + Triggered whenever a object with this script starts moving. + + + no_sensor(void); + + This event is raised when sensors are active + (via the llSensor library call) but are not sensing anything. + + + + object_rez(key id); + + Triggered when object rez-es in another object from its + inventory via the llRezObject api. The id is the globally + unique key for the object. + + + on_rez(integer start_param); + + Triggered whenever a object is rez-ed from inventory + or by another object. The start_paramis the parameter + passed in from the call to llRezObject. + + + run_time_permissions(integer permissions); + + Scripts need permission from either the owner or the avatar + they wish to act on before they perform certain + functions, such as debiting money from their owners account, + triggering an animation on an avatar, or capturing + control inputs. The llRequestPermissions library + function is used to request these permissions and the various + permissions integer constants can be supplied. + The integer returned to this event handler contains the current set + of permissions flags, so if permissionseqal 0 then no permissions are set. + + + sensor(integer total_number); + + This event is raised whenever objects matching the constraints + of the llSensor command are detected. + The number of detected objects is passed to the script + in the total_number parameter. Information on those + objects may be gathered via the llDetected* library functions. + + + state_entry(void); + + The state_entry event occurs whenever a new state is entered, + including program start, and is always the first event handled. + + + state_exit(void); + + The state_exit event occurs whenever the state command + is used to transition to another state. It is handled + before the new states state_entry event. + + + timer(void); + + This event is raised at regular intervals set by the + llSetTimerEvent library function. + + + touch(integer total_number); + + This event is raised while a user is touching the object + the script is attached to. The number of touching objects is + passed to the script in the total_number parameter. + Information on those objects may be gathered via the + llDetected* library functions. + + + touch_end(integer total_number); + + This event is raised when a user stops touching the object + the script is attached to. The number of touching + objects is passed to the script in the total_number parameter. + Information on those objects may be gathered + via the llDetected* library functions. + + + touch_start(integer total_number); + + This event is raised when a user first touches the object the script is + attached to. The number of touching objects is passed to the script in + the total_number parameter. Information on those objects may be gathered + via the llDetected() library functions. + + + http_response(key request_id, integer status, list metadata, string body); + + This event handler is invoked when an HTTP response is received for + a pending llHTTPRequest request or if a pending request fails or times out. + + + remote_data(integer event_type, key channel, key message_id, string sender, integer idata, string sdata); + + Triggered by various XML-RPC calls with event_type specifying the type of data. + + + + To ease scripting, many useful constants are defined by LSL. + + The boolean constants represent the values for TRUE and FALSE. + LSL represents booleans as integer values 1 + and 0 respectively. Since there is no boolean type these + constants act as a scripting aid usually employed for + testing variables which conceptually represent boolean values. + + An integer constant for boolean comparisons. Has the value '1'. + + + An integer constant for boolean comparisons. Has the value '0'. + + + + The status constants are used in the llSetStatus and llGetStatus + library calls. These constants can be bitwise ored + together when calling the library functions to set the same + value to more than one status flag + Status Constants + + Controls whether the object moves physically. + This controls the same flag that the ui checkbox for + Physical controls. The default is FALSE. + + + Controls whether the object collides or not. + Setting the value to TRUE makes the object non-colliding with + all objects. It is a good idea to use this for most objects + that move or rotate, but are non-physical. It is also + useful for simulating volumetric lighting. The default is FALSE. + + + + + + + Controls whether the object can physically rotate around + the specific axis or not. This flag has no meaning + for non-physical objects. Set the value to FALSE + if you want to disable rotation around that axis. The + default is TRUE for a physical object. + A useful example to think about when visualizing + the effect is a sit-and-spin device. They spin around the + Z axis (up) but not around the X or Y axis. + + + Controls whether the object can be grabbed. + A grab is the default action when in third person, and is + available as the hand tool in build mode. + This is useful for physical objects that you dont want other + people to be able to trivially disturb. + The default if FALSE + + + Controls whether the object can cross region boundaries + and move more than 20 meters from its creation + point. The default if FALSE. + + + Controls whether the object is returned to the owners + inventory if it wanders off the edge of the world. It is + useful to set this status TRUE for things like bullets + or rockets. The default is TRUE + + + + These constants can be combined using the binary | operator + and are used in the llSensor and related calls. + Object Type Constants + + Objects in world that are agents. + + + Objects in world that are running a script or + currently pysically moving. + + + Static in-world objects. + + + Scripted in-world objects. + + + + The permission constants are used for passing values + to llRequestPermissions, determing the value of + llGetPermissions, and explicitly passed to the + run_time_permissions event. For many of the basic library + functions to work, a specific permission must be enabled. + The permission constants can be ored together to be + used in conjunction. + + Permission Constants + + If this permission is enabled, the object can successfully + call llGiveMoney to debit the owners account. + + + If this permission enabled, the object can successfully + call the llTakeControls libray call. + + + (not yet implemented) + + + If this permission is enabled, the object can successfully + call llStartAnimation for the avatar that owns this + object. + + + If this permission is enabled, the object can successfully + call llAttachToAvatar to attach to the given avatar. + + + (not yet implemented) + + + If this permission is enabled, the object can successfully + call llCreateLink, llBreakLink, and + llBreakAllLinks to change links to other objects. + + + (not yet implemented) + + + (not yet implemented) + + + + These constants can be used to refer to a specific inventory + type in calls to llGetInventoryNumber + andllGetInventoryName. + Inventory Constants + + + + + + + + + + + + + + + + Each constant refers to the named type of inventory. + + + + These constants are used to refer to attachment points + in calls to llAttachToAvatar. + Attachment Constants + + Attach to the avatar chest. + + + Attach to the avatar head. + + + Attach to the avatar left shoulder. + + + Attach to the avatar right shoulder. + + + Attach to the avatar left hand. + + + Attach to the avatar right hand. + + + Attach to the avatar left foot. + + + Attach to the avatar right foot. + + + Attach to the avatar back. + + + Attach to the avatar pelvis. + + + Attach to the avatar mouth. + + + Attach to the avatar chin. + + + Attach to the avatar left ear. + + + Attach to the avatar right ear. + + + Attach to the avatar left eye. + + + Attach to the avatar right eye. + + + Attach to the avatar nose. + + + Attach to the avatar right upper arm. + + + Attach to the avatar right lower arm. + + + Attach to the avatar left upper arm. + + + Attach to the avatar left lower arm. + + + Attach to the avatar right hip. + + + Attach to the avatar right upper leg. + + + Attach to the avatar right lower leg. + + + Attach to the avatar left hip. + + + Attach to the avatar lower upper leg. + + + Attach to the avatar lower left leg. + + + Attach to the avatar belly. + + + Attach to the avatar right pectoral. (depreciated) + + + Attach to the avatar left pectoral. (depreciated) + + + + + + + + + + + + + + + + + + + + + These constants are only used in calls to llModifyLand. + The constants are equivalent to the similarly labelled + user interface elements for editing land in the viewer. + Land Constants + + Action to level the land. + + + Action to raise the land. + + + Action to lower the land. + + + Use a small brush size. + + + Use a medium brush size. + + + Use a large brush size. + + + + These constants are used in calls to llSetLinkColor and + llMessageLinked. + + Link Constants + + This targets every object in the linked set. + + + This targets the root of the linked set. + + + This targets every object in the linked set except + the object with the script. + + + This targets every object except the root in the linked set. + + + + These constants are used in llTakeControls as well + as the control event handler. + Control Constants + + Test for the avatar move forward control. + + + Test for the avatar move back control. + + + Test for the avatar move left control. + + + Test for the avatar move right control. + + + Test for the avatar rotate left control. + + + Test for the avatar rotate right control. + + + Test for the avatar move up control. + + + Test for the avatar move down control. + + + Test for the avatar left button control. + + + Test for the avatar left button control while in mouse look. + + + + These constants are used in the changed event handler. + Change Constants + + The object inventory has changed. + + + The object inventory has changed because an item was + added through the llAllowInventoryDrop interface. + + + The object color has changed. + + + The object shape has changed, eg, a box to a cylinder + + + The object scale has changed. + + + The texture offset, scale rotation, or simply the object + texture has changed. + + + The object has linked or its links were broken. + + + + These constants are used to determine the variable type + stored in a heterogenous list. The value returned from + llGetListEntryType can be used for comparison against + these constants. + Type Constants + + The list entry is an integer. + + + The list entry is a float. + + + The list entry is a string. + + + The list entry is a key. + + + The list entry is a vector. + + + The list entry is a rotation. + + + The list entry is invalid. + + + + Each of these constants represents a bit in the integer + returned from the llGetAgentInfo function and can be used + in an expression to determine the specified information + about an agent. + Agent Info Constants + + The agent is flying. + + + The agent has attachments. + + + The agent has scripted attachments. + + + + These constants are used in the llSetTextureAnim api to + control the animation mode. + Texture Animation Constants + + Texture animation is on. + + + Loop the texture animation. + + + Play animation in reverse direction. + + + play animation going forwards, then backwards. + + + slide in the X direction, instead of playing separate frames. + + + Animate texture rotation. + + + Animate the texture scale. + + + + These constants are used in calls to the llParticleSystem + api to specify parameters. + Particle System Parameters + + Each particle that is emitted by the particle system is + simulated based on the following flags. To use + multiple flags, bitwise or (|) them together. + PSYS_PART_FLAGS Values + + + Interpolate both the color and alpha from the start + value to the end value. + + + Interpolate the particle scale from the start value + to the end value. + + + Particles have their velocity damped towards the wind velocity. + + + Particles bounce off of a plane at the objects Z height. + + + The particle position is relative to the source objects position. + + + The particle orientation is rotated so the vertical + axis faces towards the particle velocity. + + + The particle heads towards the location of the target + object as defined by PSYS_SRC_TARGET_KEY. + + + The particle glows. + + + (not implemented) + + + (not implemented) + + + (not implemented) + + + The pattern which is used to generate particles. + Use one of the following values: + PSYS_SRC_PATTERN Values + + + Drop particles at the source position. + + + Shoot particles out in all directions, + using the burst parameters. + + + Shoot particles across a 2 dimensional area defined + by the arc created from + PSYS_SRC_OUTERANGLE. + There will be an open area defined by PSYS_SRC_INNERANGLE + within the larger arc. + + + Shoot particles out in a 3 dimensional cone with + an outer arc of PSYS_SRC_OUTERANGLE and an + inner open area defined by PSYS_SRC_INNERANGLE. + + + a vector <r,g,b> which determines the starting + color of the object. + + + a float which determines the starting alpha of the object. + + + a vector <r, g, b> which determines the ending + color of the object. + + + a float which determines the ending alpha of the object. + + + a vector <sx, sy, z>, + which is the starting size of the particle billboard + in meters (z is ignored). + + + a vector <sx, sy, z>, which is the ending + size of the particle billboard in meters (z is ignored). + + + age in seconds of a particle at which it dies. + + + a vector <x, y, z> which is the acceleration + to apply on particles. + + + an asset name for the texture to use for the particles. + + + how often to release a particle burst (float seconds). + + + specifies the inner angle of the arc created + by the PSYS_PART_SRC_PATTERN_ANGLE or + PSYS_PART_SRC_PATTERN_ANGLE_CONE source pattern. + The area specified will not have particles + in it.. + + + specifies the outer angle of the arc created + by the PSYS_PART_SRC_PATTERN_ANGLE or + PSYS_PART_SRC_PATTERN_ANGLE_CONE source pattern. + The area between the outer and inner angle + will be filled with particles.. + + + how many particles to release in a burst. + + + what distance from the center of the object + to create the particles. + + + minimum speed that a particle should be moving. + + + maximum speed that a particle should be moving. + + + how long this particle system should last, + 0.0 menas forever. + + + the key of a target object to move towards + if PSYS_PART_TARGET_POS_MASK is enabled. + + + Sets the angular velocity to rotate the axis + that SRC_PATTERN_ANGLE and + SRC_PATTERN_ANGLE_CONE use.. + + + + These constants are used in calls to the + llRequestAgentData api to collect information about + an agent which will + be provided in the dataserver event. + Texture Animation Constants + + "1" for online "0" for offline. + + + The name of the agent. + + + The date the agent was born returned in ISO 8601 format of YYYY-MM-DD. + + + Returns the agent ratings as a comma separated string + of six integers. They are: + + 1. Positive rated behavior + 2. Negative rated behavior + 3. Positive rated appearance + 4. Negative rated appearance + 5. Positive rated building + 6. Negative rated building + + + + LSL provides a small collection of floating point + constants for use in float arithmetic. + These constants are usually + employed while performing trigonometric calculations, + but are sometimes useful for other applications such as + specifying arc radians to sensor or particle system functions. + Float Constants + + 3.14159265 - The radians of a hemicircle. + + + 6.28318530 - The radians of a circle. + + + 1.57079633 - The radians of a quarter circle. + + + 0.01745329 - Number of radians per degree. + You can use this to convert degrees to radians by multiplying + the degrees by this number. + + + 57.2957795 - Number of degrees per radian. + You can use this number to convert radians to degrees by + multiplying the radians by this number. + + + 1.41421356 - The square root of 2. + + + + There is only one key constant which acts as an invalid key: NULL_KEY. + + + There is one uncategorized integer constant + which is used in some of the texturing and coloring api: ALL_SIDES + + + There is one uncategorized string constant + which is used in the dataserver event: EOF + + + There is only one vector constant which + acts as a zero vector: ZERO_VECTOR = <0,0,0>. + + + There is only one rotation constant + which acts as a zero rotation: ZERO_ROTATION = <0,0,0,1>. + + + Parameters + + A vector of timescales for exponential + decay of the vehicles linear velocity along its preferred axes of + motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + + A vector of timescales for exponential + decay of the vehicles angular velocity about its preferred axes of + motion (at, left, up). + Range = [0.07, inf) seconds for each element of the vector. + + + The direction and magnitude (in preferred frame) + of the vehicles linear motor. The vehicle will accelerate + (or decelerate if necessary) to match its velocity to its motor. + Range of magnitude = [0, 30] meters/second. + + + The timescale for exponential approach to full linear motor velocity. + + + The timescale for exponential decay of the linear motors magnitude. + + + The direction and magnitude (in preferred frame) + of the vehicles angular motor.The vehicle will accelerate + (or decelerate if necessary) to match its velocity to its motor. + + + The timescale for exponential approach to full angular motor velocity. + + + The timescale for exponential decay of the angular motors magnitude. + + + The height (above the terrain or water, or global) + at which the vehicle will try to hover. + + + A slider between minimum (0.0 = bouncy) + and maximum (1.0 = fast as possible) damped motion of the + hover behavior. + + + The period of bounce (or timescale of exponential approach, + depending on the hover efficiency) for the + vehicle to hover to the proper height. + + + A slider between minimum (0.0) and maximum anti-gravity (1.0). + + + A slider between minimum (0.0) and maximum (1.0) + deflection of linear velocity. That is, its a simple + scalar for modulating the strength of linear deflection. + + + The timescale for exponential success of linear + deflection deflection. It is another way to specify how much + time it takes for the vehicles linear velocity + to be redirected to its preferred axis of motion. + + + A slider between minimum (0.0) and maximum (1.0) + deflection of angular orientation. That is, its a simple + scalar for modulating the strength of angular + deflection such that the vehicles preferred axis of motion + points toward its real velocity. + + + The timescale for exponential success of linear + deflection deflection. Its another way to specify the strength + of the vehicles tendency to reorient itself so + that its preferred axis of motion agrees with its true velocity. + + + A slider between minimum (0.0 = wobbly) and + maximum (1.0 = firm as possible) stability of the vehicle to + keep itself upright. + + + The period of wobble, or timescale for + exponential approach, of the vehicle to rotate such that its preferred + "up" axis is oriented along the worlds "up" axis. + + + A slider between anti (-1.0), none (0.0), + and maxmum (1.0) banking strength. + + + A slider between static (0.0) and dynamic (1.0) + banking. "Static" means the banking scales only with the + angle of roll, whereas "dynamic" is a term + that also scales with the vehicles linear speed. + + + The timescale for banking to exponentially + approach its maximum effect. This is another way to scale the + strength of the banking effect, however it affects the + term that is proportional to the difference between what + the banking behavior is trying to do, and what the + vehicle is actually doing. + + + A rotation of the vehicles preferred axes of + motion and orientation (at, left, up) with respect to the vehicles + local frame (x, y, z). + + + + Flags + + Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP + + + This flag prevents linear deflection parallel to world z-axis. + This is useful for preventing ground vehicles + with large linear deflection, like bumper cars, + from climbing their linear deflection into the sky. + + + For vehicles with vertical attractor + that want to be able to climb/dive, for instance, + airplanes that want to use the banking feature. + + + Ignore terrain height when hovering. + + + Ignore water height when hovering. + + + Hover at global height. + + + Hover doesnt push down. Use this flag for hovering vehicles + that should be able to jump above their hover + height. + + + Prevents ground vehicles from motoring into the sky. + + + + Types + + Simple vehicle that bumps along the ground, + and likes to move along its local x-axis. + // most friction for left-right, least for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <30, 1, 1000> ); + // no angular friction + llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> ); + // no linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 120 ); + // no agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 120 ); + // no hover (but with timescale of 10 sec if enabled) + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 10 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // maximum linear deflection with timescale of 1 second + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 1 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 ); + // no vertical attractor (doesnt mind flipping over) + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 ); + // no banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 10 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY ); + // set these flags (the limit_roll flag will have no effect + // until banking is enabled, if ever) + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Another vehicle that bounces along the ground but needs + the motors to be driven from external controls or + timer events. + // most friction for left-right, least for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <100, 2, 1000> ); + // no angular friction + llSetVehicleVectorParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, <1000, 1000, 1000> ); + // linear motor wins after about a second, decays after about a minute + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor wins after a second, decays in less time than that + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.8 ); + // no hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // maximum linear deflection with timescale of 2 seconds + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 2 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 10 ); + // critically damped vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 10 ); + // weak negative critically damped banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.2 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Hovers over water with lots of friction and some anglar deflection. + // least for forward-back, most friction for up-down + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <10, 3, 2> ); + // uniform angular friction (setting it as a scalar rather than a vector) + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 ); + // linear motor wins after about five seconds, decays after about a minute + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor wins after four seconds, decays in same amount of time + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 4 ); + // hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 2.0 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 ); + // halfway linear deflection with timescale of 3 seconds + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 3 ); + // angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 ); + // somewhat bounscy vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 5 ); + // weak negative damped banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, -0.3 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.8 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 1 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + Uses linear deflection for lift, no hover, and banking to turn. + // very little friction along forward-back axis + llSetVehicleVectorParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, <200, 10, 5> ); + // uniform angular friction + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 20 ); + // linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 2 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 4 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 8 ); + // no hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 0 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 1000 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 0 ); + // linear deflection + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.5 ); + // angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 1.0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 2.0 ); + // vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.9 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 2 ); + // banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 2 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove these flags + llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + // set these flags + llSetVehicleFlags( VEHICLE_FLAG_LIMIT_ROLL_ONLY ); + + + Hover, and friction, but no deflection. + // uniform linear friction + llSetVehicleFloatParam( VEHICLE_LINEAR_FRICTION_TIMESCALE, 5 ); + // uniform angular friction + llSetVehicleFloatParam( VEHICLE_ANGULAR_FRICTION_TIMESCALE, 10 ); + // linear motor + llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_TIMESCALE, 5 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 60 ); + // agular motor + llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0> ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_TIMESCALE, 6 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 10 ); + // hover + llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, 5 ); + llSetVehicleFloatParam( VEHICLE_HOVER_EFFICIENCY, 0.8 ); + llSetVehicleFloatParam( VEHICLE_HOVER_TIMESCALE, 10 ); + llSetVehicleFloatParam( VEHICLE_BUOYANCY, 1 ); + // no linear deflection + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 5 ); + // no angular deflection + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 5 ); + // no vertical attractor + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1 ); + llSetVehicleFloatParam( VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 1000 ); + // no banking + llSetVehicleFloatParam( VEHICLE_BANKING_EFFICIENCY, 0 ); + llSetVehicleFloatParam( VEHICLE_BANKING_MIX, 0.7 ); + llSetVehicleFloatParam( VEHICLE_BANKING_TIMESCALE, 5 ); + // default rotation of local frame + llSetVehicleRotationParam( VEHICLE_REFERENCE_FRAME, <0, 0, 0, 1> ); + // remove all flags + llRemoveVehicleFlags( VEHICLE_FLAG_NO_DEFLECTION_UP + | VEHICLE_FLAG_HOVER_WATER_ONLY + | VEHICLE_FLAG_LIMIT_ROLL_ONLY + | VEHICLE_FLAG_HOVER_TERRAIN_ONLY + | VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT + | VEHICLE_FLAG_HOVER_UP_ONLY + | VEHICLE_FLAG_LIMIT_MOTOR_UP ); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DEBUG_CHANNEL is an integer constant that, when passed to + llSay, llWhisper, or llShout as a channel parameter, + will print text to the Script Warning/Error Window. + It has the value '2147483647'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use this to get or set the parcel media MIME type (e.g. "text/html"). + + + Use this to get or set the parcel media pixel resolution. + + + Use this to get or set the parcel media description. + + + Used to get or set the parcel's media looping variable. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PRIM_GLOW is used to get or set the glow status of the face. + + + + + Area in radians specifying where particles + will NOT be created (for ANGLE patterns) + + + Area in radians filled with particles + (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, + acts as PSYS_SRC_ANGLE_BEGIN itself, + and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END) + + + + + + + + PUBLIC_CHANNEL is an integer constant that, when passed to + llSay, llWhisper, or llShout as a channel parameter, + will print text to the publicly heard chat channel. Has the value '0'. + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the object's name. + + + Gets the object's description. + If id is an avatar, an empty string is returned. + + + Gets the object's position in region coordinates. + + + Gets the object's rotation. + + + Gets the object's velocity. + + + Gets an object's owner's key. + If id is group owned, a NULL_KEY is returned. + + + Gets the prims's group key. + If id is an avatar, a NULL_KEY is returned. + + + Gets the object's creator key. + If id is an avatar, a NULL_KEY is returned. + + + + Performs the default action: when the prim is touched, touch events are triggered" + + + When the prim is touched, touch events are triggered" + + + When the prim is touched, the avatar sits upon it + + + When the prim is touched, the buy dialog is opened + + + When the prim is touched, the pay dialog is opened + + + When the prim is touched, the object inventory dialog is opened + + + When the prim is touched, html-on-a-prim is enabled? + + + When the prim is touched, the web media dialog is opened" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/obj/Debug/LSLEditor.Resource.ReleaseNotes.htm b/obj/Debug/LSLEditor.Resource.ReleaseNotes.htm new file mode 100644 index 0000000..14a0184 --- /dev/null +++ b/obj/Debug/LSLEditor.Resource.ReleaseNotes.htm @@ -0,0 +1,1382 @@ +
+ +

Release 2.40

+ +

April 17 2010 14:51 (local time)
+ - Added: stub functions for: +

    +
  • llGetFreeURLs
  • +
  • llRequestURL
  • +
  • llRequestSecureURL
  • +
  • llReleaseURL
  • +
  • llHTTPResponse
  • +
  • llGetHTTPHeader
  • +
+
+

+ +

Release 2.39

+ +

October 28 2008 11:28 (local time)
+ - Added: stub functions for: +

    +
  • llTextBox
  • +
  • llGetAgentLanguage
  • +
  • llDetectedTouchUV
  • +
  • llDetectedTouchFace
  • +
  • llDetectedTouchPos
  • +
  • llDetectedTouchNormal
  • +
  • llDetectedTouchBinormal
  • +
  • llDetectedTouchST
  • +
  • llSHA1String
  • +
+
+

+ +

Release 2.38

+ +

July 28 2008 14:10 (local time)

+ - Changed: Key cache file changed, so did lsleditor (??? who made the xml file, it uses siblings, not parent-child relations????)
+

+ +

Summer break ;-)

+ +

May 18 2008 18:37 (local time)

+ - Changed: Ctrl-Shft-A uses 4-spaces intdent when (auto)pasting in SL
+

+ +

May 13 2008 13:21 (local time)

+ - Changed: Adding duplicate items in solution explorer starts numbering at 1
+ - Fixed: focus when switching tabs
+ - Fixed: Save All (Ctrl Shft S), does not save Solution
+

+ +

Release 2.37

+ +

May 2 2008 19:00 (local time)

+ - Added: PRIM_GLOW
+ - Added: llSetClickAction (and constants)
+ - Fixed: & in dialogue box
+ - Fixed: Permission dialogue box text messed up when the script name is too long
+

+ +

Release 2.36

+ +

Apr 3 2008 12:47 (local time)

+ - Fixed: llAbs throws error on large numbers
+

+ +

Mar 28 2008 12:47 (local time)

+ - Fixed: llListen should also listen when using "" keys
+ - Added: Basic authentication to llHTTPRequest, eg. http: //userid:password@domain.name/path
+ - Added: llEmail shows error responses from smtp server when in error
+

+ +

Mar 27 2008 13:33 (local time)

+ - Added (experimental): 'Ctrl Shift A' pastes active LSLEditor script to SecondLife (has to open script editor in SL first)
+

+ +

Mar 21 2008 12:12 (local time)

+ - Fixed: Shift Home crashes editor when nothing is selected
+

+ +

Release 2.35

+ +

Mar 16 2008 15:22 (local time)

+ - Added: llGetParcelDetails (see also menu - tools - options - debugging internal)
+ - Added: Alt-Backspace alternative for Ctrl-Z
+ - Fixed: Some focus issue on the find window
+ - Added: PARCEL_MEDIA_COMMAND_TYPE, PARCEL_MEDIA_COMMAND_SIZE, PARCEL_MEDIA_COMMAND_DESC, PARCEL_MEDIA_COMMAND_LOOP_SET
+ - Added: Contact item on menu Help
+ - Removed: some compression code
+

+ +

Feb 29 2008 12:40 (local time)

+ - Fixed: NULL_KEY was no key
+

+ +

Release 2.34

+ +

Feb 23 2008 19:45 (local time)

+

+ - Added: First generic plugin support
+ - Added: integer multiply operator for float operand
+ - Added: minus operator to rotation
+ - Fixed: Internals to pass more language tests, e.g. bool on ZERO_ROTATION and NULL_KEY, adding items to list
+

+ +

Feb 22 2008 23:38 (local time)

+

+ - Fixed: Browser status hides bottom scrollbar
+ - Fixed: Switching between Tabbed document and Windowed document, browser disappears
+ - Fixed: (key)"" == False
+ - Added: state changes allowed in global functions (when set in Debugging - General menu)
+ - Fixed: info on llInsertString was missing a few spaces
+ - Added: Debug windows have context menu, Copy, Select All and Clear
+ - Added: File - New - New notecard
+ - Changed: llGetScriptName returns scriptname without extension (when set in Debugging - General menu)
+ - Fixed: Don't send empty bugreports
+ - Fixed: tabs are presented in SL as 4 spaces, for example llStringLength("\t") == 4
+ - Fixed: remove old files after Autoupdate
+ - Fixed: autoupdate menu was readonly
+

+ +

Release 2.33

+ +

Feb 12 2008 08:12 (local time)

+

+ - Fixed: llLog and llLog10
+

+ +

Feb 04 2008 16:30 (local time)

+

+ - Added: Shortcut key for lslint, F7 ;-)
+ - Fixed: llMessageLinked using LINK_THIS works also when NOT using solution explorer
+ - Fixed: default value of key type is wrong
+ - Added: All animation / expression names are added to the autocompletion function (as strings)
+ - Added: Autocompletion of animation names can be switched on/off by menu Tools - Options - Text Editor - Code completion
+ - Fixed: crash of lsleditor on llHTTPRequest when errors occur
+ - Changed: Information on llSensorRepeat()
+ - Added: llResetLandPassList()
+

+ +

Release 2.32

+ +

Jan 27 2008 14:00 (local time)

+

+ - Added: open multiple files from menu 'File - Open - File...' or Ctrl-O
+ - Fixed: global functions do not parse when using multiple brackets on 1 line
+ - Fixed: renaming files and directories in solution explorer sometimes crashes lsleditor
+ - Changed: 'Recent Projects' in 'Recent Solutions'
+ - Changed: 'Add new Project' changed into 'Add new Solution'
+

+ +

Release 2.31

+ +

Jan 14 2008 16:28 (local time)

+

+ - Changed: llUnescapeURL and llEscapeURL using UTF8 encoding
+ - Changed: llBase64ToString and llStringToBase64 using UTF8 encoding
+ - Changed: improved label parsing
+

+ + +

Jan 12 2008 10:43 (local time)

+

+ - Fixed: llDialog does not show OK button, using no buttons
+

+ +

Jan 09 2008 17:18 (local time)

+

+ - Added: Online Help browser, New tab for every search can be unchecked in menu Tools - Options - Environment - Help
+ - Fixed: No scrolling when using Autoformat (Ctrl-D)
+

+ +

Jan 06 2008 13:31 (local time)

+

+ - Fixed: llGetListEntryType does not work on negative index
+ - Added: missing operators on integer
+ - Fixed: wrong parsing and casting of large hex numbers
+

+ +

Jan 05 2008 12:44 (local time)

+

+ - Added: show status of capslock
+

+ +

Release 2.30

+ +

Dec 29 2007 12:27 (local time)

+

+ - Fixed: llParseString2List loops when using empty strings on spacers
+

+ +

Dec 27 2007 22:57 (local time)

+

+ - Added: Disable tooltip user-setting, menu Tools - Options - Help
+ - Added: Link to the LSLEditor forum, menu Help - Forum
+ - Added: Auto save on menu Tools - Options - Debugging - General - Auto save
+ - Fixed: sending/retrieving bugreports crashes lsleditor when internet connection is not available
+ - Fixed: turning off autoindent errors on braces
+ - Fixed: line number issue on scrolling
+ - Fixed: cast error using llList2Vector for strings
+

+ +

Release 2.29

+ +

Dec 18 2007 16:38 (local time)

+

+ - Added: when nothing is selected, Shift-Delete, copies entire line to clipboard and deletes it
+ - Fixed: Ctrl-X is not undo-able
+ - Fixed: jump labels containing '_' give error
+ - Added: ATTACH_HUD_* constants
+

+ +

Dec 14 2007 17:51 (local time)

+

+ - Fixed: Unchecking Check-For-Updates, does check for updates, thats wrong
+

+ +

Release 2.28

+ +

Dec 14 2007 00:40 (local time)

+

+ - Added: INS (insert) / OVR (override) on status bar, changes when hitting Insert key
+ - Changed: Tab on notecards shows 'Text', where scripts shows 'Script'
+

+ + +

Dec 13 2007 23:52 (local time)

+

+ - Added: When changing to a non existing state, show warning
+ - Changed: llGetWallclock and llGetGMTclock
+

+ +

Dec 09 2007 02:30 (local time)

+

+ - Fixed: certain conditions the tab-stops at 4 chars goes to 6 chars wide
+

+ +

Dec 08 2007 15:55 (local time)

+

+ - Changed: Some Internals to pass more tests from http://wiki.secondlife.com/wiki/LSL_Language_Test
+ Some tests fail due to known issues. http://www.lsleditor.org/help/knownissues.htm
+ - Fixed: shift-home and shift-end selects from 'start' cq. 'end' of selection (only forward selection supported)
+

+ +

Dec 07 2007 02:44 (local time)

+

+ - Fixed: lsleditor crashes when using lslint plugin
+ - Added: Total char count
+ - Added: Last modified on SolutionExplorer items properties
+ - Changed: new implementation of llHTTPRequest, returns http status
+ - Changed: float shows 6 digits behind the decimal point (like SL)
+

+ +

Dec 06 2007 14:38 (local time)

+

+ - Fixed: Version 2.24 an above were broken on simple Verbose messages!!
+

+ +

Release 2.27

+ +

Dec 05 2007 17:35 (local time)

+

+ - Fixed: llModPow gives wrong answer using large numbers
+ - Fixed: Crash when clicked on errors, when script edit windows are closed
+ - Fixed: Oops Renaming files and objects in Solutionexplorer using same name but upper/lower case chars
+ - Fixed: Oops from llGetObjectDetails (only OBJECT_NAME and OBJECT_DESC implemented)
+ - Fixed: comments having unballanced string quotes do not compile
+

+ +

Release 2.26

+ +

Nov 28 2007 19:31 (local time)

+

+ - Changed: llBase64ToInteger , needs testings
+ - Changed: paint line numbers only when they are changed
+ - Changed: doubleclick selects whole words (including '_')
+

+ +

Nov 26 2007 13:33 (local time)

+

+ - Added: random return when failing to parse string in llBase64ToInteger
+ - Fixed: list constructor and large signed/unsigned integer problem
+

+ +

Nov 24 2007 19:16 (local time)

+

+ - Fixed: llListenRemove does not work
+ - Fixed: llMessageLinked adds 1 extra event when compiling
+

+ +

Release 2.25

+ +

Nov 22 2007 23:59 (local time)

+

+ - Added: true/false operators on vector and rotation
+ - Fixed: llRequestAgentData(uuid, DATA_BORN) has wrong date notation
+ - Fixed: listen event always gets the wrong sender id
+

+ +

Nov 20 2007 09:20 (local time)

+

+ - Fixed: typo on llRemoveSensor
+

+ +

Nov 19 2007 10:09 (local time)

+

+ - Fixed: llGetWallclock gives also fraction of seconds
+ - Added: X-SecondLife-Shard header in http request can be configured via menu - Tools - Options - Debugging - Internal (default = Production)
+ - Fixed: X-SecondLife-Region header in http request uses int coords.
+ - Fixed: notecards don't care about 'autocorrect indent'
+

+ +

Nov 15 2007 00:19 (local time)

+

+ - Fixed: Find and Find Replace window pushes editor to background when goes invisible
+ - Fixed: Find and Find Replace window does not focus text search box
+

+ +

Nov 14 2007 17:10 (local time)

+

+ - Added: X-SecondLife-* headers in http request
+

+ + +

Release 2.24

+ +

Nov 13 2007 01:33 (local time)

+

+ - Added: llResetLandBanList
+

+ +

Nov 10 2007 03:12 (local time)

+

+ - Fixed: Editing notecards is broken
+

+ +

Nov 09 2007 01:21 (local time)

+

+ - Fixed: CONTROL_ML_LBUTTON was missssspelleddd
+

+ +

Nov 07 2007 14:19 (local time)

+

+ - Fixed: info on llDetachFromAvatar() shows argument
+

+ +

Release 2.23

+ +

Nov 02 2007 15:53 (local time)

+

+ - Added: PRIM_SCULPT_TYPE_* constants
+

+ +

Oct 30 2007 11:53 (local time)

+

+ - Added: Findwindow uses F3 for next find
+

+ +

Oct 26 2007 10:57 (local time)

+

+ - Fixed: Some menu items use online wiki (if available), others use offline wiki
+

+ +

Oct 24 2007 14:53 (local time)

+

+ - Fixed: clicking Errors located on last line looses control on edit window
+ - Added: Shortcut keys to solution explorer
+ - Fixed: New script in solution explorer does not use indent user setting
+

+ +

Oct 23 2007 20:13 (local time)

+

+ - Changed: Shift-End, does not select the newline char
+ - Changed: LSLEditor remembers workingdirectory
+ - Changed: 'View Solutionexplorer' made persistent
+

+ +

Release 2.22

+ +

Oct 23 2007 20:13 (local time)

+

+ - Changed: When importing script, make form active.
+ - Changed: combox box for listening channels set to first channel by default
+ - Fixed: llScaleTexture has wrong arguments (and description)
+ - Changed: Menu item, "File - New - File" changed to File - New - Script"
+ - Fixed: llResetScript has to go directly to state_entry (and resetting vars)
+

+ +

Oct 22 2007 04:00 (local time)

+

+ - Changed: vars don't have to be initialised before usage
+

+ +

Oct 21 2007 20:18 (local time)

+

+ - Changed: Solution explorer, files are opened only once at a time
+ - Changed: Solution explorer, changed Prim entity to Object
+ - Changed: Solution explorer, Objects can be added to Objects
+ - Added: llMessageLinked can use linknum in solution explorer(needs testing)
+

    +
  • LINK_ROOT
  • +
  • LINK_SET
  • +
  • LINK_ALL_OTHERS
  • +
  • LINK_ALL_CHILDREN
  • +
  • LINK_THIS
  • +
+ Relationship is defined by place in solution explorer tree (no need to use llCreateLink)

+ - Fixed: the dialog is missing several buttons when using long text
+ - Changed: llDialog and llRequestPermissions removed topmost property
+

+ +

Oct 20 2007 12:09 (local time)

+

+ - Added: Contextmenu on error list, Copy or Copy Description only
+ - Fixed: plugin, lslint, possible crash on multiple line error output
+

+ +

Oct 18 2007 11:46 (local time)

+

+ - Fixed: possible crash on not initialized string
+ - Fixed: reading notecards outside solution explorer was broken
+ - Added: llGetObjectDetails (supported OBJECT_NAME, OBJECT_DESC)
+ - Added: llSensor / llSensorRepeat / llSensorRemove() / sensor (event)
+ (only simple event trigger, num_detected is always 1)
+ - Fixed: llRequestPermissions is broken
+

+ +

Oct 16 2007 23:29 (local time)

+

+ - Fixed: Old bug on multiple changed scripts saving using Ctrl-S shortcut only saves first script
+ - Fixed: Rename objects do not set object-name correctly
+

+ +

Release 2.21

+ +

Oct 16 2007 13:46 (local time)

+

+ - Changed: Find/Replace window hides when pressing Escape
+ - Changed: Find/Replace window keeps focus
+

+ +

Oct 15 2007 23:10 (local time)

+

+ - Changed: Tools menu, starts at top node
+ - Added: LSLEditor goes unicode
+ menu - tools - options - text editor - general - output format +

    +
  • ANSI (default)
  • +
  • Unicode
  • +
  • Unicode big endian
  • +
  • UTF-8
  • +
+ - Fixed: Save on new.lsl file crashes LSLEditor
+ - Changed: bugreport, Highlight entry in left pane (also when lost focus)
+ - Fixed: bugreport, 'check all / uncheck all' button has wrong initial state
+ - Changed: autocompletion on ll-functions having zero arguments (or single void argument) completes with ')' char
+ - Added: double-clicking on an error message after compile, line in edit window is highlighted
+

+ +

Oct 10 2007 10:59 (local time)

+

+ - Changed: In respect to solution explorer +

    +
  • llGetObjectDesc
  • +
  • llSetObjectDesc
  • +
  • llGetObjectName
  • +
  • llSetObjectName
  • +
+

+ +

Release 2.20

+ +

Oct 09 2007 16:12 (local time)

+

+ - Added: Plugin support
+ - Fixed: llList2Key crash
+

+ +

Oct 08 2007 23:55 (local time)

+

+ - Changed: Opened files in solution explorer are asked to save when closed
+ - Changed: bugreport, files to be included are unchecked by default
+

+ +

Oct 03 2007 19:22 (local time)

+

+ - Added: bool operators on list
+ - Fixed: Multiple 'if' indent (only on autoformat document)
+ - Added: integer operator + and - (overrides internal operators)
+ - Fixed: llParseStringKeepNulls last empty element is not added
+ - Fixed: llListSort on non string items
+ - Fixed: Sometimes scrolling is disabled when moving the cursor
+ - Fixed: Multiline comments on highlighted chars gives colored results
+ - Fixed: llList2XXX functions for negative index
+ - Added: explicit string operator on bool
+

+

Oct 02 2007 18:25 (local time)

+

+ - Added: Menu - Tools - Options - Text editor - warning on different indent scheme (on by default)
+ - Added: Menu - Tools - Options - Text editor - autocorrect indent on file loading (off by default)
+ - Fixed: changing guid on items in solutionexplorer reflects on opened script windows
+ - Changed: Wildcard autocompletion on argument, changed to show only pulldown menu (example llGetInventoryName)
+ - Added: llRot2Fwd / llRot2Up / llRot2Left
+

+ +

Release 2.19

+ +

Oct 01 2007 16:30 (local time)

+

+ - Changed: Make text bold on active tab
+ - Fixed: llUnescapeURL returns UTF8 strings, for example: llOwnerSay(llUnescapeURL("pr%c3%aate"));
+ - Fixed: Syntax errors are on column - 1
+ - Added: Command line option /run starts debugging after loading scripts (if any)
+ - Fixed: Syntax errors on scripts having same name are clickable
+ - Fixed: Copy / Paste gives wrong colors in editor
+

+ +

Sep 29 2007 21:35 (local time)

+

+ - Added: Changing Guid of any item in solution explorer
+ - Changed: manual listen event trigger, channel is combobox
+ (listen filter does only work on normal chat messages, not on manual event trigger)
+ - Added: Ctrl-C copies selected errors to clipboard
+ - Added: Ctrl-A selects all text errors list
+ - Added: Ctrl-A selects all text in debug and simulator console
+ - Added: Line, Column and Char position of cursor (added Column)
+ - Fixed: "There are 0 instances, replace them all?"
+ - Fixed: var names containing 'jump' are wrongly parsed
+ - Fixed: llAttachToAvatar wrong description
+

+ +

Sep 22 2007 19:29 (local time)

+

+ - Fixed: Selection from last line does not work
+

+ +

Release 2.18

+ +

Sep 21 2007 19:09 (local time)

+

+ - Fixed: SaveAs was broken
+ - Fixed: autocompletion on 'default', only when there is no default state
+ - Fixed: state change to same state, acts like a return
+ - Changed: Ctrl-D (format document) keeps cursor on line
+ - Changed: Ctrl-E (format selection) keeps text selected
+ - Added: Tools - Options - Debugging - General - Quoted strings in list output (default = none)
+ - Changed: Major change to the list object (needs testing)
+ - Fixed: Some minor indent bug on outermost braces when typing
+ - Changed: Verbose output gives more readable lists
+ - Fixed: llParseString2List and llParseStringKeepNulls (needs testing)
+

+ +

Sep 19 2007 16:47 (local time)

+

+ - Added: http 'ContentLength' on llHTTPRequest POST requests
+

+ +

Release 2.17

+ +

Sep 19 2007 12:47 (local time)

+

+ - Fixed: Closing LSLEditor saves (all) changed files using its own name, example files (new.lsl) shows dialog
+

+ +

Sep 18 2007 12:47 (local time)

+

+ - Fixed: Labels can have whitespace between @ and label name
+

+ +

Sep 17 2007 14:41 (local time)

+

+ - Added: Tools - Options - Debugging - General - Single Quote char allowed outside strings
+

+ +

Sep 16 2007 14:41 (local time)

+

+ - Fixed: Typing many '}' on same lines, gives weird autoformatting
+ - Fixed: Bracket highlighting when typing braces (curly brackets)
+ - Fixed: Rotation '/' operator
+

+ +

Sep 15 2007 17:45 (local time)

+

+ - Added: Update application supports 'gzip','zip' and 'bzip2'
+ - Changed: Richlabel has some extra right margin
+ - Fixed: 4-Spaces indent was broken on tools menu
+ - Fixed: Annoying scroll when bracket highligthing and code formatting
+ - Fixed: 'If you see this, something is wrong' on state change and llResetScript
+ - Fixed: Die button kills runaway processes like 'while(TRUE);'
+ - Added: Icons for errors and warnings
+ - Added: Compiler generates warnings (can be switched off in menu Tools - Options - Debugging - General)
+

+ +

Sep 14 2007 10:52 (local time)

+

+ - Fixed: llOwnerSay talks only to the owner, preventing possible loops
+

+ +

Sep 13 2007 16:39 (local time)

+

+ - Added: Date/time on printed output
+ - Changed: Case insensitive on ECC
+

+ +

Release 2.16

+ +

Sep 13 2007 12:10 (local time)

+

+ - Added: Experimental Code Completion (ECC) on user defined variable names, menu - tools - options - Text Editor - Code Completion
+ - Changed: Escape toggles on/off autocompletion and tooltips
+

+ +

Sep 12 2007 16:28 (local time)

+

+ - Added: Pagesetup margins on printed documents
+ - Added: header and footer on printed documents
+ - Added: Print selection
+ - Fixed: llList2ListStrided crashed for nonsense (<=0) strides
+

+ +

Sep 11 2007 17:07 (local time)

+

+ - Added: Ctrl-Del removes whitespace/word
+ - Fixed: llToUpper / llToLower gives wrong hint
+

+ +

Sep 06 2007 13:35 (local time)

+

+ - Fixed: First users see only a small window
+

+ +

Release 2.15

+ +

Sep 03 2007 17:00 (local time)

+

+ - Fixed: Renaming of non scripts and non notecards
+ - Added: Solution Explorer, changing filetype of items
+ - Changed: Solution Explorer, project and inventory paths are saved as a relative path to solution file (if possible)
+ - Changed: Solution Explorer, "Add New File -> Script" , have it use the default.lsl file, same as "new.lsl" when opening.
+ - Fixed: 0xFFFFFFFF parsed as integer
+ - Fixed: capitalization of 'string' and 'float'
+ - Added: PRIM_TYPE_SCULPT constant
+

+ +

Aug 31 2007 12:07 (local time)

+

+ - Fixed: Recent projects menu blocks when dirty script has to be saved
+ - Added: Menu - Tools - Options - Environment - General - delete old files after update
+

+ +

Release 2.14

+ +

Aug 27 2007 12:07 (local time)

+

+ - Fixed: Crash in Renaming files containing illegal chars in Solutionexplorer
+ - Fixed: Find / Replace broken
+ - Fixed: Labels are broken
+

+ +

Aug 24 2007 15:30 (local time)

+

+ - Added: Menu - Project - Add New File , add new file to active Prim in SolutionExplorer (if Any)
+ - Added: Check if solution file already exist when Create new solution
+ - Added: F3 shortcut for 'Find Next'
+ - Fixed: Pressing Ctrl-H twice crashes program
+ - Added: Multiline strings
+ - Fixed: String (capital S) can be used as a var
+ - Added: Explicit string operator on internal integer
+ - Added: File Association for .lsl and .sol files (Menu-Tools)
+

+ +

Aug 23 2007 23:02 (local time)

+

+ - Fixed: Linenumbers incorrect after scrolling
+ - Fixed: default state has not to be on column 0
+ - Fixed: When user clicks 'No' on llRequestPermissions, do trigger run_time_permissions
+ - Fixed: Brackets highlighting now skips comments
+ - Changed: Online Wiki Address can be changed
+ - Changed: Bugreport shows unique number and date/time
+ - Changed: Bugreport uploadservice can handle normal filenames, spaces included ;-)
+ - Added: llGetInventoryType (when using solution explorer)
+ - Changed: Blockcommenting Ctrl-K and Ctrl-L (also on non selected line)
+

+ +

Release 2.13

+ +

Aug 22 2007 17:57 (local time)

+

+ - Fixed: Crash on making default state
+ - Fixed: Linenumbers only appear when scrolling
+ - Fixed: Crash on some debug code, writing to D drive
+ - Fixed: float parsing on lists does Oops...
+ - Added: Experimental wildcard argument completion (for example llListStatistics)
+ - Fixed: Tooltip on codecompletion can not get outside client area
+ - Fixed: Coloring when typing strings
+ - Fixed: indenting fails on strings containing // chars
+

+ +

Aug 21 2007 19:28 (local time)

+

+ - Changed: Reading scripts using default codepage
+ - Added: llListStatistics (needs more testing)
+ - fixed: llCSV2List escapes angle brackets
+

+ +

Aug 20 2007 23:48 (local time)

+

+ - Fixed: Find / Find and Replace window mixes up settings
+ - Fixed: Sending bugreport crashes editor when offline
+

+ +

Aug 18 2007 21:19 (local time)

+

+ - Changed: new Tools Options menu
+ - Fixed: Single quotation char in comment breaks parsing
+

+ +

Aug 17 2007 19:22 (local time)

+

+ - Fixed: Quad and Vector parsing breaks at certain conditions
+ - Fixed: some changes to text do not set dirty flag
+

+ +

Aug 16 2007 23:57 (local time)

+

+ - Fixed: changing state into same state goes into loop
+ - Fixed: llCSV2List is not really inverse to llList2CSV (llCSV2List does not parse rotations and vectors, yet)
+ - Fixed: labels without ';' does not give syntax error
+ - Fixed: jump @label; does not give syntax error
+ - Fixed: floats getting truncated on non-English systems
+ - Changed: Position and Size of editor window are only restored when in workingarea of Primary screen
+ - Fixed: Script error on download HTML Help file
+

+ +

Aug 15 2007 17:51 (local time)

+

+ - Fixed: Don't compile nor syntax check notecards using solution explorer
+ - Added: llInsertString
+ - Fixed: llGiveInventoryList has wrong ref argument (syntax check breaks)
+ - Fixed: Tab and Shift Tab on selected text
+ - Added: Toggle button check / uncheck attached scripts on the bugreport form
+ - Fixed: Argument of event changed(integer change)
+ - Changed: Sending bugreports can be canceled
+ - Changed: implicit float to integer operator to explicit
+

+ +

Release 2.12

+ +

Aug 10 2007 13:13 (local time)

+

+ - Added: LSLEditorHelp offline wiki (Tools - Editor properties)
+ - Changed: Find window keeps search entries
+

+ +

Aug 05 2007 00:30 (local time)

+

+ - Fixed: Cursor position on backspace
+

+ +

Aug 03 2007 16:50 (local time)

+

+ - Added: Ctrl-F (find) uses keyword on cursor position
+ - Added: Ctrl-Up / Ctrl-Down history scrolling on chat box
+ - Fixed: llSetLinkTexture() do not take texture uuids
+ - Fixed: llParseString2List refuse to take keys as strings
+ - Added: Solution Explorer, F2 for rename
+ - Added: default.lsl in LSL-Editor directory will be used as 'new.lsl' template
+ - Fixed: llSetColor tooltip is wrong
+

+ +

Aug 02 2007 23:42 (local time)

+

+ - Added: Smtp Authentication for llEmail (Tools, Runtime Properties, External, Email)
+

+ +

Release 2.11

+ +

Jul 30 2007 16:19 (local time)

+

+ - Added: Home key works also on white-space lines
+ - Fixed: After sending two bugreports, button is disabled
+ - Added: POST method to llHttpRequest (untested)
+

+ +

Jul 28 2007 12:05 (local time)

+

+ - Fixed: Richtext label inserts spaces after color change
+ - Added: Sound support (simple) use llPlaySound and .wav file in solution explorer
+

+ +

Jul 26 2007 13:29 (local time)

+

+ - Added: PageUp and PageDown on intellisense dropdown menu
+ - Fixed: Editor crash when closing project having browser window open
+ - Added: llGetLocalPos()
+

+ +

Release 2.10

+ +

Jul 25 2007 14:30 (local time)

+

+ - Added: Solution Explorer (first look)
+

    +
  • llGetObjectName
  • +
  • llGetScriptName
  • +
  • llGetKey
  • +
  • llGetInventoryName
  • +
  • llGetInventoryKey
  • +
  • llGetInventoryNumber
  • +
  • llGetNumberOfNotecardLines
  • +
  • llGetNotecardLine
  • +
+ - Added: Reset option on Editor properties
+ - Added: mod operator (%) on integer
+

+ +

Jul 24 2007 11:55 (local time)

+

+ - Changed: Recent file list is clipped (showing ...)
+ - Fixed: Syntax error on negative line numbers (?!) breaks editor
+

+ +

Jul 20 2007 10:55 (local time)

+

+ - Added: Checkbox on Edit tab to Disable compile / syntaxcheck
+ - Added: Allow scripts to open by Drag and Drop on LSL-Editor
+ - Fixed: Indent on return when in middle of a line
+ - Added: llGetDate
+ - Fixed: llDie in script does not work, throws an error
+ - Changed: id in llMessageLinked / message_link accepts strings
+

+ +

Jul 19 2007 15:27 (local time)

+

+ - Added: Bugtracker to Menu Help , Bugreport
+ - Changed: Home button toggles between start of line, and first non whitespace
+

+ +

Release 2.9

+ +

Jul 16 2007 11:25 (local time)

+

+ - Changed: Autocompletion images scale on changing fonts
+ - Changed: Tab alignement on changing fonts
+

+ +

Jul 15 2007 23:51 (local time)

+

+ - Added: Editor Properties, Font selector for editor and tooltips
+ - Fixed: Ctrl-X does not have paste
+

+ +

Jul 13 2007 15:20 (local time)

+

+ - Changed: Bugreport name and email adres made sticky
+ - Fixed: Bugreport window looses focus when tooltip shows
+ - Added: Shift-Delete
+ - Fixed: Ctrl-X can not undo
+ - Fixed: Ctrl-Home does not go to line 1, column 1
+ - Fixed: Shift-Home does not appear to select text
+

+ +

Jul 12 2007 12:59 (local time)

+

+ - Fixed: Tooltip shows bold on some High-Resolution machines (David IOU1)
+

+ +

Release 2.8

+ +

Jul 10 2007 08:41 (local time)

+

+ - Fixed: Runtime properties, incorrect key from cache (xor)
+

+ +

Jul 9 2007 14:51 (local time)

+

+ - Added: Editor properties: Auto update frequency
+ - Added: Editor properties: Indent settings
+

+ +

Jul 8 2007 23:59 (local time)

+

+ - Changed: Tooltip font is SystemFonts.MessageBoxFont
+ - Fixed: llRot2Up returns void....
+

+ +

Jul 6 2007 13:13 (local time)

+

+ - Fixed: MD5 checksum on update function breaks
+ - Added: Boundary checks on list functions
+ - Fixed: jump statement gives error (_goto)
+

+ +

Release 2.7

+ +

Jul 4 2007 12:12 (local time)

+

+ - Added: Bitwise Xor operator on integer (^)
+

+ + +

Jul 3 2007 20:56 (local time)

+

+ - Fixed: XML-RPC server not closed when closing LSL-Editor
+

+ +

Jul 2 2007 14:41 (local time)

+

+ - Fixed: Size of Simulator resets to default
+ - Changed: Vector and Rotation parser
+ - Changed: Vector and Rotation fields changed from double to float
+ - Added: Preprocessor processes all internal reserved words
+ - Changed: llDialog / llRequestPermissions / link_message / llMessageLinked uses new TaskQueue
+

+ +

Jul 1 2007 23:55 (local time)

+

+ - Added: Smart indenting on closing parenthesis (experimental)
+ - Revised: (Needs testing!!) +

    +
  • llGetSubString
  • +
  • llDeleteSubString
  • +
  • llList2List
  • +
  • llDeleteSubList
  • +
+ - Added: +
    +
  • llIntegerToBase64
  • +
  • llBase64ToInteger
  • +
  • llStringToBase64
  • +
  • llBase64ToString
  • +
  • llXorBase64StringsCorrect
  • +
+

+ +

Jun 30 2007 11:41 (local time)

+

+ - Fixed: Can't close tabs when in Windows Classic mode
+ - Changed: Internal, state / event has its own TaskQueue (needs testing)
+

+ +

Jun 29 2007 16:38 (local time)

+

+ - Fixed: Integer '~' operator works only on TRUE/FALSE
+ - Added: Syntax checker button F6 (no compile / execute)
+ - Changed: Internal, Simulator / Compiler as usercontrols
+

+ +

Jun 28 2007 12:18 (local time)

+

+ - Added: Ctr-Shft-S to Save as...
+ - Added: AutoUpdate check (daily) / Manual update on Help menu
+ - Added: Double click on compiler error goes to error line / column
+ - Changed: Compiler errors shows on listview
+ - Changed: Tab / Shift Tab , toggles indent block of text
+ - Changed: Home button sets cursor to beginning of line, after whitespace
+

+ +

Release 2.6

+ +

Jun 27 2007 18:20 (local time)

+

+ - Fixed: Editor crashes on error in dataserver script
+ - Changed: synchronized llGetNumberOfNotecardLines / llGetNotecardLine dataserver requests
+

+ +

Jun 26 2007 11:49 (local time)

+

+ - Fixed: llDialog does not talk anymore
+

+ +

Jun 25 2007 21:08 (local time)

+

+ - Fixed: Indent adds tab on lines ending in comment or whitespace
+ - Added: XML-RPC listening base port 50888
+

    +
  • remote_data (event)
  • +
  • llOpenRemoteDataChannel
  • +
  • llCloseRemoteDataChannel
  • +
  • llRemoteDataReply
  • +
  • llSendRemoteData (untested)
  • +
+ - Fixed: Tooltips shows 'lt;' and 'gt;'
+ - Added: Bugreport to Menu Help
+ - Added: llLoadURL
+ - Added: listen callbacks are removed on state change
+ - Added: llListenControl
+

+

Jun 24 2007 13:11 (local time)

+

+ - Added: Print preview
+ - Fixed: Editor only prints 1 page
+ - Added: ReplaceAll
+ - Fixed: Find and Replace issues
+

+

Jun 22 2007 18:59 (local time)

+

+ - Added: The ~ (complement) operator to integer
+ - Fixed: global functions containing whitespace gives compile error
+ - Added: Keep user settings between LSLEditor updates
+ - Added: llGetNumberOfNotecardLines / llGetNotecardLine
+ - Added: Recent files list in the File menu
+

+ +

Jun 21 2007 13:41 (local time)

+

+ - Fixed: Compiles empty documents and/or absent default state
+

+ +

Release 2.5

+ +

Jun 20 2007 22:41 (local time)

+

+ - Fixed: Menu Tools does not work
+ - Added: llStringTrim
+

+ +

Jun 18 2007 14:50 (local time)

+

+ - Fixed: Backspace / Delete issues when brackets highlighted
+

+ +

Jun 14 2007 23:59 (local time)

+

+ - Fixed: Backspace unreliable when brackets highlighted
+ - Changed: Tab-characters have same width as 4 spaces
+ - Changed: auto indent on typing if/else
+ - Changed: format document indent if/else
+ - Fixed: timer stops after state change
+ - Fixed: llList2Integer broken
+ - Added: llMessageLinked / link_message
+ - Fixed: llListReplaceList gives wrong answer
+

+ +

Jun 13 2007 20:21 (local time)

+

+ - Fixed: key problem (breaks listen and more)
+

+ +

Release 2.4

+ +

Jun 13 2007 12:12 (local time)

+

+ - Release 2.4
+

+ +

Jun 12 2007 16:43 (local time)

+

+ - Fixed: llSetTimerEvent broken
+ - Added: Redo
+ - Changed: Linenumbers stops at and-of-document
+ - Fixed: Cursorposition shows on closed tab
+ - Changed: Close button on tab shows on mouse hover
+ - Fixed: Argument typing shows wrong color
+ - Fixed: Slow brackets matching
+ - Fixed: Slow editing large documents / long lines
+

+ +

Jun 11 2007 11:36 (local time)

+

+ - Fixed: Line numbers incorrect after delete all
+ - Fixed: Cursor position does not show on non primary script
+ - Fixed: Undo eats memory
+ - Fixed: Undo slow on large documents
+

+

Jun 09 2007 11:44 (local time)

+

+ - Added: brackets matching
+

    +
  • parentheses or round brackets: ( )
  • +
  • box brackets or square brackets: [ ]
  • +
  • curly brackets or braces: { }
  • +
  • angle brackets or chevrons: < >
  • +
+

+

Jun 08 2007 19:35 (local time)

+

+ - Fixed: Undo after find / replace
+ - Fixed: Undo does nothing
+ - Added: Color scheme for tooltips
+ - Fixed: Missing spaces in tooltips
+ - Fixed: Keyboard hint vertical position changes
+ - Fixed: Mouse Tooltip shows on EOL
+

+ +

Jun 07 2007 13:41 (local time)

+

+ - Added: Find and Replace
+

+ +

Release 2.3

+ +

Jun 06 2007 17:01 (local time)

+

+ - Fixed: Editor does not show on taskbar
+ - Added: bool operators on key
+ + - Added: Operator vector / rotation
+ - Fixed: Save Ctrl-S in debug session
+

+

Jun 05 2007 23:33 (local time)

+

+ - Fixed: A lot of operators
+ - Fixed: llDeleteSubString
+ - Added: Block commenting Ctrl-K Ctrl-L
+ - Fixed: Compiler errors hide internal types
+ - Improved: parsing strings, including escape chars
+ - Changed: No codecompletion nor hints typing within strings
+ - Changed: No codecompletion nor hints typing within comments
+ - Fixed: blind tabs showing again on XP without VisualStyles
+ - Added: Shortcutkeys for formatting
+

+

Jun 04 2007 21:52 (local time)

+

+ - Changed: replaced double by float
+ - Fixed: Parsing long files takes to much time
+ - Fixed: Line-numbers frozen
+ - Fixed: compile error on 'state' between quotes
+ - Fixed: AutoWordSelection problem appears to be an insolvable Microsoft bug, ... i solved it
+ - Added: Showing Line / Character position of cursor on statusbar
+

+

Jun 03 2007 20:54 (local time)

+

+ - Fixed: AutoWordSelection off, and stay off
+ - Fixed: indent whitespace can be a mix of tab and spaces
+ - Added: default / state to autocompletion ;-)
+ - Added: operators + and - for rotation / rotation
+ - Added: operators multiplication of vector / rotation
+ - Added: operators multiplication and division of rotation / rotation
+

+

Jun 02 2007 18:58 (local time)

+

+ - Added: llAxisAngle2Rot
+ - Added: some vector operators
+ - Fixed: codecompletion tooltip disappears when hitting arrow keys
+ - Fixed: blind tabs showing again on XP without VisualStyles
+

+

Jun 01 2007 23:34 (local time)

+

+ - Added: at_target, http_response and remote_data events
+ - Added: Goto form acts on return key
+ - Added: First implementation of llDialog
+ - Fixed: VisualStyleRenderer crash on startup
+ - Fixed: Indent was broken
+ - Added: implicit string operator on key
+ - Added: implicit bool operators to string class
+

+ +

May 31 2007 23:55 (local time)

+

+ - Added: llSleep
+ - Added: Editor Goto Line (Ctrl-G)
+ - Added: Ctrl-F4 closes active window/tab
+ - Added: Editor option Wiki-pages in Seperate browser
+ - Fixed: Linenumber drawing double-buffered in editor
+ - Added: Close button to Tab pages
+ - Fixed: 'Tab' key inserts a tab character or 4-space characters, depending on the Editor-settings
+ - Fixed: timer problem when changing states
+

+ +

May 29 2007 16:41 (local time)

+

+ - Improved: parenthesis indenting old 'C' style accepted
+ - Added Editor options: Auto Word Selection (off by default)
+ - Fixed: Linenumber drawing double-buffered in editor
+ - Added a 'Die' button to the compiler
+ - Added Editor options: SL (ugly) color-scheme / SL 4-spaces indent
+ - Fixed: crash on editing end-of-document
+ - Fixed: void argument on events
+

+ +

May 28 2007 23:34 (local time)

+

+ - Autocompletion including arguments on 'events'
+ - Fixed: incorrect color on pasting text
+ - Fixed: autoformatting on selected text
+ - Fixed: incorrect old argument list on non-functions
+

+ +

May 27 2007 13:15 (local time)

+

+ - llListFindList bug fixed
+ - added comparison operators for list,key,float,integer,vector and rotation
+ - when opening an existing document, the untouched 'new.lsl' example is destroyed
+

+ +

Release 2.2

+ +

May 26 2007 18:00 (local time)

+

+ - Tooltipping / Codecompletion hitting the boundaries of parent window
+

+ +

May 25 2007 11:28 (local time)

+

+ - Explicit cast 'list' implemented for string,integer,key,float,vector and rotation
+

+ +

May 24 2007 19:34 (local time)

+

+ - Compiler error shows correct line numbers
+ - Debug tab only visible when there are no compile errors
+ - Removed C# tab
+ - Small bug fixed, on empty information, when using codecompletion
+ - Codecompletion shows ALL keywords
+ - Shows '*' after filename when document is changed
+

+ +

May 23 2007 21:03 (local time)

+

+ - Compiler starts at Output tab, on error shows C# tab
+ - Tabbed documents!!
+ Thanks to Darek and Marco for their bug reports:
+ - Fixed: Operator '+' is ambiguous on operands of type 'LSLEditor.SecondLife.integer' and 'LSLEditor.SecondLife.integer'
+ - Fixed: Operator '+=' cannot be applied to operands of type 'LSLEditor.SecondLife.list' and 'double'
+ - Fixed: Operator '+=' cannot be applied to operands of type 'LSLEditor.SecondLife.list' and 'LSLEditor.SecondLife.key'
+ - Copy from the debug window enabled
+

+ +

May 22 2007 23:46 (local time)

+

+ - Bug fix on empty key in Sim properties
+ - Show function arguments while typing
+

+ + +

May 16 2007 13:07 (local time)

+

+ - Simulator docks at bottom
+

+ +

Release 2.1

+ +

May 14 2007 22:47 (local time)

+

+ - Release 2.1 (Multiple document interface)
+ - Running multiple LSL scripts concurrent
+ - Chat/listen implementation between LSL scripts
+ - First implementation of a 'find' (Ctrl-F) option
+

+

May 08 2007 16:37 (local time)

+

+ - llListRandomize
+ - llListSort
+ - llListReplaceList (to be tested)
+ - llParseString2List (todo spacers)
+ - llParseStringKeepNulls (todo spacers)
+

+ +

May 07 2007 19:53 (local time)

+

+ - llMD5String implemented + - Implemented a lot of list functions (see examples)
+ - Fixed state bug
+ - llResetScript()
+ - Tooltip improved
+

+ +

May 06 2007 13:03 (local time)

+

+ - Parser improved a lot!!
+

+ +

May 04 2007 17:15 (local time)

+

+ - LSL keywords updated 19 Dec 2006 for LSL 1.13
+

+

May 03 2007 18:49 (local time)

+

+ - Execution is more stable, and useful error reports :-)
+ - Implemented listen filter (llListen / llListenRemove)
+ - some minor bugfixes
+

+

May 02 2007 19:41 (local time)

+

+ - llListFindList implemented
+ - KEY_NULL implemented
+ - key compare
+ - llGetOwnerKey returns key in compiler properties
+ - llToLower / llToUpper
+ - llEuler2Rot / llRot2Euler
+ - Code completion shows function arguments when typing
+ - Cleaned the resource files
+ - Updated a lot more, can't remember ;-)
+

+ +

May 01 2007 13:47 (local time)

+

+ - Manual Chat works, on different channels (listen) +

+

Apr 30 2007 23:57 (local time)

+

+ - Format document (Edit -> Advanced -> Format Document)
+ - llFrand seeding
+ - casting bug fixed (parser)
+ - run_time_permissions event bug fixed
+ - llDialog shows messagebox (no buttons)
+ - Did some testing on "Shippou Oud - Fruit machine"
+ - Import Examples
+ - Timer bug fixed
+ - Al lot of internal base class changes
+

+ +

Apr 29 2007 15:29 (local time)

+

First implementation of linenumbers

+ +

Release 2.0

+ +

Apr 28 2007 14:01 (local time)

+

Changed project to .NET 2.0

+ +

Mar 30 2007 12:54 (local time)

+

- changed wiki adres

+ +

Jan 2007 - Mar 2007

+

- Sabbatical :-), doing nothing....

+ +

Dec 26 2006 12:54 (local time)

+

- first implementation of printing

+

Nov 21 2006 23:22 (local time)

+

- delete key bug fixed

+

Nov 08 2006 00:40 (local time)

+

- got Strife _double back in place
+ - some C# coloring

+

Nov 05 2006 14:54 (local time)

+

- Just some minor updates, lack of time at the moment

+

Oct 29 2006 01:00 (local time)

+

- State change fires state_exit and state_entry
+ - compiler on tabcontrole

+

Oct 28 2006 02:00 (local time)

+

- Float2Hex example compiles (thanx to Strife Onizuka)

+

Oct 27 2006 21:59 (local time)

+

- Global class compiles correctly on vars (static) and user defined + functions (void and non void)

+

Oct 26 2006 01:07 (local time)

+

- code completion, tab/return and contains icons for different types
+ - other type of tooltipping.... not nice.
+ - override & , to make it bool answer...

+

Oct 25 2006 01:46 (local time)

+

- http can use proxy
+ - smtp
+ - properties windows for compiler
+ - integer made out of struct, to override (string) explicit operator

+

Oct 22 2006 21:43 (local time)

+

- first implementation of llHTTPRequest / http_response
+ - made a lot of lists functions
+ - more lists on one line (not lists within lists)

+

Oct 20 2006 21:00 (local time)

+

- State change, shows correct events

+

Oct 20 2006 0:03 (local time)

+

- Implemented (almost) all Math functions
+ - Timer works

+

Oct 19 2006 03:00 (local time)

+

- some edit improvements
+ - states work!!

+

Oct 16 2006 23:50 (local time)

+

- Improvement parsing script, vector,rotation, simple list (one line)
+ - Global vars, wrapped in global class
+ - Checkupdate function in the program
+ - First attempt multiple state (only default state executes, have patients + my friends...)

+

Oct 14 2006 18:36 (local time)

+

- User argument input for events like touch_start (see picture above)

+

Oct 8, 2006 18:36 (local time)

+

- Code highlighting
+ - Code completion
+ - Code info, took the old LSLguide, and used Appendix, i can do better i + know
+ - F1 , on a keyword, does show up the LSLWiki page on the keyword
+ - Compile, the hello world example should work on state_entry event
+ - Open/Save and edit lsl script files

+

Oct 2, 2006 (local time)

+ +

Release 1.0

+ +

First idea and prototype

+ +

Oct 1, 2006 (local time)

+ +
diff --git a/obj/Debug/LSLEditor.Resource.ToolsOptions.xml b/obj/Debug/LSLEditor.Resource.ToolsOptions.xml new file mode 100644 index 0000000..048f3d5 --- /dev/null +++ b/obj/Debug/LSLEditor.Resource.ToolsOptions.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/obj/Debug/LSLEditor.Resource.thanks.gif b/obj/Debug/LSLEditor.Resource.thanks.gif new file mode 100644 index 0000000..e4b6c2a Binary files /dev/null and b/obj/Debug/LSLEditor.Resource.thanks.gif differ diff --git a/obj/Debug/LSLEditor.RichLabel.resources b/obj/Debug/LSLEditor.RichLabel.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.RichLabel.resources differ diff --git a/obj/Debug/LSLEditor.RuntimeConsole.resources b/obj/Debug/LSLEditor.RuntimeConsole.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.RuntimeConsole.resources differ diff --git a/obj/Debug/LSLEditor.SimulatorConsole.resources b/obj/Debug/LSLEditor.SimulatorConsole.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.SimulatorConsole.resources differ diff --git a/obj/Debug/LSLEditor.Solution.GuidProperty.resources b/obj/Debug/LSLEditor.Solution.GuidProperty.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Solution.GuidProperty.resources differ diff --git a/obj/Debug/LSLEditor.Solution.SolutionExplorer.resources b/obj/Debug/LSLEditor.Solution.SolutionExplorer.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Solution.SolutionExplorer.resources differ diff --git a/obj/Debug/LSLEditor.Solution.SvnAguments.resources b/obj/Debug/LSLEditor.Solution.SvnAguments.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Solution.SvnAguments.resources differ diff --git a/obj/Debug/LSLEditor.SyntaxError.resources b/obj/Debug/LSLEditor.SyntaxError.resources new file mode 100644 index 0000000..ac95f2d Binary files /dev/null and b/obj/Debug/LSLEditor.SyntaxError.resources differ diff --git a/obj/Debug/LSLEditor.SyntaxRichTextBox.resources b/obj/Debug/LSLEditor.SyntaxRichTextBox.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.SyntaxRichTextBox.resources differ diff --git a/obj/Debug/LSLEditor.Tools.EnvironmentBrowser.resources b/obj/Debug/LSLEditor.Tools.EnvironmentBrowser.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.EnvironmentBrowser.resources differ diff --git a/obj/Debug/LSLEditor.Tools.EnvironmentGeneral.resources b/obj/Debug/LSLEditor.Tools.EnvironmentGeneral.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.EnvironmentGeneral.resources differ diff --git a/obj/Debug/LSLEditor.Tools.EnvironmentHelp.resources b/obj/Debug/LSLEditor.Tools.EnvironmentHelp.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.EnvironmentHelp.resources differ diff --git a/obj/Debug/LSLEditor.Tools.EnvironmentPlugins.resources b/obj/Debug/LSLEditor.Tools.EnvironmentPlugins.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.EnvironmentPlugins.resources differ diff --git a/obj/Debug/LSLEditor.Tools.ProjectSettings.resources b/obj/Debug/LSLEditor.Tools.ProjectSettings.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.ProjectSettings.resources differ diff --git a/obj/Debug/LSLEditor.Tools.RuntimeExternal.resources b/obj/Debug/LSLEditor.Tools.RuntimeExternal.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.RuntimeExternal.resources differ diff --git a/obj/Debug/LSLEditor.Tools.RuntimeGeneral.resources b/obj/Debug/LSLEditor.Tools.RuntimeGeneral.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.RuntimeGeneral.resources differ diff --git a/obj/Debug/LSLEditor.Tools.RuntimeInternal.resources b/obj/Debug/LSLEditor.Tools.RuntimeInternal.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.RuntimeInternal.resources differ diff --git a/obj/Debug/LSLEditor.Tools.RuntimeSmtp.resources b/obj/Debug/LSLEditor.Tools.RuntimeSmtp.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.RuntimeSmtp.resources differ diff --git a/obj/Debug/LSLEditor.Tools.TextEditorCodeCompletion.resources b/obj/Debug/LSLEditor.Tools.TextEditorCodeCompletion.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.TextEditorCodeCompletion.resources differ diff --git a/obj/Debug/LSLEditor.Tools.TextEditorFontColors.resources b/obj/Debug/LSLEditor.Tools.TextEditorFontColors.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.TextEditorFontColors.resources differ diff --git a/obj/Debug/LSLEditor.Tools.TextEditorGeneral.resources b/obj/Debug/LSLEditor.Tools.TextEditorGeneral.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.TextEditorGeneral.resources differ diff --git a/obj/Debug/LSLEditor.Tools.ToolsOptions.resources b/obj/Debug/LSLEditor.Tools.ToolsOptions.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.ToolsOptions.resources differ diff --git a/obj/Debug/LSLEditor.Tools.VersionControlGeneral.resources b/obj/Debug/LSLEditor.Tools.VersionControlGeneral.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.Tools.VersionControlGeneral.resources differ diff --git a/obj/Debug/LSLEditor.TooltipWindow.resources b/obj/Debug/LSLEditor.TooltipWindow.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.TooltipWindow.resources differ diff --git a/obj/Debug/LSLEditor.UpdateApplicationForm.resources b/obj/Debug/LSLEditor.UpdateApplicationForm.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.UpdateApplicationForm.resources differ diff --git a/obj/Debug/LSLEditor.exe b/obj/Debug/LSLEditor.exe new file mode 100644 index 0000000..6f53499 Binary files /dev/null and b/obj/Debug/LSLEditor.exe differ diff --git a/obj/Debug/LSLEditor.llDialogForm.resources b/obj/Debug/LSLEditor.llDialogForm.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/LSLEditor.llDialogForm.resources differ diff --git a/obj/Debug/LSLEditor.pdb b/obj/Debug/LSLEditor.pdb new file mode 100644 index 0000000..00ec7f5 Binary files /dev/null and b/obj/Debug/LSLEditor.pdb differ diff --git a/obj/Debug/NumberedTextBox.NumberedTextBoxUC.resources b/obj/Debug/NumberedTextBox.NumberedTextBoxUC.resources new file mode 100644 index 0000000..06c24d0 Binary files /dev/null and b/obj/Debug/NumberedTextBox.NumberedTextBoxUC.resources differ diff --git a/obj/Debug/SyntaxHighlighter.SyntaxRichTextBox.resources b/obj/Debug/SyntaxHighlighter.SyntaxRichTextBox.resources new file mode 100644 index 0000000..d42e555 Binary files /dev/null and b/obj/Debug/SyntaxHighlighter.SyntaxRichTextBox.resources differ diff --git a/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..006dc52 Binary files /dev/null and b/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/obj/Debug/TempPE/Web References.org.lsleditor.www.Reference.cs.dll b/obj/Debug/TempPE/Web References.org.lsleditor.www.Reference.cs.dll new file mode 100644 index 0000000..d4a93f2 Binary files /dev/null and b/obj/Debug/TempPE/Web References.org.lsleditor.www.Reference.cs.dll differ diff --git a/obj/Debug/lsleditor-2.15.csproj.GenerateResource.Cache b/obj/Debug/lsleditor-2.15.csproj.GenerateResource.Cache new file mode 100644 index 0000000..8102f15 Binary files /dev/null and b/obj/Debug/lsleditor-2.15.csproj.GenerateResource.Cache differ diff --git a/obj/Debug/lsleditor-beta.csproj.GenerateResource.Cache b/obj/Debug/lsleditor-beta.csproj.GenerateResource.Cache new file mode 100644 index 0000000..f76036c Binary files /dev/null and b/obj/Debug/lsleditor-beta.csproj.GenerateResource.Cache differ diff --git a/obj/Debug/lsleditor.csproj.GenerateResource.Cache b/obj/Debug/lsleditor.csproj.GenerateResource.Cache new file mode 100644 index 0000000..6a78d42 Binary files /dev/null and b/obj/Debug/lsleditor.csproj.GenerateResource.Cache differ diff --git a/obj/Debug/lsleditor.projdata b/obj/Debug/lsleditor.projdata new file mode 100644 index 0000000..69a3f11 Binary files /dev/null and b/obj/Debug/lsleditor.projdata differ diff --git a/obj/lsleditor-2.15.csproj.FileList.txt b/obj/lsleditor-2.15.csproj.FileList.txt new file mode 100644 index 0000000..039e0b7 --- /dev/null +++ b/obj/lsleditor-2.15.csproj.FileList.txt @@ -0,0 +1,101 @@ +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\LSLEditor.Resource.ConfLSL.xml +obj\Debug\LSLEditor.Resource.ConfCSharp.xml +obj\Debug\LSLEditor.Resource.ToolsOptions.xml +obj\Debug\LSLEditor.Images.Class.gif +obj\Debug\LSLEditor.Images.Constants.gif +obj\Debug\LSLEditor.Images.Enum.gif +obj\Debug\LSLEditor.Images.Events.gif +obj\Debug\LSLEditor.Images.Functions.gif +obj\Debug\LSLEditor.Images.Namespace.gif +obj\Debug\LSLEditor.Images.Properties.gif +obj\Debug\LSLEditor.Images.SealedClass.gif +obj\Debug\LSLEditor.Images.Unknown.gif +obj\Debug\LSLEditor.Images.Close-Active.gif +obj\Debug\LSLEditor.Images.Close-Disabled.gif +obj\Debug\LSLEditor.Images.Close-Inactive.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Animation.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Animations.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Body Parts.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Prim.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Calling Cards.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Clothes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Eyes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Folder.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gesture.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gestures.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gloves.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Hair.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Inventory.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Jacket.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmark.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmarks.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Lost And Found.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecard.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecards.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Object.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Objects.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Pants.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Photo Album.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Project.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.question.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Script.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Scripts.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shape.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shoes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Skin.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Skirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Snapshot.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Socks.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Solution.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Sound.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Sounds.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Texture.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Textures.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Trash.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Underpants.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Undershirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Unknown.gif +obj\Debug\LSLEditor.Resource.thanks.gif +obj\Debug\LSLEditor.Resource.About.htm +obj\Debug\LSLEditor.Resource.ReleaseNotes.htm +obj\Debug\LSLEditor.About.resources +obj\Debug\LSLEditor.Browser.resources +obj\Debug\LSLEditor.BugReport.BugReportForm.resources +obj\Debug\LSLEditor.NewProject.resources +obj\Debug\LSLEditor.PermissionsForm.resources +obj\Debug\LSLEditor.GotoWindow.resources +obj\Debug\LSLEditor.EditForm.resources +obj\Debug\LSLEditor.TooltipWindow.resources +obj\Debug\LSLEditor.GListBoxWindow.resources +obj\Debug\LSLEditor.RichLabel.resources +obj\Debug\LSLEditor.FindWindow.resources +obj\Debug\LSLEditor.llDialogForm.resources +obj\Debug\LSLEditor.LSLEditorForm.resources +obj\Debug\LSLEditor.Properties.Resources.resources +obj\Debug\NumberedTextBox.NumberedTextBoxUC.resources +obj\Debug\LSLEditor.GroupboxEvent.resources +obj\Debug\LSLEditor.RuntimeConsole.resources +obj\Debug\LSLEditor.SyntaxRichTextBox.resources +obj\Debug\LSLEditor.SimulatorConsole.resources +obj\Debug\LSLEditor.SolutionExplorer.resources +obj\Debug\LSLEditor.SyntaxError.resources +obj\Debug\LSLEditor.Tools.EnvironmentBrowser.resources +obj\Debug\LSLEditor.Tools.ProjectSettings.resources +obj\Debug\LSLEditor.Tools.RuntimeInternal.resources +obj\Debug\LSLEditor.Tools.RuntimeSmtp.resources +obj\Debug\LSLEditor.Tools.RuntimeExternal.resources +obj\Debug\LSLEditor.Tools.EnvironmentGeneral.resources +obj\Debug\LSLEditor.Tools.TextEditorFontColors.resources +obj\Debug\LSLEditor.Tools.EnvironmentHelp.resources +obj\Debug\LSLEditor.Tools.TextEditorGeneral.resources +obj\Debug\LSLEditor.Tools.ToolsOptions.resources +obj\Debug\LSLEditor.Tools.VersionControlGeneral.resources +obj\Debug\LSLEditor.UpdateApplicationForm.resources +obj\Debug\lsleditor-2.15.csproj.GenerateResource.Cache +obj\Debug\LSLEditor.exe +bin\Debug\LSLEditor.exe.config +bin\Debug\LSLEditor.exe +bin\Debug\LSLEditor.pdb +obj\Debug\LSLEditor.pdb diff --git a/obj/lsleditor-beta.csproj.FileList.txt b/obj/lsleditor-beta.csproj.FileList.txt new file mode 100644 index 0000000..7db6964 --- /dev/null +++ b/obj/lsleditor-beta.csproj.FileList.txt @@ -0,0 +1,45 @@ +bin\Debug\LSLEditor.exe.config +bin\Debug\LSLEditor.exe +bin\Debug\LSLEditor.pdb +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\LSLEditor.Resource.ConfLSL.xml +obj\Debug\LSLEditor.Resource.ConfCSharp.xml +obj\Debug\LSLEditor.Resource.inventory.xml +obj\Debug\LSLEditor.Images.Class.gif +obj\Debug\LSLEditor.Images.Constants.gif +obj\Debug\LSLEditor.Images.Enum.gif +obj\Debug\LSLEditor.Images.Events.gif +obj\Debug\LSLEditor.Images.Functions.gif +obj\Debug\LSLEditor.Images.Namespace.gif +obj\Debug\LSLEditor.Images.Properties.gif +obj\Debug\LSLEditor.Images.SealedClass.gif +obj\Debug\LSLEditor.Images.Unknown.gif +obj\Debug\LSLEditor.Images.Close-Active.gif +obj\Debug\LSLEditor.Images.Close-Disabled.gif +obj\Debug\LSLEditor.Images.Close-Inactive.gif +obj\Debug\LSLEditor.Resource.thanks.gif +obj\Debug\LSLEditor.Resource.About.htm +obj\Debug\LSLEditor.Resource.ReleaseNotes.htm +obj\Debug\LSLEditor.About.resources +obj\Debug\LSLEditor.Browser.resources +obj\Debug\LSLEditor.Compiler.resources +obj\Debug\LSLEditor.PermissionsForm.resources +obj\Debug\LSLEditor.GotoForm.resources +obj\Debug\LSLEditor.EditForm.resources +obj\Debug\LSLEditor.EditorProperties.resources +obj\Debug\LSLEditor.TooltipWindow.resources +obj\Debug\LSLEditor.GListBoxWindow.resources +obj\Debug\LSLEditor.RichLabel.resources +obj\Debug\LSLEditor.FindForm.resources +obj\Debug\LSLEditor.llDialogForm.resources +obj\Debug\LSLEditor.LSLEditorForm.resources +obj\Debug\LSLEditor.Properties.Resources.resources +obj\Debug\NumberedTextBox.NumberedTextBoxUC.resources +obj\Debug\LSLEditor.GroupboxEvent.resources +obj\Debug\LSLEditor.SimProperties.resources +obj\Debug\LSLEditor.Simulator.resources +obj\Debug\LSLEditor.SyntaxRichTextBox.resources +obj\Debug\LSLEditor.UploadProject.resources +obj\Debug\lsleditor-beta.csproj.GenerateResource.Cache +obj\Debug\LSLEditor.exe +obj\Debug\LSLEditor.pdb diff --git a/obj/lsleditor.csproj.FileList.txt b/obj/lsleditor.csproj.FileList.txt new file mode 100644 index 0000000..12058c0 --- /dev/null +++ b/obj/lsleditor.csproj.FileList.txt @@ -0,0 +1,107 @@ +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\LSLEditor.Resource.ConfLSL.xml +obj\Debug\LSLEditor.Resource.ConfCSharp.xml +obj\Debug\LSLEditor.Resource.ToolsOptions.xml +obj\Debug\LSLEditor.Images.Class.gif +obj\Debug\LSLEditor.Images.Constants.gif +obj\Debug\LSLEditor.Images.Enum.gif +obj\Debug\LSLEditor.Images.Events.gif +obj\Debug\LSLEditor.Images.Functions.gif +obj\Debug\LSLEditor.Images.Namespace.gif +obj\Debug\LSLEditor.Images.Properties.gif +obj\Debug\LSLEditor.Images.SealedClass.gif +obj\Debug\LSLEditor.Images.Unknown.gif +obj\Debug\LSLEditor.Images.Close-Active.gif +obj\Debug\LSLEditor.Images.Close-Disabled.gif +obj\Debug\LSLEditor.Images.Close-Inactive.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Animation.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Animations.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Body Parts.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Prim.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Calling Cards.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Clothes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Eyes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Folder.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gesture.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gestures.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Gloves.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Hair.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Inventory.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Jacket.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmark.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmarks.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Lost And Found.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecard.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecards.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Object.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Objects.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Pants.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Photo Album.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Project.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.question.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Script.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Scripts.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shape.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Shoes.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Skin.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Skirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Snapshot.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Socks.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Solution.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Sound.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Sounds.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Texture.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Textures.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Trash.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Underpants.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Undershirt.gif +obj\Debug\LSLEditor.ImagesSolutionExplorer.Unknown.gif +obj\Debug\LSLEditor.Resource.thanks.gif +obj\Debug\LSLEditor.Resource.About.htm +obj\Debug\LSLEditor.Resource.ReleaseNotes.htm +obj\Debug\LSLEditor.About.resources +obj\Debug\LSLEditor.Browser.resources +obj\Debug\LSLEditor.BugReport.BugReportForm.resources +obj\Debug\LSLEditor.NewProject.resources +obj\Debug\LSLEditor.PermissionsForm.resources +obj\Debug\LSLEditor.GotoWindow.resources +obj\Debug\LSLEditor.EditForm.resources +obj\Debug\LSLEditor.TooltipWindow.resources +obj\Debug\LSLEditor.GListBoxWindow.resources +obj\Debug\LSLEditor.RichLabel.resources +obj\Debug\LSLEditor.FindWindow.resources +obj\Debug\LSLEditor.llDialogForm.resources +obj\Debug\LSLEditor.LSLEditorForm.resources +obj\Debug\LSLEditor.Properties.Resources.resources +obj\Debug\NumberedTextBox.NumberedTextBoxUC.resources +obj\Debug\LSLEditor.GroupboxEvent.resources +obj\Debug\LSLEditor.RuntimeConsole.resources +obj\Debug\LSLEditor.SyntaxRichTextBox.resources +obj\Debug\LSLEditor.SimulatorConsole.resources +obj\Debug\LSLEditor.SyntaxError.resources +obj\Debug\LSLEditor.Tools.RuntimeInternal.resources +obj\Debug\LSLEditor.Tools.RuntimeSmtp.resources +obj\Debug\LSLEditor.Tools.RuntimeExternal.resources +obj\Debug\LSLEditor.Tools.EnvironmentGeneral.resources +obj\Debug\LSLEditor.Tools.TextEditorFontColors.resources +obj\Debug\LSLEditor.Tools.EnvironmentHelp.resources +obj\Debug\LSLEditor.Tools.TextEditorGeneral.resources +obj\Debug\LSLEditor.Tools.ToolsOptions.resources +obj\Debug\LSLEditor.UpdateApplicationForm.resources +obj\Debug\lsleditor.csproj.GenerateResource.Cache +bin\Debug\LSLEditor.exe.config +bin\Debug\LSLEditor.exe +obj\Debug\LSLEditor.exe +obj\Debug\LSLEditor.Tools.EnvironmentBrowser.resources +obj\Debug\LSLEditor.Tools.VersionControlGeneral.resources +obj\Debug\LSLEditor.Tools.ProjectSettings.resources +obj\Debug\LSLEditor.Tools.TextEditorCodeCompletion.resources +obj\Debug\LSLEditor.Images.Vars.gif +obj\Debug\LSLEditor.Tools.RuntimeGeneral.resources +bin\Debug\LSLEditor.pdb +obj\Debug\LSLEditor.pdb +obj\Debug\LSLEditor.Tools.EnvironmentPlugins.resources +obj\Debug\LSLEditor.Solution.SolutionExplorer.resources +obj\Debug\LSLEditor.Solution.GuidProperty.resources +obj\Debug\LSLEditor.Solution.SvnAguments.resources diff --git a/obj/lsleditor.csproj.FileListAbsolute.txt b/obj/lsleditor.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..14235d9 --- /dev/null +++ b/obj/lsleditor.csproj.FileListAbsolute.txt @@ -0,0 +1,110 @@ +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\bin\Debug\LSLEditor.exe.config +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.exe +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.pdb +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\bin\Debug\LSLEditor.exe +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\bin\Debug\LSLEditor.pdb +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\ResolveAssemblyReference.cache +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.ConfLSL.xml +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.ConfCSharp.xml +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.ToolsOptions.xml +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Class.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Constants.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Enum.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Events.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Functions.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Namespace.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Properties.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.SealedClass.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Unknown.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Close-Active.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Close-Disabled.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Close-Inactive.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Animation.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Animations.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Body Parts.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Prim.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Calling Cards.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Clothes.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Eyes.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Folder.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Gesture.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Gestures.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Gloves.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Hair.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Inventory.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Jacket.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmark.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Landmarks.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Lost And Found.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecard.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Notecards.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Object.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Objects.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Pants.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Photo Album.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Project.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.question.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Script.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Scripts.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Shape.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Shirt.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Shoes.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Skin.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Skirt.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Snapshot.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Socks.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Solution.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Sound.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Sounds.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Texture.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Textures.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Trash.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Underpants.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Undershirt.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.ImagesSolutionExplorer.Unknown.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Images.Vars.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.thanks.gif +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.About.htm +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Resource.ReleaseNotes.htm +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.About.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Browser.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.BugReport.BugReportForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Solution.GuidProperty.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.NewProject.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.PermissionsForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.GotoWindow.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.EditForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.TooltipWindow.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.GListBoxWindow.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.RichLabel.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.FindWindow.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.llDialogForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.LSLEditorForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Properties.Resources.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\NumberedTextBox.NumberedTextBoxUC.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.GroupboxEvent.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.RuntimeConsole.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.SyntaxRichTextBox.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.SimulatorConsole.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Solution.SolutionExplorer.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Solution.SvnAguments.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.SyntaxError.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.EnvironmentPlugins.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.RuntimeGeneral.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.TextEditorCodeCompletion.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.EnvironmentBrowser.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.ProjectSettings.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.RuntimeInternal.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.RuntimeSmtp.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.RuntimeExternal.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.EnvironmentGeneral.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.TextEditorFontColors.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.EnvironmentHelp.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.TextEditorGeneral.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.ToolsOptions.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.Tools.VersionControlGeneral.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\LSLEditor.UpdateApplicationForm.resources +C:\Documents and Settings\Alphons\Mijn documenten\Visual Studio 2005\Projects\LSLEditor\obj\Debug\lsleditor.csproj.GenerateResource.Cache +C:\libs\LSLEditor\bin\Debug\LSLEditor.exe.config +C:\libs\LSLEditor\obj\Debug\LSLEditor.exe +C:\libs\LSLEditor\obj\Debug\LSLEditor.pdb diff --git a/sharedheader.txt b/sharedheader.txt new file mode 100644 index 0000000..991fade --- /dev/null +++ b/sharedheader.txt @@ -0,0 +1,43 @@ +/** +******** +* +* ORIGIONAL CODE BASE IS Copyright (C) 2006-2010 by Alphons van der Heijden +* The code was donated on 4/28/2010 by Alphons van der Heijden +* To Brandon'Dimentox Travanti' Husbands & Malcolm J. Kudra which in turn Liscense under the GPLv2. +* In agreement to Alphons van der Heijden wishes. +* +* The community would like to thank Alphons for all of his hard work, blood sweat and tears. +* Without his work the community would be stuck with crappy editors. +* +* The source code in this file ("Source Code") is provided by The LSLEditor Group +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in the gplv2.txt document. +* +******** +* GPLv2 Header +******** +* LSLEditor, a External editor for the LSL Language. +* Copyright (C) 2010 The LSLEditor Group. + +* 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 +* of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +******** +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +******** +*/