|
//
// ___ _____ ___ ___ __ __
// / __|_ _/ _ \| _ \ \/ |
// \__ \ | || (_) | / |\/| |
// |___/ |_| \___/|_|_\_| |_|
//
// Storm.TextEditor.dll
// ��������������������
// Storm.TabControl.dll was created under the LGPL
// license. Some of the code was created from scratch,
// some was not. Code not created from scratch was
// based on the DotNetFireball framework and evolved
// from that.
//
// What I mostly did in this library was that I
// cleaned up the code, structured it, documentated
// it and added new features.
//
// Although it might not sound like it, it was very
// hard and took a long (pretty much a shitload)
// time. Why? Well, this was* some of the crappiest,
// most unstructured, undocumentated, ugly code I've
// ever seen. It would actually have taken me less
// time to create it from scratch, but I figured that
// out too late. Figuring out what the code actually
// did and then documentating it was (mostly) a
// day-long process. Well, I hope you enjoy some of
// my hard work. /rant
//
// Of course some/most of it is made from scratch by me.
// *Yes, was. It isn't now. :) Some of the naming
// conventions might still seem a little bit off though.
//
// What is Storm?
// ��������������
// Storm is a set of dynamic link libraries used in
// Theodor "Vestras" Storm Kristensen's application
// "Moonlite".
//
//
// Thanks:
// �������
// - The DotNetFireball team for creating and publishing
// DotNetFireball which I based some of my code on.
//
//
// Copyright (c) Theodor "Vestras" Storm Kristensen 2009
// �����������������������������������������������������
//
namespace Storm.TextEditor.Win32
{
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using Storm.TextEditor;
using Storm.TextEditor.Controls;
using Storm.TextEditor.Controls.Core;
using Storm.TextEditor.Controls.Core.Globalization;
using Storm.TextEditor.Controls.Core.Timers;
using Storm.TextEditor.Controls.IntelliMouse;
using Storm.TextEditor.Document;
using Storm.TextEditor.Document.Exporters;
using Storm.TextEditor.Forms;
using Storm.TextEditor.Interacting;
using Storm.TextEditor.Painting;
using Storm.TextEditor.Parsing;
using Storm.TextEditor.Parsing.Base;
using Storm.TextEditor.Parsing.Classes;
using Storm.TextEditor.Parsing.Language;
using Storm.TextEditor.Preset;
using Storm.TextEditor.Preset.Painting;
using Storm.TextEditor.Preset.TextDraw;
using Storm.TextEditor.Printing;
using Storm.TextEditor.Utilities;
using Storm.TextEditor.Win32;
#region Basic
[StructLayout(LayoutKind.Sequential)]
public struct LOGBRUSH
{
#region Members
public uint lbStyle;
public uint lbColor;
public uint lbHatch;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct PAINTSTRUCT
{
#region Members
public int fErase;
public int fRestore;
public int fIncUpdate;
public int Reserved1;
public int Reserved2;
public int Reserved3;
public int Reserved4;
public int Reserved5;
public int Reserved6;
public int Reserved7;
public int Reserved8;
public IntPtr hdc;
public Rectangle rcPaint;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct POINTAPI
{
#region Members
public int X;
public int Y;
#endregion
/// <summary>
/// Initializes the POINTAPI.
/// </summary>
public POINTAPI(int x, int y)
{
X = x;
Y = y;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RECTAPI
{
#region Members
public int Left;
public int Top;
public int Right;
public int Bottom;
#endregion
#region Properties
public int Width
{ get { return Right - Left; } }
public int Height
{ get { return Bottom - Top; } }
#endregion
/// <summary>
/// Initializes the RECTAPI.
/// </summary>
public RECTAPI(int left, int top, int right, int bottom)
{
Left = left;
Top = top;
Right = right;
Bottom = bottom;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct SIZE
{
#region Members
public int cx;
public int cy;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct TRACKMOUSEEVENTS
{
#region Members
public uint cbSize;
public uint dwFlags;
public uint dwHoverTime;
public IntPtr hWnd;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct MSG
{
#region Members
public int message;
public int time;
public int pt_x;
public int pt_y;
public IntPtr hwnd;
public IntPtr wParam;
public IntPtr lParam;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
#region Members
public int x;
public int y;
public int cx;
public int cy;
public uint flags;
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
#endregion
}
#endregion
#region _NCCALCSIZE_PARAMS
[StructLayout(LayoutKind.Sequential)]
public struct _NCCALCSIZE_PARAMS
{
#region Members
public RECTAPI NewRect;
public RECTAPI OldRect;
public RECTAPI OldClientRect;
public WINDOWPOS lppos;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct MyStruct
{
#region Members
public int SomeValue;
public byte b1;
public byte b2;
public byte b3;
public byte b4;
public byte b5;
public byte b6;
public byte b7;
public byte b8;
#endregion
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct BLENDFUNCTION
{
#region Members
public byte BlendOp;
public byte BlendFlags;
public byte SourceConstantAlpha;
public byte AlphaFormat;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public struct GDITextMetric
{
#region Members
public int tmMemoryHeight;
public int tmAscent;
public int tmDescent;
public int tmInternalLeading;
public int tmExternalLeading;
public int tmAveCharWidth;
public int tmMaxCharWidth;
public int tmWeight;
public int tmOverhang;
public int tmDigitizedAspectX;
public int tmDigitizedAspectY;
public byte tmFirstChar;
public byte tmLastChar;
public byte tmDefaultChar;
public byte tmBreakChar;
public byte tmItalic;
public byte tmUnderlined;
public byte tmStruckOut;
public byte tmPitchAndFamily;
public byte tmCharSet;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public class LogFont
{
#region Members
public int lfHeight = 0;
public int lfWidth = 0;
public int lfEscapement = 0;
public int lfOrientation = 0;
public int lfWeight = 0;
public byte lfItalic = 0;
public byte lfUnderline = 0;
public byte lfStrikeOut = 0;
public byte lfCharSet = 0;
public byte lfOutPrecision = 0;
public byte lfClipPrecision = 0;
public byte lfQuality = 0;
public byte lfPitchAndFamily = 0;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string lfFaceName = "";
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public class ENUMLOGFONTEX
{
#region Members
public LogFont elfLogFont = null;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string elfFullName = "";
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] elfStyle = null;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] elfScript = null;
#endregion
}
[StructLayout(LayoutKind.Sequential)]
public class COMPOSITIONFORM
{
#region Members
public int dwStyle = 0;
public POINTAPI ptCurrentPos = new POINTAPI();
public RECTAPI rcArea = new RECTAPI();
#endregion
}
#endregion
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.