rofi
1.6.1
|
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <gmodule.h>
#include <gio/gio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include "mode.h"
#include "helper.h"
#include "mode-private.h"
#include "dialogs/filebrowser.h"
#include "rofi.h"
#include "history.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 | FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" |
Enumerations | |
enum | FBFileType { UP , DIRECTORY , RFILE , NUM_FILE_TYPES } |
Functions | |
static void | free_list (FileBrowserModePrivateData *pd) |
static gint | compare (gconstpointer a, gconstpointer b, G_GNUC_UNUSED gpointer data) |
static void | get_file_browser (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, 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) |
Variables | |
const char * | icon_name [NUM_FILE_TYPES] |
Mode | file_browser_mode |
#define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" |
rofi-file_browser
MIT/X11 License Copyright (c) 2017 Qball Cow qball @gmp clien t.or 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 49 of file filebrowser.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 54 of file filebrowser.c.
|
static |
Definition at line 380 of file filebrowser.c.
References FileBrowserModePrivateData::array, mode_get_private_data(), and FBFile::path.
|
static |
Definition at line 312 of file filebrowser.c.
References FileBrowserModePrivateData::array, FBFile::link, mode_get_private_data(), FBFile::name, FBFile::type, and UP.
|
static |
Definition at line 351 of file filebrowser.c.
References FileBrowserModePrivateData::array, FBFile::icon_fetch_uid, icon_name, mode_get_private_data(), FBFile::path, rofi_icon_fetcher_file_is_image(), rofi_icon_fetcher_get(), rofi_icon_fetcher_query(), and FBFile::type.
|
static |
Definition at line 368 of file filebrowser.c.
References FileBrowserModePrivateData::current_dir, and mode_get_private_data().
|
static |
Definition at line 97 of file filebrowser.c.
References FBFile::name, and FBFile::type.
Referenced by get_file_browser().
|
static |
Definition at line 301 of file filebrowser.c.
References FileBrowserModePrivateData::current_dir, free_list(), mode_get_private_data(), and mode_set_private_data().
|
static |
Definition at line 223 of file filebrowser.c.
References FileBrowserModePrivateData::array_length, and mode_get_private_data().
|
static |
Called on startup when enabled (in modi list)
Definition at line 195 of file filebrowser.c.
References cache_dir, FileBrowserModePrivateData::current_dir, FILEBROWSER_CACHE_FILE, get_file_browser(), mode_get_private_data(), and mode_set_private_data().
|
static |
Definition at line 229 of file filebrowser.c.
References FileBrowserModePrivateData::array, cache_dir, FileBrowserModePrivateData::current_dir, DIRECTORY, FILEBROWSER_CACHE_FILE, free_list(), get_file_browser(), helper_execute_command(), MENU_CUSTOM_INPUT, MENU_ENTRY_DELETE, MENU_LOWER_MASK, MENU_NEXT, MENU_OK, MENU_PREVIOUS, MENU_QUICK_SWITCH, MODE_EXIT, mode_get_private_data(), NEXT_DIALOG, FBFile::path, PREVIOUS_DIALOG, RELOAD_DIALOG, RESET_DIALOG, RFILE, rofi_expand_path(), FBFile::type, and UP.
|
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 343 of file filebrowser.c.
References FileBrowserModePrivateData::array, helper_token_match(), mode_get_private_data(), and FBFile::name.
|
static |
Definition at line 83 of file filebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, FBFile::name, and FBFile::path.
Referenced by file_browser_mode_destroy(), and file_browser_mode_result().
|
static |
Get the entries to display. this gets called on plugin initialization.
Definition at line 108 of file filebrowser.c.
References FileBrowserModePrivateData::array, FileBrowserModePrivateData::array_length, compare(), FileBrowserModePrivateData::current_dir, DIRECTORY, FBFile::icon_fetch_uid, FBFile::link, mode_get_private_data(), FBFile::name, FBFile::path, RFILE, FBFile::type, and UP.
Referenced by file_browser_mode_init(), and file_browser_mode_result().
const char* icon_name[NUM_FILE_TYPES] |
Definition at line 61 of file filebrowser.c.
Referenced by _get_icon().