Trail API Version 1.0

Content

  1. mime (Mime Type Magic)
  2. dnd (Drag & Drop)
  3. format (String Formatting)
  4. gui (Gui Stuff)
    1. icontheme
  5. path
  6. spawner
  7. preview
  8. thumbnail

1. Mime

XDG Mime

Important functions are:

2. dnd (Drag & Drop)

gchar ** stringlist = trail_dnd_get_filename_list(
   GdkDragContext * context,
   GtkSelectionData * dragdata
)

void trail_dnd_set_filename_list(
   GdkDrawContext * context,
   GtkSelectionData * dragdata,
   gchar ** stringlist
)

/* free stringlist with g_strfreev(stringlist) */

3. format (String Formatting)

gchar * trail_format_prettysize(size_t value)

gchar * trail_format_prettydate(time_t time)

gchar * trail_format_dircaption(gchar const * path)

gchar * trail_format_get_file_names_summary_string_v(gchar ** names)

gchar * trail_format_get_file_names_summary_string_list(GList * g)

4. gui (Gui Stuff): icontheme

GdkPixbuf * trail_icontheme_get_themed_icon(
   gchar const * name,
   int width,
   int height
)

GdkPixbuf * trail_icontheme_get_custom_or_themed_icon(
   gchar const * name,
   int width,
   int height,
   gboolean use_fallback
)

GdkPixbuf * trail_icontheme_get_fallback_icon(
   gchar const * name,
   int width,
   int height,
   gboolean use_unknown
)

GdkPixbuf * trail_icontheme_get_themed_or_fallback_icon(
   gchar const * name,
   int width,
   int height,
   gboolean use_unknown
)

5. path

gchar const * trail_path_get_app_short_name()

gchar const * trail_path_get_cache_dir()

gchar const * trail_path_get_glade_dir()

6. spawner

GObject

TrailSpawner * trail_spawner_new(spawner_options_t opts)

typedef enum { SPAWNER_STDERR_JOIN_TO_STDOUT } spawner_options_t

GPid trail_spawner_spawn(
   TrailSpawner* spawner,
   gchar const ** args,
   gchar const * group
)

int trail_spawner_count_running(
   TrailSpawner* spawner,
   gchar const * group
)

int trail_spawner_wexitstatus(TrailSpawner* spawner, int code)

void trail_spawner_kill(TrailSpawner* spawner, GPid pid, signal_t signal)

signals

7. preview

void trail_preview_minimum_aspect_correct_size(
   int source_width,
   int source_height,
   int max_width,
   int max_height,
   int * new_width,
   int * new_height
)

GdkPixbuf * trail_preview_raw(
   GdkPixbuf * source_pixbuf,
   int intended_width,
   int intended_height
)

GdkPixbuf * trail_preview_pad_icon_sized(
   GdkPixbuf * mini_pixbuf,
   int intended_width,
   int intended_height
)

GdkPixbuf * trail_preview_get_icon_sized(
   GdkPixbuf * source_pixbuf,
   int intended_width,
   int intended_height
)

8. thumbnail

TrailThumbnails * trail_thumbnails_new()

void trail_thumbnails_raid(TrailThumbnails * t)

void trail_thumbnails_raid_old(TrailThumbnails * t, int number_of_days)

void trail_thumbnails_generate_thumbnail(
   TrailThumbnails * t,
   gchar const * orig_path,
   int width,
   int height
)

/* width, height = MAX width, height */

void trail_thumbnails_remove_thumbnails_for_dir(gchar const * dir)

Contact

Danny Milosavljevic, Architect