|
rofi 2.1.0
|
#include "config.h"#include <errno.h>#include <gio/gio.h>#include <gmodule.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <dirent.h>#include <glib/gstdio.h>#include <sys/stat.h>#include <sys/types.h>#include "display.h"#include "helper.h"#include "history.h"#include "mode-private.h"#include "mode.h"#include "modes/filebrowser.h"#include "rofi.h"#include "theme.h"#include <stdint.h>#include "rofi-icon-fetcher.h"
Go to the source code of this file.
Data Structures | |
| struct | FBFile |
| struct | FileBrowserModePrivateData |
| struct | [struct].file_browser_config |
Macros | |
| #define | FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" |
| #define | DEFAULT_OPEN "xdg-open" |
Enumerations | |
| enum | FBFileType { UP , DIRECTORY , RFILE , NUM_FILE_TYPES } |
| enum | FBSortingMethod { FB_SORT_NAME , FB_SORT_TIME } |
| enum | FBSortingTime { FB_MTIME , FB_ATIME , FB_CTIME } |
Functions | |
| static void | free_list (FileBrowserModePrivateData *pd) |
| static gint | compare_name (gconstpointer a, gconstpointer b, G_GNUC_UNUSED gpointer data) |
| static gint | compare_time (gconstpointer a, gconstpointer b, G_GNUC_UNUSED gpointer data) |
| static gint | compare (gconstpointer a, gconstpointer b, gpointer data) |
| static time_t | get_time (const GStatBuf *statbuf) |
| static void | set_time (FBFile *file) |
| static void | set_collate_key (FBFile *file) |
| static void | fb_resize_array (FileBrowserModePrivateData *pd) |
| static void | get_file_browser (Mode *sw) |
| static void | file_browser_mode_init_config (Mode *sw) |
| static void | file_browser_mode_init_current_dir (Mode *sw) |
| static int | file_browser_mode_init (Mode *sw) |
| static unsigned int | file_browser_mode_get_num_entries (const Mode *sw) |
| static ModeMode | file_browser_mode_result (Mode *sw, int mretv, char **input, unsigned int selected_line) |
| static void | file_browser_mode_destroy (Mode *sw) |
| static char * | _get_display_value (const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry) |
| static int | file_browser_token_match (const Mode *sw, rofi_int_matcher **tokens, unsigned int index) |
| static cairo_surface_t * | _get_icon (const Mode *sw, unsigned int selected_line, unsigned int height) |
| static char * | _get_message (const Mode *sw) |
| static char * | _get_completion (const Mode *sw, unsigned int index) |
| Mode * | create_new_file_browser (void) |
| ModeMode | file_browser_mode_completer (Mode *sw, int mretv, char **input, unsigned int selected_line, char **path) |
Variables | |
| const char * | icon_name [NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"} |
| struct | file_browser_config |
| Mode | file_browser_mode |
| #define DEFAULT_OPEN "xdg-open" |
The default program used to open the file.
Definition at line 55 of file filebrowser.c.
Referenced by file_browser_mode_init_config(), and recursive_browser_mode_init_config().
| #define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" |
rofi-file_browser
MIT/X11 License Copyright (c) 2017 Qball Cow qball.nosp@m.@gmp.nosp@m.clien.nosp@m.t.or.nosp@m.g
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 53 of file filebrowser.c.
Referenced by file_browser_mode_init_current_dir(), and file_browser_mode_result().
| enum FBFileType |
The internal data structure holding the private data of the TEST Mode.
| Enumerator | |
|---|---|
| UP | |
| DIRECTORY | |
| RFILE | |
| NUM_FILE_TYPES | |
Definition at line 66 of file filebrowser.c.
| enum FBSortingMethod |
Possible sorting methods
| Enumerator | |
|---|---|
| FB_SORT_NAME | |
| FB_SORT_TIME | |
Definition at line 76 of file filebrowser.c.
| enum FBSortingTime |
Type of time to sort by
| Enumerator | |
|---|---|
| FB_MTIME | |
| FB_ATIME | |
| FB_CTIME | |
Definition at line 84 of file filebrowser.c.
|
static |
Definition at line 654 of file filebrowser.c.
References _get_completion(), FileBrowserModePrivateData::array, mode_get_private_data(), and FBFile::path.
Referenced by _get_completion(), and _get_completion().


|
static |
Definition at line 582 of file filebrowser.c.
References FileBrowserModePrivateData::array, FBFile::link, mode_get_private_data(), FBFile::name, FBFile::type, and UP.

|
static |
Definition at line 620 of file filebrowser.c.
References FileBrowserModePrivateData::array, display_scale(), FBFile::icon_fetch_scale, FBFile::icon_fetch_size, FBFile::icon_fetch_uid, icon_name, mode_get_private_data(), FBFile::path, RFILE, rofi_icon_fetcher_file_is_image(), rofi_icon_fetcher_get(), rofi_icon_fetcher_query(), and FBFile::type.

|
static |
Definition at line 641 of file filebrowser.c.
References _get_message(), FileBrowserModePrivateData::current_dir, and mode_get_private_data().
Referenced by _get_message(), and _get_message().


|
static |
Definition at line 179 of file filebrowser.c.
References compare(), compare_name(), compare_time(), FB_SORT_NAME, FB_SORT_TIME, and file_browser_config.
Referenced by compare(), and get_file_browser().


|
static |
Definition at line 147 of file filebrowser.c.
References FBFile::collate_key, compare_name(), file_browser_config, and FBFile::type.
Referenced by compare(), and compare_name().


|
static |
Definition at line 159 of file filebrowser.c.
References compare_time(), file_browser_config, FBFile::time, and FBFile::type.
Referenced by compare(), and compare_time().


|
inlinestatic |
Definition at line 233 of file filebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FileBrowserModePrivateData::array_length_real, and fb_resize_array().
Referenced by fb_resize_array(), fb_resize_array(), get_file_browser(), and recursive_browser_async_read_proc().


|
static |
Definition at line 570 of file filebrowser.c.
References FileBrowserModePrivateData::command, FileBrowserModePrivateData::current_dir, file_browser_mode_destroy(), free_list(), mode_get_private_data(), and mode_set_private_data().
Referenced by file_browser_mode_destroy().


|
static |
Definition at line 473 of file filebrowser.c.
References FileBrowserModePrivateData::array_length, file_browser_mode_get_num_entries(), and mode_get_private_data().
Referenced by file_browser_mode_get_num_entries().


|
static |
Called on startup when enabled (in modes list)
Definition at line 457 of file filebrowser.c.
References file_browser_mode_init(), file_browser_mode_init_config(), file_browser_mode_init_current_dir(), get_file_browser(), mode_get_private_data(), and mode_set_private_data().
Referenced by file_browser_mode_init().


|
static |
Definition at line 369 of file filebrowser.c.
References _PropertyValue::b, FileBrowserModePrivateData::command, DEFAULT_OPEN, FB_ATIME, FB_CTIME, FB_MTIME, FB_SORT_NAME, FB_SORT_TIME, file_browser_config, file_browser_mode_init_config(), mode_get_private_data(), rofi_mode::name, P_BOOLEAN, P_STRING, rofi_config_find_widget(), rofi_theme_find_property(), rofi_view_error_dialog(), _PropertyValue::s, Property::type, and Property::value.
Referenced by file_browser_mode_init(), and file_browser_mode_init_config().


|
static |
Definition at line 422 of file filebrowser.c.
References cache_dir, FileBrowserModePrivateData::current_dir, file_browser_mode_init_current_dir(), FILEBROWSER_CACHE_FILE, mode_get_private_data(), rofi_mode::name, P_STRING, rofi_config_find_widget(), rofi_theme_find_property(), _PropertyValue::s, Property::type, and Property::value.
Referenced by file_browser_mode_init(), and file_browser_mode_init_current_dir().


|
static |
Definition at line 479 of file filebrowser.c.
References FileBrowserModePrivateData::array, _PropertyValue::b, cache_dir, FileBrowserModePrivateData::command, FileBrowserModePrivateData::current_dir, DIRECTORY, file_browser_config, file_browser_mode_result(), FILEBROWSER_CACHE_FILE, free_list(), get_file_browser(), helper_execute_command(), MENU_CANCEL, MENU_CUSTOM_ACTION, MENU_CUSTOM_COMMAND, MENU_CUSTOM_INPUT, MENU_ENTRY_DELETE, MENU_LOWER_MASK, MENU_OK, MODE_EXIT, mode_get_private_data(), rofi_mode::name, P_BOOLEAN, FBFile::path, RELOAD_DIALOG, RESET_DIALOG, RFILE, rofi_config_find_widget(), rofi_expand_path(), rofi_set_return_code(), rofi_theme_find_property(), FBFile::type, Property::type, UP, and Property::value.
Referenced by file_browser_mode_result().


|
static |
| sw | The mode object. |
| tokens | The tokens to match against. |
| index | The index in this plugin to match against. |
Match the entry.
Definition at line 611 of file filebrowser.c.
References FileBrowserModePrivateData::array, file_browser_token_match(), helper_token_match(), mode_get_private_data(), and FBFile::name.
Referenced by file_browser_token_match().


|
static |
Definition at line 132 of file filebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FileBrowserModePrivateData::array_length_real, FBFile::collate_key, free_list(), FBFile::name, and FBFile::path.
Referenced by file_browser_mode_completer(), file_browser_mode_destroy(), file_browser_mode_result(), free_list(), free_list(), and recursive_browser_mode_destroy().


|
static |
Get the entries to display. this gets called on plugin initialization.
Definition at line 241 of file filebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FBFile::collate_key, compare(), FileBrowserModePrivateData::current_dir, DIRECTORY, fb_resize_array(), FB_SORT_NAME, FB_SORT_TIME, file_browser_config, get_file_browser(), get_time(), FBFile::icon_fetch_scale, FBFile::icon_fetch_size, FBFile::icon_fetch_uid, FBFile::link, mode_get_private_data(), FBFile::name, FBFile::path, RFILE, rofi_force_utf8(), set_collate_key(), set_time(), FBFile::time, FBFile::type, and UP.
Referenced by file_browser_mode_completer(), file_browser_mode_init(), file_browser_mode_result(), and get_file_browser().


|
static |
Definition at line 197 of file filebrowser.c.
References FB_ATIME, FB_CTIME, FB_MTIME, file_browser_config, and get_time().
Referenced by get_file_browser(), get_time(), and set_time().


|
static |
Definition at line 229 of file filebrowser.c.
References FBFile::collate_key, FBFile::name, and set_collate_key().
Referenced by get_file_browser(), and set_collate_key().


|
static |
Definition at line 210 of file filebrowser.c.
References get_time(), FBFile::path, set_time(), and FBFile::time.
Referenced by get_file_browser(), and set_time().


| struct [struct].file_browser_config file_browser_config |
Referenced by compare(), compare_name(), compare_time(), file_browser_mode_completer(), file_browser_mode_init_config(), file_browser_mode_result(), get_file_browser(), and get_time().
| const char* icon_name[NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"} |
Icons to use for the file type
Definition at line 91 of file filebrowser.c.
Referenced by _get_icon(), and script_mode_free_entry_list().