IdeLocation: Builder SDK Reference

## IdeLocation IdeLocation |

## Functions

IdeLocation * | ide_location_new_from_variant ()
IdeLocation * | ide_location_new ()
IdeLocation * | ide_location_new_with_offset ()
IdeLocation * | ide_location_dup ()
gint | ide_location_get_line ()
gint | ide_location_get_line_offset ()
gint | ide_location_get_offset ()
GFile * | ide_location_get_file ()
GVariant * | ide_location_to_variant ()
gboolean | ide_location_compare ()
guint | ide_location_hash ()

## Properties

GFile * | file | Read / Write / Construct Only
int | line | Read / Write / Construct Only
int | line-offset | Read / Write / Construct Only
int | offset | Read / Write / Construct Only

## Types and Values

#define | IDE_TYPE_LOCATION
struct | IdeLocationClass
| IdeLocation

## Object Hierarchy

        GObject
        ╰── IdeLocation

## Description

## Functions

### ide_location_new_from_variant ()

    IdeLocation *
    ide_location_new_from_variant (GVariant *variant);

Creates a new IdeLocation using the serialized form from a previously serialized GVariant.

As a convenience, if `variant` is `NULL`, `NULL` is returned.

See also: `ide_location_to_variant()`

#### Parameters

variant | a GVariant or `NULL`. | [nullable]

#### Returns

a GVariant if succesful; otherwise `NULL`.

[transfer full][nullable]

Since: 3.32

### ide_location_new ()

    IdeLocation *
    ide_location_new (GFile *file,
                      gint line,
                      gint line_offset);

### ide_location_new_with_offset ()

    IdeLocation *
    ide_location_new_with_offset (GFile *file,
                                  gint line,
                                  gint line_offset,
                                  gint offset);

#### Parameters

file | a GFile |
line | a line number starting from 0, or -1 if unknown |
line_offset | a line offset starting from 0, or -1 if unknown |
offset | a charcter offset in file starting from 0, or -1 if unknown |

#### Returns

an IdeLocation.

[transfer full]

Since: 3.32

### ide_location_dup ()

    IdeLocation *
    ide_location_dup (IdeLocation *self);

Makes a deep copy of `self` .

#### Parameters

self | a IdeLocation |

#### Returns

a new IdeLocation.

[transfer full]

Since: 3.32

### ide_location_get_line ()

    gint
    ide_location_get_line (IdeLocation *self);

Gets the line within the “file”, or -1 if it is unknown.

#### Parameters

self | a IdeLocation |

#### Returns

the line number, or -1.

Since: 3.32

### ide_location_get_line_offset ()

    gint
    ide_location_get_line_offset (IdeLocation *self);

Gets the offset within the “line”, or -1 if it is unknown.

#### Parameters

self | a IdeLocation |

#### Returns

the line offset, or -1.

Since: 3.32

### ide_location_get_offset ()

    gint
    ide_location_get_offset (IdeLocation *self);

Gets the offset within the file in characters, or -1 if it is unknown.

#### Parameters

self | a IdeLocation |

#### Returns

the line offset, or -1.

Since: 3.32

### ide_location_get_file ()

    GFile *
    ide_location_get_file (IdeLocation *self);

Gets the file within the location.

#### Parameters

self | a IdeLocation |

#### Returns

a GFile or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_location_to_variant ()

    GVariant *
    ide_location_to_variant (IdeLocation *self);

Serializes the location into a variant that can be used to transport across IPC boundaries.

This function will never return a variant with a floating reference.

#### Parameters

self | a IdeLocation |

#### Returns

a GVariant.

[transfer full]

Since: 3.32

### ide_location_compare ()

    gboolean
    ide_location_compare (IdeLocation *a,
                          IdeLocation *b);

### ide_location_hash ()

    guint
    ide_location_hash (IdeLocation *self);

## Types and Values

### IDE_TYPE_LOCATION

    #define IDE_TYPE_LOCATION (ide_location_get_type())

### struct IdeLocationClass

    struct IdeLocationClass {
      GObjectClass parent_class;
    };

### IdeLocation

    typedef struct _IdeLocation IdeLocation;

## Property Details

### The `“file”` property

      “file”                     GFile *

The file representing the location.

Owner: IdeLocation

Flags: Read / Write / Construct Only

### The `“line”` property

      “line”                     int

The line number within the file, starting from 0 or -1 for unknown.

Owner: IdeLocation

Flags: Read / Write / Construct Only

Allowed values: >= -1

Default value: -1

### The `“line-offset”` property

      “line-offset”              int

The offset within the line, starting from 0 or -1 for unknown.

Owner: IdeLocation

Flags: Read / Write / Construct Only

Allowed values: >= -1

Default value: -1

### The `“offset”` property

      “offset”                   int

The offset within the file in characters, or -1 if unknown.

Owner: IdeLocation

Flags: Read / Write / Construct Only

Allowed values: >= -1

Default value: -1