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

« back to all changes in this revision

Viewing changes to lcl/interfaces/carbon/carbonlclintf.inc

  • 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
1
{%MainUnit carbonint.pas}
2
2
 
3
 
{ $Id: carbonlclintf.inc 24863 2010-04-23 20:30:18Z dmitry $ }
4
3
{******************************************************************************
5
4
  All Carbon interface communication implementations.
6
5
  This are the implementation of the overrides of the Carbon Interface for the
76
75
  TCarbonDeviceContext(DC).DrawGrid(R, DX, DY);
77
76
end;
78
77
 
79
 
function TCarbonWidgetSet.ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint;
80
 
  Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
81
 
begin
82
 
  Result:=inherited ExtUTF8Out(DC, X, Y, Options, Rect, Str, Count, Dx);
83
 
end;
84
 
 
85
78
function TCarbonWidgetSet.FontCanUTF8(Font: HFont): boolean;
86
79
begin
87
80
  Result := True;
136
129
end;
137
130
 
138
131
{------------------------------------------------------------------------------
139
 
  Method:  IntfSendsUTF8KeyPress
140
 
  Returns: If the interface sends UTF-8 key press events
141
 
 ------------------------------------------------------------------------------}
142
 
function TCarbonWidgetSet.IntfSendsUTF8KeyPress: boolean;
143
 
begin
144
 
  Result := True;
145
 
end;
146
 
 
147
 
{------------------------------------------------------------------------------
148
132
  Method:  IsDesignerDC
149
133
  Params:  WindowHandle - Handle of window
150
134
           DC           - Handle of device context
204
188
      end;
205
189
  end;
206
190
  
207
 
const
208
 
  ButtonCaption: Array [idButtonOk..idButtonNoToAll] of String =
209
 
    ('OK', 'Cancel', ''{Help}, 'Yes', 'No', 'Close', 'Abort', 'Retry', 'Ignore',
210
 
     'All', 'Yes To All', 'No To All');
 
191
  function tr(TranslatedStr: string): string;
 
192
  begin
 
193
    Result:=TranslatedStr;
 
194
    DeleteAmpersands(Result);
 
195
  end;
 
196
 
211
197
{ Note: Not using Pointer(kAlertDefaultOKText) or Pointer(kAlertDefaultCancelText)
212
198
  since this just passes in -1, which tells button to use its normal text and
213
199
  we need to override with Yes and No. If Localizable.strings file is in app 
226
212
  AlertRef    : DialogRef;
227
213
  AlertBtnIdx : DialogItemIndex;
228
214
  I: Integer;
 
215
  BtnCaption: String;
229
216
 
230
217
const SName = 'PromptUser';
231
218
begin
278
265
    if Buttons[I] = idButtonHelp then ParamRec.helpButton := True
279
266
    else
280
267
    begin
281
 
      if (Buttons[I] < Low(ButtonCaption)) or (Buttons[I] > High(ButtonCaption)) then
282
 
      begin
283
 
        DebugLn('TCarbonWidgetSet.PromptUser Invalid button ID: ' + DbgS(Buttons[I]));
284
 
        Continue;
285
 
      end;
286
 
      
287
 
      CreateCFString(ButtonCaption[Buttons[I]], CFString);
 
268
      BtnCaption:=tr(GetButtonCaption(Buttons[i]));
 
269
      if BtnCaption='' then
 
270
        continue;
 
271
 
 
272
      CreateCFString(BtnCaption, CFString);
288
273
      try
289
274
        case ButtonID of
290
275
          0: // set right button caption and result
330
315
  end;
331
316
 
332
317
  try
333
 
    if OSError(CreateStandardAlert(AlertCode, CaptionStr, MessageStr, @ParamRec, AlertRef),
 
318
    if OSError(CreateStandardAlert(AlertCode, CaptionStr, MessageStr, @ParamRec, AlertRef{%H-}),
334
319
      Self, SName, 'CreateStandardAlert') then Exit;
335
320
      
336
 
    if OSError(RunStandardAlert(AlertRef, nil, AlertBtnIdx), Self, SName,
 
321
    if OSError(RunStandardAlert(AlertRef, nil, AlertBtnIdx{%H-}), Self, SName,
337
322
      'RunStandardAlert') then Exit;
338
323
 
339
324
    {Convert Carbon result to LCL "id" dialog result}
473
458
function TCarbonWidgetSet.RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC; const ARect: TRect): Boolean;
474
459
var
475
460
  CBC: TCarbonBitmapContext absolute ADC;
476
 
  Desc: TRawImageDescription absolute ARawImage.Description;
477
461
  displayID: CGDirectDisplayID;
478
462
  ScreenImage: CGImageRef;
479
463
begin