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

« back to all changes in this revision

Viewing changes to lcl/interfaces/gtk2/gtk2listviewtreemodel.pas

  • 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: gtk2listviewtreemodel.pas 24690 2010-04-18 08:40:27Z paul $
 
1
{ $Id: gtk2listviewtreemodel.pas 36862 2012-04-17 07:55:52Z zeljko $
2
2
 
3
3
 *****************************************************************************
4
4
 *                                                                           *
41
41
    qdata : PGData;
42
42
    {%ENDREGION}
43
43
    {%REGION Interface methods in order!}
44
 
    procedure row_changed(path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
45
 
    procedure row_inserted(path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
46
 
    procedure row_has_child_toggled(path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
47
 
    procedure row_deleted(path:PGtkTreePath); cdecl;
48
 
    procedure rows_reordered(path:PGtkTreePath; iter:PGtkTreeIter; new_order:Pgint); cdecl;
 
44
    procedure row_changed({%H-}path:PGtkTreePath; {%H-}iter:PGtkTreeIter); cdecl;
 
45
    procedure row_inserted({%H-}path:PGtkTreePath; {%H-}iter:PGtkTreeIter); cdecl;
 
46
    procedure row_has_child_toggled({%H-}path:PGtkTreePath; {%H-}iter:PGtkTreeIter); cdecl;
 
47
    procedure row_deleted({%H-}path:PGtkTreePath); cdecl;
 
48
    procedure rows_reordered({%H-}path:PGtkTreePath; {%H-}iter:PGtkTreeIter; {%H-}new_order:Pgint); cdecl;
49
49
    function  get_flags():TGtkTreeModelFlags; cdecl;
50
50
    function  get_n_columns():gint; cdecl;
51
 
    function  get_column_type(index:gint):GType; cdecl;
 
51
    function  get_column_type({%H-}index:gint):GType; cdecl;
52
52
    function  get_iter(iter:PGtkTreeIter; path:PGtkTreePath):gboolean; cdecl;
53
53
    function  get_path(iter:PGtkTreeIter):PGtkTreePath; cdecl;
54
 
    procedure get_value(iter:PGtkTreeIter; column:gint; value:PGValue); cdecl;
 
54
    procedure get_value(iter:PGtkTreeIter; {%H-}column:gint; value:PGValue); cdecl;
55
55
    function  iter_next(iter:PGtkTreeIter):gboolean; cdecl;
56
 
    function  iter_children(iter:PGtkTreeIter; parent:PGtkTreeIter):gboolean; cdecl;
57
 
    function  iter_has_child(iter:PGtkTreeIter):gboolean; cdecl;
 
56
    function  iter_children({%H-}iter:PGtkTreeIter; {%H-}parent:PGtkTreeIter):gboolean; cdecl;
 
57
    function  iter_has_child({%H-}iter:PGtkTreeIter):gboolean; cdecl;
58
58
    function  iter_n_children(iter:PGtkTreeIter):gint; cdecl;
59
59
    function  iter_nth_child(iter:PGtkTreeIter; parent:PGtkTreeIter; n:gint):gboolean; cdecl;
60
 
    function  iter_parent(iter:PGtkTreeIter; child:PGtkTreeIter):gboolean; cdecl;
61
 
    procedure ref_node(iter:PGtkTreeIter); cdecl;
62
 
    procedure unref_node(iter:PGtkTreeIter); cdecl;
 
60
    function  iter_parent({%H-}iter:PGtkTreeIter; {%H-}child:PGtkTreeIter):gboolean; cdecl;
 
61
    procedure ref_node({%H-}iter:PGtkTreeIter); cdecl;
 
62
    procedure unref_node({%H-}iter:PGtkTreeIter); cdecl;
63
63
    {%ENDREGION}
64
64
    procedure NotifyRowInserted(AIndex: PtrUInt);
65
65
    procedure NotifyRowDeleted(AIndex: PtrUInt);
80
80
function LCLLISTVIEW_MODEL_TYPE: GType;
81
81
 
82
82
 
83
 
procedure LCLListViewModelClassInit(g_class:gpointer; class_data:gpointer); cdecl;
84
 
procedure LCLListViewModelInit(instance:PGTypeInstance; g_class:gpointer); cdecl;
85
 
procedure LCLListViewModelInterfaceInit(g_iface:PGtkTreeModelIface; iface_data:gpointer); cdecl;
 
83
procedure LCLListViewModelClassInit({%H-}g_class:gpointer; {%H-}class_data:gpointer); cdecl;
 
84
procedure LCLListViewModelInit({%H-}instance:PGTypeInstance; {%H-}g_class:gpointer); cdecl;
 
85
procedure LCLListViewModelInterfaceInit(g_iface:PGtkTreeModelIface; {%H-}iface_data:gpointer); cdecl;
86
86
 
87
87
 
88
88
implementation
213
213
  Index := gtk_tree_path_get_indices(path)[0];
214
214
  if Index < ListView.Items.Count then
215
215
  begin
216
 
    iter^.user_data:= Pointer(Index);
 
216
    iter^.user_data:= {%H-}Pointer(Index);
217
217
    Exit(True);
218
218
  end;
219
219
end;
225
225
  Result := nil;
226
226
  if iter = nil then
227
227
    Exit;
228
 
  Index := PtrUint(Iter^.user_data);
 
228
  Index := {%H-}PtrUint(Iter^.user_data);
229
229
  Result := gtk_tree_path_new_from_indices(Index, -1);
230
230
end;
231
231
 
237
237
  //ValueType: GType;
238
238
  //SubIndex: Integer;
239
239
begin
240
 
  Index := PtrUint(Iter^.user_data);
 
240
  Index := {%H-}PtrUint(Iter^.user_data);
241
241
  Item := TLVItemHack(ListView.Items.Item[Index]);
242
242
 
243
243
  g_value_init(value, G_TYPE_POINTER);
293
293
  Result := False;
294
294
  if ListView = nil then
295
295
    Exit;
296
 
  Inc(PtrUInt(Iter^.user_data));
297
 
  Result := PtrUint(Iter^.user_data) < ListView.items.Count;
 
296
  Inc({%H-}PtrUInt(Iter^.user_data));
 
297
  Result := {%H-}PtrUint(Iter^.user_data) < ListView.items.Count;
298
298
end;
299
299
 
300
300
function TLCLListViewModel.iter_children(iter: PGtkTreeIter; parent: PGtkTreeIter): gboolean; cdecl;
322
322
    Exit;
323
323
  if (Iter <> nil) and (n < ListView.Items.Count) then
324
324
  begin
325
 
    PtrUint(Iter^.user_data) := n;
 
325
    {%H-}PtrUint(Iter^.user_data) := n;
326
326
    Result := True;
327
327
  end;
328
328
end;
334
334
 
335
335
procedure TLCLListViewModel.ref_node(iter: PGtkTreeIter); cdecl;
336
336
begin
 
337
 
337
338
end;
338
339
 
339
340
procedure TLCLListViewModel.unref_node(iter: PGtkTreeIter); cdecl;
340
341
begin
 
342
 
341
343
end;
342
344
 
343
345
procedure TLCLListViewModel.NotifyRowInserted(AIndex: PtrUInt);
345
347
  Path: PGtkTreePath;
346
348
  Iter: TGtkTreeIter;
347
349
begin
348
 
  Iter.user_data := Pointer(AIndex);
 
350
  Iter.user_data := {%H-}Pointer(AIndex);
349
351
  path := gtk_tree_path_new_from_indices(AIndex, -1);
350
352
  //emits a signal
351
353
  gtk_tree_model_row_inserted(TreeModel, path, @iter);