MG: broke LCL<->interface circles

git-svn-id: trunk@3566 -
This commit is contained in:
lazarus 2002-10-26 15:15:50 +00:00
parent 8efa0178f7
commit 88a2927d1c
13 changed files with 68 additions and 1215 deletions

1
.gitattributes vendored
View File

@ -556,7 +556,6 @@ lcl/extendedstrings.pas svneol=native#text/pascal
lcl/filectrl.pp svneol=native#text/pascal
lcl/forms.pp svneol=native#text/pascal
lcl/graphics.pp svneol=native#text/pascal
lcl/graphicsmath.pp svneol=native#text/pascal
lcl/graphmath.pp svneol=native#text/pascal
lcl/graphtype.pp svneol=native#text/pascal
lcl/grids.pas svneol=native#text/pascal

View File

@ -45,6 +45,7 @@ uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Interfaces,
Forms,
Splash,
Main,
@ -87,6 +88,9 @@ end.
{
$Log$
Revision 1.39 2002/10/26 15:15:42 lazarus
MG: broke LCL<->interface circles
Revision 1.38 2002/10/10 20:34:32 lazarus
MG: fixed freeing Glyph in TBitBtn.SetKind

View File

@ -999,8 +999,13 @@ begin
Add('');
Add('uses');
case fProjectType of
ptProgram, ptCustomProgram: Add(' Classes;');
ptApplication: Add(' Forms;');
ptProgram, ptCustomProgram:
Add(' Classes;');
ptApplication:
begin
Add(' Interfaces,');
Add(' Forms;');
end;
else
Add(' { add your units here };');
end;
@ -2075,6 +2080,9 @@ end.
{
$Log$
Revision 1.84 2002/10/26 15:15:43 lazarus
MG: broke LCL<->interface circles
Revision 1.83 2002/10/13 09:35:37 lazarus
MG: added publish project

View File

@ -12,11 +12,10 @@ dirs=interfaces
units=allunits
implicitunits=arrow actnlist buttons calendar clipbrd clistbox comctrls \
commctrl controls dialogs dynhasharray extctrls extendedstrings \
filectrl forms graphics graphicsmath graphtype imglist interfacebase \
filectrl forms graphics graphmath graphtype imglist interfacebase \
lazqueue lclmemmanager lcllinux lclstrconsts lcltype lmessages \
lresources menus messages registry spin stdctrls stringhashlist \
toolwin utrace vclglobals
# !!! do not add interfaces. interfaces.ppu belongs to the interface(s).
# and do not add allunits. It is just a dummy unit used for compiling.
rsts=dialogs

View File

@ -59,9 +59,6 @@ type
implementation
uses
Interfaces;
const
cIdNoTimer = -1; { timer ID for an invalid timer }
SNoTimers = 'No timers available';
@ -127,7 +124,7 @@ procedure TCustomTimer.KillTimer;
begin
Assert(False, 'Trace:In TCustomTimer.KillTimer');
if FTimerHandle <> cIdNoTimer then begin
InterfaceObject.KillTimer (integer(Self), 1);
LCLLinux.KillTimer (integer(Self), 1);
FTimerHandle := cIdNoTimer;
end;
end;
@ -143,7 +140,7 @@ procedure TCustomTimer.UpdateTimer;
begin
KillTimer;
if (FEnabled) and (FInterval > 0) and Assigned (FOnTimer) then
FTimerHandle := InterfaceObject.SetTimer(Integer(Self), 1,
FTimerHandle := LCLLinux.SetTimer(Integer(Self), 1,
FInterval, @TimerCBProc);
if FTimerHandle=0 then begin
FTimerHandle:=cIdNoTimer;

View File

@ -37,8 +37,9 @@ interface
uses
Classes, Controls, VCLGlobals, SysUtils, LCLLinux, LCLType, LCLProc,
GraphType, Graphics, Menus, LMessages, CustomTimer, ActnList;
Classes, Controls, VCLGlobals, SysUtils, LCLType, LCLProc, LCLLinux,
InterfaceBase, GraphType, Graphics, Menus, LMessages, CustomTimer, ActnList,
ClipBrd;
type
// form position policies:
@ -521,15 +522,16 @@ type
var
MessageBoxFunction: TMessageBoxFunction;
procedure FreeInterfaceObject;
implementation
uses
LResources, Math;
uses
Interfaces, LResources, Math;
const
FocusMessages : Boolean = true;
FocusCount: Integer = 0;
var
FocusMessages: Boolean;
FocusCount: Integer;
//------------------------------------------------------------------------------
procedure ExceptionOccurred(Sender : TObject; Addr,Frame : Pointer);
@ -722,6 +724,15 @@ begin
TForm(AComponent.Owner).Designer.Modified;
end;
procedure FreeInterfaceObject;
begin
Application.Free;
Application:=nil;
FreeAllClipBoards;
InterfaceObject.Free;
InterfaceObject:=nil;
end;
//==============================================================================
@ -735,15 +746,14 @@ end;
initialization
FocusCount := 0;
Focusmessages := True;
LCLProc.OwnerFormDesignerModifiedProc:=@IfOwnerIsFormThenDesignerModified;
Screen:= TScreen.Create(nil);
Application:= TApplication.Create(nil);
LCLProc.SendApplicationMessageFunction:=@SendApplicationMsg;
LCLProc.OwnerFormDesignerModifiedProc:=@IfOwnerIsFormThenDesignerModified;
Focusmessages := True;
finalization
writeln('forms.pp - finalization section');
LCLProc.SendApplicationMessageFunction:=nil;
LCLProc.OwnerFormDesignerModifiedProc:=nil;
Application.Free;
Application:= nil;

File diff suppressed because it is too large Load Diff

View File

@ -64,7 +64,7 @@ end;
procedure TMenu.CreateHandle;
var i: integer;
begin
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil); // CreateComponent(nil);
SendMsgToInterface(LM_CREATE, Self, nil); // CreateComponent(nil);
// initiate creation of subitems
// Note: FItems is a MenuItem, by using Createhandle all subitems will be
// created.
@ -170,6 +170,9 @@ end;
{ =============================================================================
$Log$
Revision 1.15 2002/10/26 15:15:48 lazarus
MG: broke LCL<->interface circles
Revision 1.14 2002/10/24 09:37:39 lazarus
MG: broke menus.pp <-> controls.pp circle

View File

@ -71,7 +71,7 @@ procedure TMenuItem.CreateHandle;
var i: Integer;
begin
//writeln('TMenuItem.CreateHandle START ',Name,':',ClassName);
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil);
SendMsgToInterface(LM_CREATE, Self, nil);
if FItems<>nil then begin
for i := 0 to Count - 1 do begin
Items[i].HandleNeeded;
@ -81,7 +81,7 @@ begin
begin
Parent.HandleNeeded;
if Parent.HandleAllocated then
InterfaceObject.IntSendMessage3(LM_ATTACHMENU, Self, nil);
SendMsgToInterface(LM_ATTACHMENU, Self, nil);
if HandleAllocated then begin
if ShortCut <> 0 then ShortCutChanged(0, Shortcut);
end;
@ -407,7 +407,7 @@ begin
dec(i);
end;
end;
InterfaceObject.IntSendMessage3(LM_DESTROY, Self, nil);
SendMsgToInterface(LM_DESTROY, Self, nil);
FHandle:=0;
end;
@ -559,7 +559,7 @@ begin
if FCaption = AValue then exit;
FCaption := AValue;
if HandleAllocated then
InterfaceObject.IntSendMessage3(LM_SetLabel, Self, PChar(AValue));
SendMsgToInterface(LM_SetLabel, Self, PChar(AValue));
end;
{------------------------------------------------------------------------------
@ -844,7 +844,7 @@ begin
end else begin
ShortCutToKey(Value, Msg.NewKey, Msg.NewModifier);
end;
InterfaceObject.IntSendMessage3(LM_SETSHORTCUT, Self, @Msg);
SendMsgToInterface(LM_SETSHORTCUT, Self, @Msg);
end;
{------------------------------------------------------------------------------
@ -917,6 +917,9 @@ end;
{ =============================================================================
$Log$
Revision 1.29 2002/10/26 15:15:48 lazarus
MG: broke LCL<->interface circles
Revision 1.28 2002/10/22 18:54:56 lazarus
MG: fixed menu streaming
@ -1029,6 +1032,9 @@ end;
$Log$
Revision 1.29 2002/10/26 15:15:48 lazarus
MG: broke LCL<->interface circles
Revision 1.28 2002/10/22 18:54:56 lazarus
MG: fixed menu streaming

View File

@ -30,29 +30,15 @@ interface
uses
InterfaceBase;
var
InterfaceObject : TInterfaceBase;
implementation
uses
GnomeInt, Clipbrd, SysUtils,
Forms; // MG: GnomeInt uses forms, so the application object is destroyed
// in the forms finalization section AFTER this finalization
// section. But the lcl objects need the gtk to close cleanly.
// Therefore the application object is freed here before the
// InterfaceObject.
// Probably this is the case for all interfaces, so this should be
// moved to forms.pp.
GnomeInt, Forms;
initialization
InterfaceObject := TGnomeObject.Create;
finalization
Application.Free;
Application:=nil;
FreeAllClipBoards;
InterfaceObject.Free;
InterfaceObject:=nil;
FreeInterfaceObject;
end.

View File

@ -41,7 +41,7 @@ unit LCLLinux;
interface
uses Classes, SysUtils, LCLType, VCLGlobals, GraphType;
uses Classes, SysUtils, LCLType, LCLProc, VCLGlobals, GraphType, InterfaceBase;
{$ifdef Trace}
{$ASSERTIONS ON}
@ -61,7 +61,7 @@ function PredefinedClipboardFormat(
implementation
uses
Interfaces, Strings, Math;
Strings, Math;
var
FPredefinedClipboardFormats:
@ -105,6 +105,9 @@ end.
{
$Log$
Revision 1.22 2002/10/26 15:15:46 lazarus
MG: broke LCL<->interface circles
Revision 1.21 2002/10/25 10:42:08 lazarus
MG: broke minor circles

View File

@ -296,7 +296,6 @@ function ShortCutToText(ShortCut: TShortCut): string;
implementation
uses Interfaces;
{ Menu command managment }
@ -354,6 +353,9 @@ end.
{
$Log$
Revision 1.33 2002/10/26 15:15:47 lazarus
MG: broke LCL<->interface circles
Revision 1.32 2002/10/26 11:20:30 lazarus
MG: broke some interfaces.pp circles

View File

@ -38,7 +38,7 @@ interface
uses
VCLGlobals, Classes, SysUtils, LCLType, LCLProc, Graphics, GraphType,
LMessages, Controls, ExtendedStrings, LCLLinux, GraphicsMath, Forms;
LMessages, Controls, ExtendedStrings, LCLLinux, GraphMath, Forms;
type
@ -1382,6 +1382,9 @@ end.
{ =============================================================================
$Log$
Revision 1.65 2002/10/26 15:15:47 lazarus
MG: broke LCL<->interface circles
Revision 1.64 2002/10/26 11:20:30 lazarus
MG: broke some interfaces.pp circles