2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-18 19:21:30 +00:00
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-18 19:21:30 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup spfile
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2009-03-12 19:36:59 +00:00
|
|
|
/* XXX could become UserPref */
|
|
|
|
#define FSMENU_RECENT_MAX 10
|
|
|
|
|
2015-02-11 00:09:45 +01:00
|
|
|
enum FSMenuCategory;
|
|
|
|
enum FSMenuInsert;
|
2012-09-17 02:01:09 +00:00
|
|
|
|
2009-03-12 19:36:59 +00:00
|
|
|
struct FSMenu;
|
2015-02-11 00:09:45 +01:00
|
|
|
struct FSMenuEntry;
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2019-11-25 01:14:39 +11:00
|
|
|
/**
|
|
|
|
* Inserts a new fsmenu entry with the given \a path.
|
2012-06-18 13:01:24 +00:00
|
|
|
* Duplicate entries are not added.
|
2018-12-12 12:50:58 +11:00
|
|
|
* \param flag: Options for inserting the entry.
|
2012-06-18 13:01:24 +00:00
|
|
|
*/
|
2015-02-11 00:09:45 +01:00
|
|
|
void fsmenu_insert_entry(struct FSMenu *fsmenu,
|
|
|
|
enum FSMenuCategory category,
|
|
|
|
const char *path,
|
|
|
|
const char *name,
|
2020-01-29 10:20:30 -08:00
|
|
|
int icon,
|
2015-02-11 00:09:45 +01:00
|
|
|
const enum FSMenuInsert flag);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2015-02-16 15:48:37 +01:00
|
|
|
/** Refresh 'valid' status of given menu entry */
|
|
|
|
void fsmenu_entry_refresh_valid(struct FSMenuEntry *fsentry);
|
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** Return whether the entry was created by the user and can be saved and deleted */
|
2020-09-04 20:59:13 +02:00
|
|
|
short fsmenu_can_save(struct FSMenu *fsmenu, enum FSMenuCategory category, int idx);
|
2009-06-29 23:21:11 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** Removes the fsmenu entry at the given \a index. */
|
2020-09-04 20:59:13 +02:00
|
|
|
void fsmenu_remove_entry(struct FSMenu *fsmenu, enum FSMenuCategory category, int idx);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** saves the 'bookmarks' to the specified file */
|
|
|
|
void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** reads the 'bookmarks' from the specified file */
|
|
|
|
void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename);
|
2010-07-04 15:35:23 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** adds system specific directories */
|
|
|
|
void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** Free's all the memory associated with the fsmenu */
|
2013-12-20 17:39:22 +01:00
|
|
|
void fsmenu_free(void);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
/** Refresh system directory menu */
|
|
|
|
void fsmenu_refresh_system_category(struct FSMenu *fsmenu);
|
2012-05-18 12:49:25 +00:00
|
|
|
|
2015-02-16 15:48:37 +01:00
|
|
|
/** Refresh 'valid' status of all menu entries */
|
2019-05-15 16:20:14 +02:00
|
|
|
void fsmenu_refresh_bookmarks_status(struct wmWindowManager *wm, struct FSMenu *fsmenu);
|
2015-02-16 15:48:37 +01:00
|
|
|
|
2015-02-11 00:09:45 +01:00
|
|
|
/** Get active index based on given directory. */
|
|
|
|
int fsmenu_get_active_indices(struct FSMenu *fsmenu,
|
|
|
|
enum FSMenuCategory category,
|
|
|
|
const char *dir);
|