Skip to content

Commit

Permalink
Lots of changes in String type
Browse files Browse the repository at this point in the history
  • Loading branch information
mugli committed Oct 21, 2010
1 parent 94e9248 commit fe56da0
Show file tree
Hide file tree
Showing 58 changed files with 11,130 additions and 10,631 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.dcu
*.gif
*.2007
*.tvsconfig
*.jpg
*.bmp
*.psd
Expand Down
146 changes: 69 additions & 77 deletions Keyboard and Spell checker/Avro_Keyboard.dpr
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
{
=============================================================================
*****************************************************************************
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
=============================================================================
*****************************************************************************
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is Avro Keyboard 5.
The Original Code is Avro Keyboard 5.
The Initial Developer of the Original Code is
Mehdi Hasan Khan <[email protected]>.
The Initial Developer of the Original Code is
Mehdi Hasan Khan <[email protected]>.
Copyright (C) OmicronLab <http://www.omicronlab.com>. All Rights Reserved.
Copyright (C) OmicronLab <http://www.omicronlab.com>. All Rights Reserved.
Contributor(s): ______________________________________.
Contributor(s): ______________________________________.
*****************************************************************************
=============================================================================
*****************************************************************************
=============================================================================
}

Program Avro_Keyboard;

uses
Forms,
Windows,
uForm1 in 'Forms\uForm1.pas' {AvroMainForm1},
uForm1 in 'Forms\uForm1.pas' { AvroMainForm1 },
BanglaChars in 'Units\BanglaChars.pas',
nativexml in 'Units\nativexml.pas',
uTopBar in 'Forms\uTopBar.pas' {TopBar},
uTopBar in 'Forms\uTopBar.pas' { TopBar },
SkinLoader in 'Units\SkinLoader.pas',
cUtils in 'Units\cUtils.pas',
cArrays in 'Units\cArrays.pas',
cDictionaries in 'Units\cDictionaries.pas',
cStrings in 'Units\cStrings.pas',
cTypes in 'Units\cTypes.pas',
KeyboardLayoutLoader in 'Units\KeyboardLayoutLoader.pas',
clsEnglishToBangla in 'Classes\clsEnglishToBangla.pas',
clsE2BCharBased in 'Classes\clsE2BCharBased.pas',
Expand All @@ -56,22 +51,21 @@ uses
uFileFolderHandling in 'Units\uFileFolderHandling.pas',
u_VirtualFontInstall in 'Units\u_VirtualFontInstall.pas',
u_Admin in 'Units\u_Admin.pas',
uComplexLNotify in 'Forms\uComplexLNotify.pas' {ComplexLNotify},
ufrmAbout in 'Forms\ufrmAbout.pas' {frmAbout},
ufrmAboutSkinLayout in 'Forms\ufrmAboutSkinLayout.pas' {frmAboutSkinLayout},
ufrmAutoCorrect in 'Forms\ufrmAutoCorrect.pas' {frmAutoCorrect},
ufrmAvroMouse in 'Forms\ufrmAvroMouse.pas' {frmAvroMouse},
ufrmOptions in 'Forms\ufrmOptions.pas' {frmOptions},
ufrmPrevW in 'Forms\ufrmPrevW.pas' {frmPrevW},
ufrmUpdateNotify in 'Forms\ufrmUpdateNotify.pas' {frmUpdateNotify},
uLayoutViewer in 'Forms\uLayoutViewer.pas' {LayoutViewer},
uComplexLNotify in 'Forms\uComplexLNotify.pas' { ComplexLNotify },
ufrmAbout in 'Forms\ufrmAbout.pas' { frmAbout },
ufrmAboutSkinLayout in 'Forms\ufrmAboutSkinLayout.pas' { frmAboutSkinLayout },
ufrmAutoCorrect in 'Forms\ufrmAutoCorrect.pas' { frmAutoCorrect },
ufrmAvroMouse in 'Forms\ufrmAvroMouse.pas' { frmAvroMouse },
ufrmOptions in 'Forms\ufrmOptions.pas' { frmOptions },
ufrmPrevW in 'Forms\ufrmPrevW.pas' { frmPrevW },
ufrmUpdateNotify in 'Forms\ufrmUpdateNotify.pas' { frmUpdateNotify },
uLayoutViewer in 'Forms\uLayoutViewer.pas' { LayoutViewer },
uProcessHandler in 'Units\uProcessHandler.pas',
uWindowHandlers in 'Units\uWindowHandlers.pas',
clsUpdateInfoDownloader in 'Classes\clsUpdateInfoDownloader.pas',
clsFileVersion in 'Classes\clsFileVersion.pas',
WindowsVersion in 'Units\WindowsVersion.pas',
uLocale in 'Units\uLocale.pas',
uMyLib in 'Units\uMyLib.pas',
Phonetic_RegExp_Constants in 'Units\Phonetic_RegExp_Constants.pas',
PCRE in 'Units\PCRE.pas',
pcre_dll in 'Units\pcre_dll.pas',
Expand All @@ -85,74 +79,72 @@ uses
clsSkinLayoutConverter in 'Classes\clsSkinLayoutConverter.pas',
uCmdLineHelper in 'Units\uCmdLineHelper.pas',
uCommandLineFunctions in 'Units\uCommandLineFunctions.pas',
ufrmConflict in 'Forms\ufrmConflict.pas' {frmConflict},
uFrmSplash in 'Forms\uFrmSplash.pas' {frmSplash},
ufrmConflict in 'Forms\ufrmConflict.pas' { frmConflict },
uFrmSplash in 'Forms\uFrmSplash.pas' { frmSplash },
clsAbbreviation in 'Classes\clsAbbreviation.pas',
clsUnicodeToBijoy2000 in '..\Unicode to ascii converter\clsUnicodeToBijoy2000.pas',
ufrmEncodingWarning in 'Forms\ufrmEncodingWarning.pas' {frmEncodingWarning};
ufrmEncodingWarning in 'Forms\ufrmEncodingWarning.pas' { frmEncodingWarning };

Var
Mutex : THandle;
Mutex: THandle;

{$R *.res}
{$R docico.res}
{$R *.res}
{$R docico.res}

Begin
{ Disable FPU exceptions. No need to restore, setting is process specific. }
Set8087CW($133F);
{ Disable FPU exceptions. No need to restore, setting is process specific. }
Set8087CW($133F);


///////////////////////////////////////////////////////////////////////////////
//Check parameters
If uCommandLineFunctions.HandleAllCommandLine Then Begin
Application.Terminate;
exit;
End;
/// ////////////////////////////////////////////////////////////////////////////
// Check parameters
If uCommandLineFunctions.HandleAllCommandLine Then Begin
Application.Terminate;
exit;
End;


//////////////////////////////////////////////////////////////////////////////
{ DONE : check for previous instance }
Mutex := CreateMutex(Nil, True, 'Avro_Keyboard');
If (Mutex = 0) Or (GetLastError <> 0) Then Begin
/// ///////////////////////////////////////////////////////////////////////////
{ DONE : check for previous instance }
Mutex := CreateMutex(Nil, True, 'Avro_Keyboard');
If (Mutex = 0) Or (GetLastError <> 0) Then Begin

uCommandLineFunctions.SendCommand('restore');
uCommandLineFunctions.SendCommand('restore');

Application.MessageBox('Avro Keyboard is already running on this system and'
+ #10 + 'running more than one instance is not allowed.',
'Avro Keyboard', MB_OK + MB_ICONEXCLAMATION + MB_DEFBUTTON1 + MB_APPLMODAL);
Application.MessageBox('Avro Keyboard is already running on this system and' + #10 + 'running more than one instance is not allowed.', 'Avro Keyboard',
MB_OK + MB_ICONEXCLAMATION + MB_DEFBUTTON1 + MB_APPLMODAL);

Application.Terminate;
exit;
End;
////////////////////////////////////////////////////////////////
Application.Terminate;
exit;
End;
/// /////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////////
// Load Avro
Application.Initialize;
/// ///////////////////////////////////////////////////////////////////////////
// Load Avro
Application.Initialize;

//Hide Application from taskbar
Application.Title := '';
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE) Or WS_EX_TOOLWINDOW);
Application.MainFormOnTaskBar := False;
// Hide Application from taskbar
Application.Title := '';
SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) Or WS_EX_TOOLWINDOW);
Application.MainFormOnTaskBar := False;


//First item is applications main form
Application.CreateForm(TAvroMainForm1, AvroMainForm1);
//Hide Application from taskbar
ShowWindow(application.handle, SW_HIDE);
// First item is applications main form
Application.CreateForm(TAvroMainForm1, AvroMainForm1);
// Hide Application from taskbar
ShowWindow(Application.Handle, SW_HIDE);





Application.Run;
////////////////////////////////////////////////////////
Application.Run;
/// /////////////////////////////////////////////////////


If Mutex <> 0 Then
CloseHandle(Mutex);
End.
If Mutex <> 0 Then
CloseHandle(Mutex);

End.
83 changes: 41 additions & 42 deletions Keyboard and Spell checker/Classes/clsAbbreviation.pas
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@
Uses
classes,
sysutils,
StrUtils,
WideStrUtils;
StrUtils;

Type
TAbbreviation = Class
Private

Public
Function CheckConvert(EnglishT: AnsiString): WideString;
Function CheckConvert(EnglishT: String): String;
End;


Expand All @@ -55,9 +54,9 @@

{===============================================================================}

Function TAbbreviation.CheckConvert(EnglishT: AnsiString): WideString;
Function TAbbreviation.CheckConvert(EnglishT: String): String;
Var
T : WideString;
T : String;
Begin
EnglishT := Trim(EnglishT);

Expand All @@ -73,43 +72,43 @@
End;

T := EnglishT;
T := WideReplaceStr(T, 'A', b_E);
T := WideReplaceStr(T, 'B', b_B + b_Ikar);
T := WideReplaceStr(T, 'C', b_S + b_Ikar);
T := WideReplaceStr(T, 'D', b_Dd + b_Ikar);
T := WideReplaceStr(T, 'E', b_I);
T := WideReplaceStr(T, 'F', b_E + b_Ph);
T := WideReplaceStr(T, 'G', b_J + b_Ikar);
T := WideReplaceStr(T, 'H', b_E + b_I + b_C);
T := WideReplaceStr(T, 'I', b_AA + b_I);
T := WideReplaceStr(T, 'J', b_J + b_EKar);
T := WideReplaceStr(T, 'K', b_K + b_EKar);
T := WideReplaceStr(T, 'L', b_E + b_L);
T := WideReplaceStr(T, 'M', b_E + b_m);
T := WideReplaceStr(T, 'N', b_E + b_n);
T := WideReplaceStr(T, 'O', b_O);
T := WideReplaceStr(T, 'P', b_p + b_Ikar);
T := WideReplaceStr(T, 'Q', b_k + b_Ikar + b_U);
T := WideReplaceStr(T, 'R', b_AA + b_R);
T := WideReplaceStr(T, 'S', b_E + b_S);
T := WideReplaceStr(T, 'T', b_Tt + b_Ikar);
T := WideReplaceStr(T, 'U', b_I + b_U);
T := WideReplaceStr(T, 'V', b_Bh + b_Ikar);
T := WideReplaceStr(T, 'W', b_Dd + b_b + b_Hasanta + b_L + b_Ikar + b_U);
T := WideReplaceStr(T, 'X', b_E+b_k+b_Hasanta+b_S);
T := WideReplaceStr(T, 'Y', b_O+b_Y+b_AAkar+b_I);
T := WideReplaceStr(T, 'Z', b_J + b_EKar+b_Dd);

T := WideReplaceStr(T, '0', b_0);
T := WideReplaceStr(T, '1', b_1);
T := WideReplaceStr(T, '2', b_2);
T := WideReplaceStr(T, '3', b_3);
T := WideReplaceStr(T, '4', b_4);
T := WideReplaceStr(T, '5', b_5);
T := WideReplaceStr(T, '6', b_6);
T := WideReplaceStr(T, '7', b_7);
T := WideReplaceStr(T, '8', b_8);
T := WideReplaceStr(T, '9', b_9);
T := ReplaceStr(T, 'A', b_E);
T := ReplaceStr(T, 'B', b_B + b_Ikar);
T := ReplaceStr(T, 'C', b_S + b_Ikar);
T := ReplaceStr(T, 'D', b_Dd + b_Ikar);
T := ReplaceStr(T, 'E', b_I);
T := ReplaceStr(T, 'F', b_E + b_Ph);
T := ReplaceStr(T, 'G', b_J + b_Ikar);
T := ReplaceStr(T, 'H', b_E + b_I + b_C);
T := ReplaceStr(T, 'I', b_AA + b_I);
T := ReplaceStr(T, 'J', b_J + b_EKar);
T := ReplaceStr(T, 'K', b_K + b_EKar);
T := ReplaceStr(T, 'L', b_E + b_L);
T := ReplaceStr(T, 'M', b_E + b_m);
T := ReplaceStr(T, 'N', b_E + b_n);
T := ReplaceStr(T, 'O', b_O);
T := ReplaceStr(T, 'P', b_p + b_Ikar);
T := ReplaceStr(T, 'Q', b_k + b_Ikar + b_U);
T := ReplaceStr(T, 'R', b_AA + b_R);
T := ReplaceStr(T, 'S', b_E + b_S);
T := ReplaceStr(T, 'T', b_Tt + b_Ikar);
T := ReplaceStr(T, 'U', b_I + b_U);
T := ReplaceStr(T, 'V', b_Bh + b_Ikar);
T := ReplaceStr(T, 'W', b_Dd + b_b + b_Hasanta + b_L + b_Ikar + b_U);
T := ReplaceStr(T, 'X', b_E+b_k+b_Hasanta+b_S);
T := ReplaceStr(T, 'Y', b_O+b_Y+b_AAkar+b_I);
T := ReplaceStr(T, 'Z', b_J + b_EKar+b_Dd);

T := ReplaceStr(T, '0', b_0);
T := ReplaceStr(T, '1', b_1);
T := ReplaceStr(T, '2', b_2);
T := ReplaceStr(T, '3', b_3);
T := ReplaceStr(T, '4', b_4);
T := ReplaceStr(T, '5', b_5);
T := ReplaceStr(T, '6', b_6);
T := ReplaceStr(T, '7', b_7);
T := ReplaceStr(T, '8', b_8);
T := ReplaceStr(T, '9', b_9);

Result := T;

Expand Down
8 changes: 4 additions & 4 deletions Keyboard and Spell checker/Classes/clsAvroPhonetic.pas
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
Constructor Create; //Initializer
Destructor Destroy; Override; //Destructor

Function ProcessVKeyDown(Const KeyCode: Integer; Var Block: Boolean): WideString;
Function ProcessVKeyDown(Const KeyCode: Integer; Var Block: Boolean): String;
Procedure ProcessVKeyUP(Const KeyCode: Integer; Var Block: Boolean);
Procedure ResetDeadKey;
Procedure SelectCandidate(Const Item: WideString); //For Avro Phonetic
Procedure SelectCandidate(Const Item: String); //For Avro Phonetic
//Published
Property AutoCorrectEnabled: Boolean
Read GetAutoCorrectEnabled Write SetAutoCorrectEnabled;
Expand Down Expand Up @@ -90,7 +90,7 @@
{===============================================================================}

Function TAvroPhonetic.ProcessVKeyDown(Const KeyCode: Integer;
Var Block: Boolean): WideString;
Var Block: Boolean): String;
Begin
Result := CharBased.ProcessVKeyDown(Keycode, Block);
End;
Expand All @@ -112,7 +112,7 @@

{===============================================================================}

Procedure TAvroPhonetic.SelectCandidate(Const Item: WideString);
Procedure TAvroPhonetic.SelectCandidate(Const Item: String);
Begin
CharBased.SelectCandidate(Item);
End;
Expand Down
Loading

0 comments on commit fe56da0

Please sign in to comment.