## gedit-utils

gedit-utils

## Functions

gboolean | gedit_utils_menu_position_under_tree_view ()
void | gedit_utils_set_atk_name_description ()
gchar * | gedit_utils_basename_for_display ()
gchar ** | gedit_utils_drop_get_uris ()
GtkSourceCompressionType | gedit_utils_get_compression_type_from_content_type ()
gboolean | gedit_utils_is_valid_location ()
gchar * | gedit_utils_location_get_dirname_for_display ()
gchar * | gedit_utils_set_direct_save_filename ()
const gchar * | gedit_utils_newline_type_to_string ()
void | gedit_warning ()
gboolean | gedit_utils_decode_uri ()

## Description

## Functions

### gedit_utils_menu_position_under_tree_view ()

    gboolean
    gedit_utils_menu_position_under_tree_view
                                   (GtkTreeView *tree_view,
                                    GdkRectangle *rect);

### gedit_utils_set_atk_name_description ()

    void
    gedit_utils_set_atk_name_description (GtkWidget *widget,
                                          const gchar *name,
                                          const gchar *description);

This function sets up name and description for a specified gtk widget.

#### Parameters

widget | The Gtk widget for which name/description to be set |
name | Atk name string |
description | Atk description string |

### gedit_utils_basename_for_display ()

    gchar *
    gedit_utils_basename_for_display (GFile *location);

#### Parameters

location | location for which the basename should be displayed |

#### Returns

the basename of a file suitable for display to users.

[transfer full]

### gedit_utils_drop_get_uris ()

    gchar **
    gedit_utils_drop_get_uris (GtkSelectionData *selection_data);

Create a list of valid uri's from a uri-list drop.

#### Parameters

selection_data | the GtkSelectionData from drag_data_received |

#### Returns

a string array which will hold the uris or `NULL` if there were no valid uris. g_strfreev should be used when the string array is no longer used.

[transfer full]

### gedit_utils_get_compression_type_from_content_type ()

    GtkSourceCompressionType
    gedit_utils_get_compression_type_from_content_type
                                   (const gchar *content_type);

### gedit_utils_is_valid_location ()

    gboolean
    gedit_utils_is_valid_location (GFile *location);

### gedit_utils_location_get_dirname_for_display ()

    gchar *
    gedit_utils_location_get_dirname_for_display
                                   (GFile *location);

Returns a string suitable to be displayed in the UI indicating the name of the directory where the file is located. For remote files it may also contain the hostname etc. For local files it tries to replace the home dir with ~.

#### Parameters

location | the location |

#### Returns

a string to display the dirname.

[transfer full]

### gedit_utils_set_direct_save_filename ()

    gchar *
    gedit_utils_set_direct_save_filename (GdkDragContext *context);

### gedit_utils_newline_type_to_string ()

    const gchar *
    gedit_utils_newline_type_to_string (GtkSourceNewlineType newline_type);

### gedit_warning ()

    void
    gedit_warning (GtkWindow *parent,
                   const gchar *format,
                   ...);

`gedit_warning` has been deprecated since version 3.38 and should not be used in newly-written code.

Use `tepl_utils_show_warning_dialog()` instead.

### gedit_utils_decode_uri ()

    gboolean
    gedit_utils_decode_uri (const gchar *uri,
                            gchar **scheme,
                            gchar **user,
                            gchar **host,
                            gchar **port,
                            gchar **path);

`gedit_utils_decode_uri` has been deprecated since version 3.38 and should not be used in newly-written code.

Use `tepl_utils_decode_uri()` instead.

Parse and break an uri apart in its individual components like the uri scheme, user info, port, host and path. The return value pointer can be `NULL` to ignore certain parts of the uri. If the function returns `TRUE`, then all return value pointers should be freed using g_free

#### Parameters

uri | the uri to decode |
scheme | return value pointer for the uri's scheme (e.g. http, sftp, ...), or `NULL`. | [out][allow-none]
user | return value pointer for the uri user info, or `NULL`. | [out][allow-none]
port | return value pointer for the uri port, or `NULL`. | [out][allow-none]
host | return value pointer for the uri host, or `NULL`. | [out][allow-none]
path | return value pointer for the uri path, or `NULL`. | [out][allow-none]

#### Returns

`TRUE` if the uri could be properly decoded, `FALSE` otherwise.