1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
/*
* baobab.h
* This file is part of baobab
*
* Copyright (C) 2005-2006 Fabio Marzocca <thesaltydog@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef __BAOBAB_H__
#define __BAOBAB_H__
#include <time.h>
#include <sys/types.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glade/glade-xml.h>
#include <gconf/gconf-client.h>
typedef struct _baobab_application baobab_application;
typedef struct _baobab_fs baobab_fs;
struct BaobabSearchOpt;
#define BAOBAB_GLADE_FILE BAOBAB_PIX_DIR "baobab.glade"
#define VIEW_TREE 0
#define VIEW_SEARCH 1
#define BAOBAB_KEY_DIR "/apps/baobab"
#define BAOBAB_TOOLBAR_VISIBLE_KEY BAOBAB_KEY_DIR "/ui/toolbar_visible"
#define BAOBAB_STATUSBAR_VISIBLE_KEY BAOBAB_KEY_DIR "/ui/statusbar_visible"
#define PROPS_SCAN_KEY BAOBAB_KEY_DIR "/properties/noscan"
#define PROPS_ENABLE_HOME_MONITOR BAOBAB_KEY_DIR "/properties/enable_home_monitor"
#define SYSTEM_TOOLBAR_STYLE "/desktop/gnome/interface/toolbar_style"
struct _baobab_application {
GladeXML *main_xml;
GtkWidget *window;
GtkWidget *tree_view;
GtkWidget *tree_search;
GtkTreeStore *model;
GtkListStore *model_search;
GtkTreeStore *search_model;
gboolean STOP_SCANNING;
GdkPixbuf *green_bar,*yellow_bar,*red_bar;
gboolean CONTENTS_CHANGED_DELAYED;
GSList *bbExcludedDirs;
gboolean bbEnableHomeMonitor;
gchar *label_scan;
gchar *label_search;
GString *last_scan_command;
gint number_found_files;
guint64 size_found_files;
gboolean show_allocated;
gboolean is_local;
char *selected_path;
GConfClient *gconf_client;
};
struct _baobab_fs {
guint64 total;
guint64 used;
guint64 avail;
};
struct chan_data {
guint64 size;
guint64 alloc_size;
guint64 tempHLsize;
guint depth;
gint elements;
gchar *dir;
};
struct BaobabSearchRet {
guint64 size;
guint64 alloc_size;
gchar *fullpath;
time_t lastacc;
uid_t owner;
gchar *mime_type;
};
/* Advanced search options enums */
enum {
NONE = 1,
LAST_WEEK = 2,
LAST_MONTH = 3,
SIZE_SMALL = 2,
SIZE_MEDIUM = 3
};
struct BaobabSearchOpt {
GString *filename;
GString *dir;
gint mod_date;
gint size_limit;
gboolean dont_recurse_dir;
gboolean exact;
gboolean search_whole;
};
/* globals */
baobab_application baobab;
baobab_fs g_fs;
struct BaobabSearchOpt bbSearchOpt;
void set_busy (gboolean busy);
void start_proc_on_dir (const gchar *);
void fill_model (struct chan_data *);
void start_search (const gchar *, const gchar *);
void fill_search_model (struct BaobabSearchRet *);
void first_row (void);
gint list_find (gconstpointer a, gconstpointer b);
gboolean is_excluded_dir (const gchar *);
void set_toolbar_visible (gboolean visible);
void set_statusbar_visible (gboolean visible);
#endif /* __BAOBAB_H_ */
|