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/filectrl.pp svneol=native#text/pascal
lcl/forms.pp svneol=native#text/pascal lcl/forms.pp svneol=native#text/pascal
lcl/graphics.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/graphmath.pp svneol=native#text/pascal
lcl/graphtype.pp svneol=native#text/pascal lcl/graphtype.pp svneol=native#text/pascal
lcl/grids.pas svneol=native#text/pascal lcl/grids.pas svneol=native#text/pascal

View File

@ -45,6 +45,7 @@ uses
{$IFDEF IDE_MEM_CHECK} {$IFDEF IDE_MEM_CHECK}
MemCheck, MemCheck,
{$ENDIF} {$ENDIF}
Interfaces,
Forms, Forms,
Splash, Splash,
Main, Main,
@ -87,6 +88,9 @@ end.
{ {
$Log$ $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 Revision 1.38 2002/10/10 20:34:32 lazarus
MG: fixed freeing Glyph in TBitBtn.SetKind MG: fixed freeing Glyph in TBitBtn.SetKind

View File

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

View File

@ -12,11 +12,10 @@ dirs=interfaces
units=allunits units=allunits
implicitunits=arrow actnlist buttons calendar clipbrd clistbox comctrls \ implicitunits=arrow actnlist buttons calendar clipbrd clistbox comctrls \
commctrl controls dialogs dynhasharray extctrls extendedstrings \ 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 \ lazqueue lclmemmanager lcllinux lclstrconsts lcltype lmessages \
lresources menus messages registry spin stdctrls stringhashlist \ lresources menus messages registry spin stdctrls stringhashlist \
toolwin utrace vclglobals 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. # and do not add allunits. It is just a dummy unit used for compiling.
rsts=dialogs rsts=dialogs

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -30,29 +30,15 @@ interface
uses uses
InterfaceBase; InterfaceBase;
var
InterfaceObject : TInterfaceBase;
implementation implementation
uses uses
GnomeInt, Clipbrd, SysUtils, GnomeInt, Forms;
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.
initialization initialization
InterfaceObject := TGnomeObject.Create; InterfaceObject := TGnomeObject.Create;
finalization finalization
Application.Free; FreeInterfaceObject;
Application:=nil;
FreeAllClipBoards;
InterfaceObject.Free;
InterfaceObject:=nil;
end. end.

View File

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

View File

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

View File

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