2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 aoview_fullname (char *dir, char *file)
25 int dlen = strlen (dir);
26 int flen = strlen (file);
29 if (dir[dlen-1] != '/')
31 new = malloc (dlen + slen + flen + 1);
42 aoview_basename(char *file)
46 b = strrchr(file, '/');
53 aoview_mkdir(char *dir)
61 slash = strchr (d, '/');
63 slash = d + strlen(d);
66 part = strndup(dir, slash - dir);
67 if (!access(part, F_OK))
68 if (mkdir(part, 0777) < 0)
77 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width)
79 GtkCellRenderer *renderer;
80 GtkTreeViewColumn *column;
82 renderer = gtk_cell_renderer_text_new ();
83 g_object_set(renderer, "ellipsize", PANGO_ELLIPSIZE_NONE, NULL);
84 g_object_set(renderer, "width-chars", width, NULL);
85 column = gtk_tree_view_column_new_with_attributes (title, renderer,
88 gtk_tree_view_column_set_resizable (column, FALSE);
89 gtk_tree_view_append_column (view, column);