PageRenderTime 69ms CodeModel.GetById 17ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/gtk2/src/gtk+/gtk/gtktreemodel.inc

https://github.com/slibre/freepascal
Pascal | 202 lines | 140 code | 29 blank | 33 comment | 0 complexity | c7209c1c6c51f8531baca4bed19107fc MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1// included by gtk2.pas
  2
  3{$IFDEF read_forward_definitions}
  4   // internal type
  5   PPGtkTreeModel = ^PGtkTreeModel;
  6   PGtkTreeModel = pointer;
  7   // internal type
  8   PGtkTreePath = pointer;
  9
 10   PGtkTreeIter = ^TGtkTreeIter;
 11
 12{$ENDIF read_forward_definitions}
 13
 14//------------------------------------------------------------------------------
 15
 16{$IFDEF read_interface_types}
 17   TGtkTreeModelForeachFunc = function (model:PGtkTreeModel; path:PGtkTreePath;
 18                              iter:PGtkTreeIter; data:gpointer):gboolean; cdecl;
 19
 20   PGtkTreeModelFlags = ^TGtkTreeModelFlags;
 21   TGtkTreeModelFlags = longint;
 22
 23   TGtkTreeIter = record
 24        stamp : gint;
 25        user_data : gpointer;
 26        user_data2 : gpointer;
 27        user_data3 : gpointer;
 28     end;
 29
 30{ Signals  }
 31{ Virtual Table  }
 32   PGtkTreeModelIface = ^TGtkTreeModelIface;
 33   TGtkTreeModelIface = record
 34        g_iface : TGTypeInterface;
 35        row_changed : procedure (tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
 36        row_inserted : procedure (tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
 37        row_has_child_toggled : procedure (tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl;
 38        row_deleted : procedure (tree_model:PGtkTreeModel; path:PGtkTreePath); cdecl;
 39        rows_reordered : procedure (tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter; new_order:Pgint); cdecl;
 40        get_flags : function (tree_model:PGtkTreeModel):TGtkTreeModelFlags; cdecl;
 41        get_n_columns : function (tree_model:PGtkTreeModel):gint; cdecl;
 42        get_column_type : function (tree_model:PGtkTreeModel; index:gint):GType; cdecl;
 43        get_iter : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter; path:PGtkTreePath):gboolean; cdecl;
 44        get_path : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter):PGtkTreePath; cdecl;
 45        get_value : procedure (tree_model:PGtkTreeModel; iter:PGtkTreeIter; column:gint; value:PGValue); cdecl;
 46        iter_next : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean; cdecl;
 47        iter_children : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter; parent:PGtkTreeIter):gboolean; cdecl;
 48        iter_has_child : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean; cdecl;
 49        iter_n_children : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter):gint; cdecl;
 50        iter_nth_child : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter; parent:PGtkTreeIter; n:gint):gboolean; cdecl;
 51        iter_parent : function (tree_model:PGtkTreeModel; iter:PGtkTreeIter; child:PGtkTreeIter):gboolean; cdecl;
 52        ref_node : procedure (tree_model:PGtkTreeModel; iter:PGtkTreeIter); cdecl;
 53        unref_node : procedure (tree_model:PGtkTreeModel; iter:PGtkTreeIter); cdecl;
 54     end;
 55
 56{$ENDIF read_interface_types}
 57
 58//------------------------------------------------------------------------------
 59
 60{$IFDEF read_interface_rest}
 61const
 62   GTK_TREE_MODEL_ITERS_PERSIST = 1 shl 0;
 63   GTK_TREE_MODEL_LIST_ONLY = 1 shl 1;
 64
 65
 66function GTK_TYPE_TREE_MODEL : GType;
 67function GTK_TREE_MODEL(obj: pointer) : PGtkTreeModel;
 68function GTK_IS_TREE_MODEL(obj: pointer) : boolean;
 69function GTK_TREE_MODEL_GET_IFACE(obj: pointer) : PGtkTreeModelIface;
 70function GTK_TYPE_TREE_ITER : GType;
 71function GTK_TYPE_TREE_PATH : GType;
 72    { return type might be wrong }
 73
 74{ GtkTreePath operations  }
 75
 76function gtk_tree_path_new:PGtkTreePath; cdecl; external gtklib;
 77function gtk_tree_path_new_from_string(path:Pgchar):PGtkTreePath; cdecl; external gtklib;
 78function gtk_tree_path_to_string(path:PGtkTreePath):Pgchar; cdecl; external gtklib;
 79function gtk_tree_path_new_root : PGtkTreePath;
 80
 81function gtk_tree_path_new_first:PGtkTreePath; cdecl; external gtklib;
 82procedure gtk_tree_path_append_index(path:PGtkTreePath; index:gint); cdecl; external gtklib;
 83procedure gtk_tree_path_prepend_index(path:PGtkTreePath; index:gint); cdecl; external gtklib;
 84function gtk_tree_path_get_depth(path:PGtkTreePath):gint; cdecl; external gtklib;
 85function gtk_tree_path_get_indices(path:PGtkTreePath):Pgint; cdecl; external gtklib;
 86procedure gtk_tree_path_free(path:PGtkTreePath); cdecl; external gtklib;
 87function gtk_tree_path_copy(path:PGtkTreePath):PGtkTreePath; cdecl; external gtklib;
 88function gtk_tree_path_get_type:GType; cdecl; external gtklib;
 89function gtk_tree_path_compare(a:PGtkTreePath; b:PGtkTreePath):gint; cdecl; external gtklib;
 90procedure gtk_tree_path_next(path:PGtkTreePath); cdecl; external gtklib;
 91function gtk_tree_path_prev(path:PGtkTreePath):gboolean; cdecl; external gtklib;
 92function gtk_tree_path_up(path:PGtkTreePath):gboolean; cdecl; external gtklib;
 93procedure gtk_tree_path_down(path:PGtkTreePath); cdecl; external gtklib;
 94function gtk_tree_path_is_ancestor(path:PGtkTreePath; descendant:PGtkTreePath):gboolean; cdecl; external gtklib;
 95function gtk_tree_path_is_descendant(path:PGtkTreePath; ancestor:PGtkTreePath):gboolean; cdecl; external gtklib;
 96{ Row reference (an anObject that tracks model changes so it refers to the same
 97   row always; a path refers to a position, not a fixed row).  You almost always
 98   want to call gtk_tree_row_reference_new.
 99  }
100function gtk_tree_row_reference_new(model:PGtkTreeModel; path:PGtkTreePath):PGtkTreeRowReference; cdecl; external gtklib;
101function gtk_tree_row_reference_new_proxy(proxy:PGObject; model:PGtkTreeModel; path:PGtkTreePath):PGtkTreeRowReference; cdecl; external gtklib;
102function gtk_tree_row_reference_get_path(reference:PGtkTreeRowReference):PGtkTreePath; cdecl; external gtklib;
103function gtk_tree_row_reference_valid(reference:PGtkTreeRowReference):gboolean; cdecl; external gtklib;
104procedure gtk_tree_row_reference_free(reference:PGtkTreeRowReference); cdecl; external gtklib;
105{ These two functions are only needed if you created the row reference with a
106   proxy anObject  }
107procedure gtk_tree_row_reference_inserted(proxy:PGObject; path:PGtkTreePath); cdecl; external gtklib;
108procedure gtk_tree_row_reference_deleted(proxy:PGObject; path:PGtkTreePath); cdecl; external gtklib;
109procedure gtk_tree_row_reference_reordered(proxy:PGObject; path:PGtkTreePath; iter:PGtkTreeIter; new_order:Pgint); cdecl; external gtklib;
110{ GtkTreeIter operations  }
111function gtk_tree_iter_copy(iter:PGtkTreeIter):PGtkTreeIter; cdecl; external gtklib;
112procedure gtk_tree_iter_free(iter:PGtkTreeIter); cdecl; external gtklib;
113function gtk_tree_iter_get_type:GType; cdecl; external gtklib;
114function gtk_tree_model_get_type:TGtkType; cdecl; external gtklib;
115function gtk_tree_model_get_flags(tree_model:PGtkTreeModel):TGtkTreeModelFlags; cdecl; external gtklib;
116function gtk_tree_model_get_n_columns(tree_model:PGtkTreeModel):gint; cdecl; external gtklib;
117function gtk_tree_model_get_column_type(tree_model:PGtkTreeModel; index:gint):GType; cdecl; external gtklib;
118{ Iterator movement  }
119function gtk_tree_model_get_iter(tree_model:PGtkTreeModel; iter:PGtkTreeIter; path:PGtkTreePath):gboolean; cdecl; external gtklib;
120function gtk_tree_model_get_iter_from_string(tree_model:PGtkTreeModel; iter:PGtkTreeIter; path_string:Pgchar):gboolean; cdecl; external gtklib;
121function gtk_tree_model_get_iter_root(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean;
122
123function gtk_tree_model_get_iter_first(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean; cdecl; external gtklib;
124function gtk_tree_model_get_path(tree_model:PGtkTreeModel; iter:PGtkTreeIter):PGtkTreePath; cdecl; external gtklib;
125procedure gtk_tree_model_get_value(tree_model:PGtkTreeModel; iter:PGtkTreeIter; column:gint; value:PGValue); cdecl; external gtklib;
126function gtk_tree_model_iter_next(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean; cdecl; external gtklib;
127function gtk_tree_model_iter_children(tree_model:PGtkTreeModel; iter:PGtkTreeIter; parent:PGtkTreeIter):gboolean; cdecl; external gtklib;
128function gtk_tree_model_iter_has_child(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean; cdecl; external gtklib;
129function gtk_tree_model_iter_n_children(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gint; cdecl; external gtklib;
130function gtk_tree_model_iter_nth_child(tree_model:PGtkTreeModel; iter:PGtkTreeIter; parent:PGtkTreeIter; n:gint):gboolean; cdecl; external gtklib;
131function gtk_tree_model_iter_parent(tree_model:PGtkTreeModel; iter:PGtkTreeIter; child:PGtkTreeIter):gboolean; cdecl; external gtklib;
132procedure gtk_tree_model_ref_node(tree_model:PGtkTreeModel; iter:PGtkTreeIter); cdecl; external gtklib;
133procedure gtk_tree_model_unref_node(tree_model:PGtkTreeModel; iter:PGtkTreeIter); cdecl; external gtklib;
134{$IFNDEF KYLIX}
135procedure gtk_tree_model_get(tree_model:PGtkTreeModel; iter:PGtkTreeIter; args:array of const); cdecl; overload; external gtklib;
136procedure gtk_tree_model_get(tree_model:PGtkTreeModel; iter:PGtkTreeIter); cdecl; overload; varargs; external gtklib;
137procedure gtk_tree_model_get_valist(tree_model:PGtkTreeModel; iter:PGtkTreeIter; var_args: array of const); cdecl; varargs; external gtklib;
138{$ELSE}
139procedure gtk_tree_model_get(tree_model:PGtkTreeModel; iter:PGtkTreeIter); varargs; cdecl; external gtklib;
140procedure gtk_tree_model_get_valist(tree_model:PGtkTreeModel; iter:PGtkTreeIter); varargs; cdecl; external gtklib;
141{$ENDIF}
142procedure gtk_tree_model_foreach(model:PGtkTreeModel; func:TGtkTreeModelForeachFunc; user_data:gpointer); cdecl; external gtklib;
143{ Signals  }
144procedure gtk_tree_model_row_changed(tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl; external gtklib;
145procedure gtk_tree_model_row_inserted(tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl; external gtklib;
146procedure gtk_tree_model_row_has_child_toggled(tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter); cdecl; external gtklib;
147procedure gtk_tree_model_row_deleted(tree_model:PGtkTreeModel; path:PGtkTreePath); cdecl; external gtklib;
148procedure gtk_tree_model_rows_reordered(tree_model:PGtkTreeModel; path:PGtkTreePath; iter:PGtkTreeIter; new_order:Pgint); cdecl; external gtklib;
149
150{$IFDEF HasGTK2_2}
151function gtk_tree_model_get_string_from_iter(tree_model:PGtkTreeModel; iter:PGtkTreeIter):Pgchar; cdecl; external gtklib;
152function gtk_tree_path_new_from_indices(first_index: gint): PGtkTreePath; cdecl; varargs; external gtklib;
153function gtk_tree_row_reference_copy(reference:PGtkTreeRowReference):PGtkTreeRowReference; cdecl; external gtklib;
154{$ENDIF}
155{$ENDIF read_interface_rest}
156
157//------------------------------------------------------------------------------
158
159{$IFDEF read_implementation}
160function GTK_TYPE_TREE_MODEL : GType;
161begin
162   GTK_TYPE_TREE_MODEL:=gtk_tree_model_get_type;
163end;
164
165function GTK_TREE_MODEL(obj: pointer) : PGtkTreeModel;
166begin
167   GTK_TREE_MODEL:=PGtkTreeModel(G_TYPE_CHECK_INSTANCE_CAST(obj,GTK_TYPE_TREE_MODEL));
168end;
169
170function GTK_IS_TREE_MODEL(obj: pointer) : boolean;
171begin
172   GTK_IS_TREE_MODEL:=G_TYPE_CHECK_INSTANCE_TYPE(obj,GTK_TYPE_TREE_MODEL);
173end;
174
175function GTK_TREE_MODEL_GET_IFACE(obj: pointer) : PGtkTreeModelIface;
176begin
177   GTK_TREE_MODEL_GET_IFACE:=PGtkTreeModelIface(G_TYPE_INSTANCE_GET_INTERFACE(obj,GTK_TYPE_TREE_MODEL));
178end;
179
180function GTK_TYPE_TREE_ITER : GType;
181begin
182   GTK_TYPE_TREE_ITER:=gtk_tree_iter_get_type;
183end;
184
185function GTK_TYPE_TREE_PATH : GType;
186begin
187   GTK_TYPE_TREE_PATH:=gtk_tree_path_get_type;
188end;
189
190function gtk_tree_path_new_root : PGtkTreePath;
191begin
192   gtk_tree_path_new_root:=gtk_tree_path_new_first;
193end;
194
195function gtk_tree_model_get_iter_root(tree_model:PGtkTreeModel; iter:PGtkTreeIter):gboolean;
196begin
197   gtk_tree_model_get_iter_root:=gtk_tree_model_get_iter_first(tree_model,iter);
198end;
199
200{$ENDIF read_implementation}
201// included by gtk2.pas
202