~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to lcl/interfaces/gtk2/gtk2def.pp

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{ $Id: gtk2def.pp 35769 2012-03-06 14:50:15Z vincents $ 
 
1
{ $Id: gtk2def.pp 39157 2012-10-23 22:39:38Z maxim $ 
2
2
                         -------------------------------
3
3
                         gtk2def.pp  -  Type definitions
4
4
                         ------------------------------- 
5
5
 
6
6
 @created(Tue Nov 20st WET 2007)
7
 
 @lastmod($Date: 2012-03-06 14:50:15 +0000 (Tue, 06 Mar 2012) $)
 
7
 @lastmod($Date: 2012-10-24 00:39:38 +0200 (Wed, 24 Oct 2012) $)
8
8
 @author(Marc Weustink <marc@@dommelstein.net>)                       
9
9
 
10
10
 This unit contains type definitions needed in the GTK2 <-> LCL interface
279
279
    FWidget: PGtkWidget;     // the owner (in case of a windowDC)
280
280
 
281
281
    FWithChildWindows: boolean;// this DC covers sub gdkwindows
282
 
    FOrigin: TPoint;
283
 
    FSpecialOrigin: Boolean;
284
282
 
285
283
    FFlags: TDeviceContextsFlags;
286
284
    FSelectedColors: TDevContextSelectedColorsType;
292
290
    FViewPortExt: TPoint; // current viewport extent
293
291
    FViewPortOrg: TPoint; // current viewport origin
294
292
    FWindowExt: TPoint; // current window extent
 
293
    FWindowOrg: TPoint; // current window origin
295
294
 
 
295
    function GetClipRectangle: TGdkRectangle;
296
296
    function GetGDIObjects(ID: TGDIType): PGdiObject;
297
297
    function GetOffset: TPoint;
298
298
    function GetOwnedGDIObjects(ID: TGDIType): PGdiObject;
317
317
    procedure SetViewPortExt(const AValue: TPoint);
318
318
    procedure SetViewPortOrg(const AValue: TPoint);
319
319
    procedure SetWindowExt(const AValue: TPoint);
 
320
    procedure SetWindowOrg(AValue: TPoint);
320
321
  protected
321
322
    function CreateGC: PGdkGC; virtual;
322
323
 
361
362
    function GetBrush: PGdiObject;
362
363
    function GetPen: PGdiObject;
363
364
    function GetBitmap: PGdiObject;
364
 
    function GetFunction: TGdkFunction; virtual; abstract;
 
365
    function GetFunction: TGdkFunction;
365
366
    function IsNullBrush: boolean;
366
367
    function IsNullPen: boolean;
367
368
    function SelectObject(AGdiObject: PGdiObject): PGdiObject;
386
387
    // help functions
387
388
    function CopyDataFrom(ASource: TGtkDeviceContext; AClearSource, AMoveGDIOwnerShip, ARestore: Boolean): Boolean;
388
389
    function FillRect(ARect: TRect; ABrush: HBrush; SkipRop: Boolean): Boolean;
 
390
    procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor);
389
391
 
390
 
    // origins
391
 
    property Origin: TPoint read FOrigin write FOrigin;
 
392
    // device origin
392
393
    property Offset: TPoint read GetOffset;
393
394
    // drawing settings
394
395
    property CurrentBitmap: PGdiObject read FCurrentBitmap write SetCurrentBitmap;
396
397
    property CurrentPen: PGdiObject read FCurrentPen write SetCurrentPen;
397
398
    property CurrentBrush: PGdiObject read FCurrentBrush write SetCurrentBrush;
398
399
    property CurrentPalette: PGdiObject read FCurrentPalette write SetCurrentPalette;
 
400
    property ClipRect: TGdkRectangle read GetClipRectangle;
399
401
    property ClipRegion: PGdiObject read FClipRegion write SetClipRegion;
400
402
    property GCValues: TGdkGCValues read FGCValues;
401
403
    property GDIObjects[ID: TGDIType]: PGdiObject read GetGDIObjects write SetGDIObjects;
405
407
    property ViewPortExt: TPoint read FViewPortExt write SetViewPortExt;
406
408
    property ViewPortOrg: TPoint read FViewPortOrg write SetViewPortOrg;
407
409
    property WindowExt: TPoint read FWindowExt write SetWindowExt;
 
410
    property WindowOrg: TPoint read FWindowOrg write SetWindowOrg;
408
411
    // control
409
412
    property SelectedColors: TDevContextSelectedColorsType read FSelectedColors write SetSelectedColors;
410
413
    property Flags: TDeviceContextsFlags read FFlags write FFlags;
417
420
    property ROP2: Integer read GetRop2 write SetRop2;
418
421
  end;
419
422
 
 
423
  TGtk2DeviceContext = TGtkDeviceContext deprecated;
 
424
 
420
425
  // memory system for TDeviceContext(s) ---------------------------------------------
421
426
 
422
427
  { TDeviceContextMemManager }
440
445
    wwiDeactivating,                  // during gtk deactivate
441
446
    wwiActivating,                    // during gtk activate
442
447
    wwiNoEraseBkgnd,                  // erase background is disabled for widget
443
 
    wwiInvalidEvent                   // special mark for widgetinfo
 
448
    wwiInvalidEvent,                  // special mark for widgetinfo
444
449
                                      // see gtkchanged_editbox and
445
450
                                      // gtkchanged_editbox_backspace in gtkcallback.inc
 
451
    wwiTabWidgetFocusCheck            // TabWidget have nasty behaviour when clicked
 
452
                                      // by mouse: switches focus here and there, so
 
453
                                      // focused control triggers OnExit and it looks
 
454
                                      // like it triggered OnEnter.issue #20493
446
455
    );
447
456
  TWidgetInfoFlags = set of TWidgetInfoFlag;
448
457
  tGtkStateEnumRange = 0..31;
465
474
    EventMask: TGdkEventMask;
466
475
    DoubleBuffer: PGdkPixmap;
467
476
    CursorPos: integer;               // needed for delayed SetSelStart
 
477
    SelLength: integer;               // needed for delayed SetSelLength
468
478
    ControlCursor: HCursor;           // current widget cursor
469
 
    DefaultCursor: HCursor;           // default widget cursor
470
479
    Flags: TWidgetInfoFlags;
471
480
    ChangeLock: Integer;              // lock events
472
481
    PaintDepth: integer;              // increased/decreased by Begin/EndPaint
598
607
function dbgs(const r: TGDKRectangle): string; overload;
599
608
function dbgs(r: PGDKRectangle): string; overload;
600
609
 
601
 
type
602
 
  { TGtk2DeviceContext }
603
 
 
604
 
  TGtk2DeviceContext = class(TGtkDeviceContext)
605
 
  public
606
 
    procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor);
607
 
    function GetFunction: TGdkFunction; override;
608
 
  end;
609
 
  
610
 
  procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
 
610
procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt);
611
611
 
612
612
implementation
613
613