rofi 1.7.9
|
#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-unix.h>
#include <glib/gstdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "helper.h"
#include "history.h"
#include "mode-private.h"
#include "mode.h"
#include "modes/recursivebrowser.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 |
Macros | |
#define | G_LOG_DOMAIN "Modes.RecursiveBrowser" |
#define | DEFAULT_OPEN "xdg-open" |
Enumerations | |
enum | FBFileType { UP , DIRECTORY , RFILE , NUM_FILE_TYPES } |
Functions | |
static void | free_list (FileBrowserModePrivateData *pd) |
static void | fb_resize_array (FileBrowserModePrivateData *pd) |
static void | recursive_browser_mode_init_config (Mode *sw) |
static void | recursive_browser_mode_init_current_dir (Mode *sw) |
static void | scan_dir (FileBrowserModePrivateData *pd, GFile *path) |
static gpointer | recursive_browser_input_thread (gpointer userdata) |
static gboolean | recursive_browser_async_read_proc (gint fd, GIOCondition condition, gpointer user_data) |
static int | recursive_browser_mode_init (Mode *sw) |
static unsigned int | recursive_browser_mode_get_num_entries (const Mode *sw) |
static ModeMode | recursive_browser_mode_result (Mode *sw, int mretv, G_GNUC_UNUSED char **input, unsigned int selected_line) |
static void | recursive_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 | recursive_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_recursive_browser (void) |
ModeMode | recursive_browser_mode_completer (Mode *sw, int mretv, char **input, unsigned int selected_line, char **path) |
Variables | |
const char * | rb_icon_name [NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"} |
Mode | recursive_browser_mode |
#define DEFAULT_OPEN "xdg-open" |
The default program used to open the file.
Definition at line 56 of file recursivebrowser.c.
#define G_LOG_DOMAIN "Modes.RecursiveBrowser" |
rofi-recursive_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 26 of file recursivebrowser.c.
enum FBFileType |
The internal data structure holding the private data of the TEST Mode.
Enumerator | |
---|---|
UP | |
DIRECTORY | |
RFILE | |
NUM_FILE_TYPES |
Definition at line 61 of file recursivebrowser.c.
|
static |
Definition at line 525 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, mode_get_private_data(), and FBFile::path.
|
static |
Definition at line 453 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, FBFile::link, mode_get_private_data(), FBFile::name, FBFile::type, and UP.
|
static |
Definition at line 492 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, FBFile::icon_fetch_size, FBFile::icon_fetch_uid, mode_get_private_data(), FBFile::path, rb_icon_name, RFILE, rofi_icon_fetcher_file_is_image(), rofi_icon_fetcher_get(), rofi_icon_fetcher_query(), and FBFile::type.
|
static |
Definition at line 512 of file recursivebrowser.c.
References FileBrowserModePrivateData::current_dir, and mode_get_private_data().
|
inlinestatic |
Definition at line 110 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, and FileBrowserModePrivateData::array_length_real.
Referenced by recursive_browser_async_read_proc().
|
static |
Definition at line 96 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FileBrowserModePrivateData::array_length_real, FBFile::name, and FBFile::path.
Referenced by recursive_browser_mode_destroy().
|
static |
Definition at line 323 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FileBrowserModePrivateData::async_queue, fb_resize_array(), FileBrowserModePrivateData::loading, and rofi_view_reload().
Referenced by recursive_browser_mode_init().
|
static |
Definition at line 311 of file recursivebrowser.c.
References FileBrowserModePrivateData::current_dir, FileBrowserModePrivateData::pipefd2, and scan_dir().
Referenced by recursive_browser_mode_init().
|
static |
Definition at line 434 of file recursivebrowser.c.
References FileBrowserModePrivateData::command, FileBrowserModePrivateData::current_dir, FileBrowserModePrivateData::end_thread, FileBrowserModePrivateData::filter_regex, free_list(), mode_get_private_data(), mode_set_private_data(), and FileBrowserModePrivateData::reading_thread.
|
static |
Definition at line 387 of file recursivebrowser.c.
References FileBrowserModePrivateData::array_length, and mode_get_private_data().
|
static |
Called on startup when enabled (in modes list)
Definition at line 360 of file recursivebrowser.c.
References FileBrowserModePrivateData::async_queue, FileBrowserModePrivateData::end_thread, FileBrowserModePrivateData::loading, mode_get_private_data(), mode_set_private_data(), FileBrowserModePrivateData::pipefd2, FileBrowserModePrivateData::reading_thread, recursive_browser_async_read_proc(), recursive_browser_input_thread(), recursive_browser_mode_init_config(), recursive_browser_mode_init_current_dir(), and FileBrowserModePrivateData::wake_source.
|
static |
Definition at line 118 of file recursivebrowser.c.
References _PropertyValue::b, FileBrowserModePrivateData::command, DEFAULT_OPEN, FileBrowserModePrivateData::filter_regex, mode_get_private_data(), rofi_mode::name, P_BOOLEAN, P_STRING, rofi_config_find_widget(), rofi_set_return_code(), rofi_theme_find_property(), rofi_view_error_dialog(), _PropertyValue::s, Property::type, and Property::value.
Referenced by recursive_browser_mode_init().
|
static |
Definition at line 161 of file recursivebrowser.c.
References FileBrowserModePrivateData::current_dir, 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 recursive_browser_mode_init().
|
static |
Definition at line 393 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, _PropertyValue::b, FileBrowserModePrivateData::command, FileBrowserModePrivateData::current_dir, helper_execute_command(), MENU_CANCEL, 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, RFILE, rofi_config_find_widget(), rofi_set_return_code(), rofi_theme_find_property(), FBFile::type, Property::type, and Property::value.
|
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 482 of file recursivebrowser.c.
References FileBrowserModePrivateData::array, helper_token_match(), mode_get_private_data(), and FBFile::name.
|
static |
Definition at line 180 of file recursivebrowser.c.
References FileBrowserModePrivateData::async_queue, DIRECTORY, FileBrowserModePrivateData::end_thread, FileBrowserModePrivateData::filter_regex, FBFile::icon_fetch_size, FBFile::icon_fetch_uid, FBFile::link, FBFile::name, FBFile::path, FileBrowserModePrivateData::pipefd2, RFILE, rofi_force_utf8(), and FBFile::type.
Referenced by recursive_browser_input_thread().
const char* rb_icon_name[NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"} |
Icons to use for the file type
Definition at line 69 of file recursivebrowser.c.
Referenced by _get_icon().