Package ch.bailu.gtk.gtk
Class TreePath
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gtk.TreePath
- All Implemented Interfaces:
PointerInterface
An opaque structure representing a path to a row in a model.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTreePath()
Creates a new `GtkTreePath`
This refers to a row.TreePath
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendIndex
(int index_) Appends a new index to a path.int
Compares two paths.copy()
Creates a new `GtkTreePath` as a copy of @path.void
down()
Moves @path to point to the first child of the current path.void
free()
Frees @path.static ClassHandler
int
getDepth()
Returns the current depth of @path.Returns the current indices of @path.getIndicesWithDepth
(Int depth) Returns the current indices of @path.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
isAncestor
(TreePath descendant) Returns %TRUE if @descendant is a descendant of @path.boolean
isDescendant
(TreePath ancestor) Returns %TRUE if @path is a descendant of @ancestor.static TreePath
Creates a new `GtkTreePath`.static TreePath
newFromIndicesTreePath
(int first_index, Object... _elipse) Creates a new path with @first_index and @varargs as indices.static TreePath
newFromIndicesvTreePath
(Int indices, long length) Creates a new path with the given @indices array of @length.static TreePath
newFromStringTreePath
(Str path) Creates a new `GtkTreePath` initialized to @path.static TreePath
newFromStringTreePath
(String path) Creates a new `GtkTreePath` initialized to @path.void
next()
Moves the @path to point to the next node at the current depth.void
prependIndex
(int index_) Prepends a new index to a path.boolean
prev()
Moves the @path to point to the previous node at the
current depth, if it exists.toStr()
Generates a string representation of the path.boolean
up()
Moves the @path to point to its parent node, if it has a parent.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
TreePath
-
TreePath
public TreePath()Creates a new `GtkTreePath`
This refers to a row.
-
-
Method Details
-
getClassHandler
-
newFirstTreePath
Creates a new `GtkTreePath`.
The string representation of this path is “0”.- Returns:
- A new `GtkTreePath`
-
newFromIndicesTreePath
Creates a new path with @first_index and @varargs as indices.- Parameters:
first_index
- first integer_elipse
- list of integers terminated by -1- Returns:
- A newly created `GtkTreePath`
-
newFromIndicesvTreePath
Creates a new path with the given @indices array of @length.- Parameters:
indices
- array of indiceslength
- length of @indices array- Returns:
- A newly created `GtkTreePath`
-
newFromStringTreePath
Creates a new `GtkTreePath` initialized to @path.
@path is expected to be a colon separated list of numbers.
For example, the string “10:4:0” would create a path of depth
3 pointing to the 11th child of the root node, the 5th
child of that 11th child, and the 1st child of that 5th child.
If an invalid path string is passed in, %NULL is returned.- Parameters:
path
- The string representation of a path- Returns:
- A newly-created `GtkTreePath`
-
newFromStringTreePath
Creates a new `GtkTreePath` initialized to @path.
@path is expected to be a colon separated list of numbers.
For example, the string “10:4:0” would create a path of depth
3 pointing to the 11th child of the root node, the 5th
child of that 11th child, and the 1st child of that 5th child.
If an invalid path string is passed in, %NULL is returned.- Parameters:
path
- The string representation of a path- Returns:
- A newly-created `GtkTreePath`
-
appendIndex
public void appendIndex(int index_) Appends a new index to a path.
As a result, the depth of the path is increased.- Parameters:
index_
- the index
-
compare
Compares two paths.
If @a appears before @b in a tree, then -1 is returned.
If @b appears before @a, then 1 is returned.
If the two nodes are equal, then 0 is returned.- Parameters:
b
- a `GtkTreePath` to compare with- Returns:
- the relative positions of @a and @b
-
copy
Creates a new `GtkTreePath` as a copy of @path.- Returns:
- a new `GtkTreePath`
-
down
public void down()Moves @path to point to the first child of the current path. -
free
public void free()Frees @path. If @path is %NULL, it simply returns. -
getDepth
public int getDepth()Returns the current depth of @path.- Returns:
- The depth of @path
-
getIndices
Returns the current indices of @path.
This is an array of integers, each representing a node in a tree.
This value should not be freed.
The length of the array can be obtained with gtk_tree_path_get_depth().- Returns:
- The current indices
-
getIndicesWithDepth
Returns the current indices of @path.
This is an array of integers, each representing a node in a tree.
It also returns the number of elements in the array.
The array should not be freed.- Parameters:
depth
- return location for number of elements returned in the integer array- Returns:
- The current indices
-
isAncestor
Returns %TRUE if @descendant is a descendant of @path.- Parameters:
descendant
- another `GtkTreePath`- Returns:
- %TRUE if @descendant is contained inside @path
-
isDescendant
Returns %TRUE if @path is a descendant of @ancestor.- Parameters:
ancestor
- another `GtkTreePath`- Returns:
- %TRUE if @ancestor contains @path somewhere below it
-
next
public void next()Moves the @path to point to the next node at the current depth. -
prependIndex
public void prependIndex(int index_) Prepends a new index to a path.
As a result, the depth of the path is increased.- Parameters:
index_
- the index
-
prev
public boolean prev()Moves the @path to point to the previous node at the
current depth, if it exists.- Returns:
- %TRUE if @path has a previous node, and the move was made
-
toStr
Generates a string representation of the path.
This string is a “:” separated list of numbers.
For example, “4:10:0:3” would be an acceptable
return value for this string. If the path has
depth 0, %NULL is returned.- Returns:
- A newly-allocated string
-
up
public boolean up()Moves the @path to point to its parent node, if it has a parent.- Returns:
- %TRUE if @path has a parent, and the move was made
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-