ELinks 0.18.0
|
#include <string.h>
#include "elinks.h"
#include "bfu/dialog.h"
#include "bfu/hierbox.h"
#include "bfu/listbox.h"
#include "bookmarks/bookmarks.h"
#include "bookmarks/dialogs.h"
#include "dialogs/edit.h"
#include "intl/libintl.h"
#include "main/object.h"
#include "protocol/uri.h"
#include "session/session.h"
#include "terminal/terminal.h"
#include "util/conv.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/time.h"
Data Structures | |
struct | bookmark_search_ctx |
Macros | |
#define | _GNU_SOURCE /* XXX: we _WANT_ strcasestr() ! */ |
#define | BOOKMARKS_RESAVE 1 |
#define | NULL_BOOKMARK_SEARCH_CTX {NULL, NULL, 0, 0, -1, -1} |
Enumerations | |
enum | move_bookmark_flags { MOVE_BOOKMARK_NONE = 0x00 , MOVE_BOOKMARK_MOVED = 0x01 , MOVE_BOOKMARK_CYCLE = 0x02 } |
Functions | |
static void | lock_bookmark (struct listbox_item *item) |
static void | unlock_bookmark (struct listbox_item *item) |
static int | is_bookmark_used (struct listbox_item *item) |
static char * | get_bookmark_text (struct listbox_item *item, struct terminal *term) |
static void | add_converted_bytes_to_string (void *data, char *buf, int buflen) |
A callback for convert_string(). | |
static char * | get_bookmark_info (struct listbox_item *item, struct terminal *term) |
static struct uri * | get_bookmark_uri (struct listbox_item *item) |
static struct listbox_item * | get_bookmark_root (struct listbox_item *item) |
static int | can_delete_bookmark (struct listbox_item *item) |
static void | delete_bookmark_item (struct listbox_item *item, int last) |
static widget_handler_status_T | push_add_button (struct dialog_data *dlg_data, struct widget_data *widget_data) |
static void | launch_bm_search_doc_dialog (struct terminal *, struct dialog_data *, struct session *) |
static widget_handler_status_T | push_search_button (struct dialog_data *dlg_data, struct widget_data *widget_data) |
static void | move_bookmark_after_selected (struct bookmark *bookmark, struct bookmark *selected) |
static void | do_add_bookmark (struct terminal *term, struct dialog_data *dlg_data, const char *title, const char *url) |
Add a bookmark; if called from the bookmark manager, also move the bookmark to the right place and select it in the manager. | |
static void | do_add_folder (struct dialog_data *dlg_data, char *foldername) |
Add a bookmark folder. | |
static widget_handler_status_T | push_add_folder_button (struct dialog_data *dlg_data, struct widget_data *widget_data) |
Prepare to add a bookmark folder. | |
static widget_handler_status_T | push_add_separator_button (struct dialog_data *dlg_data, struct widget_data *widget_data) |
Add a bookmark separator. | |
static void | bookmark_edit_done (void *data) |
static void | bookmark_edit_cancel (struct dialog *dlg) |
static widget_handler_status_T | push_edit_button (struct dialog_data *dlg_data, struct widget_data *edit_btn) |
static void | update_depths (struct listbox_item *parent) |
static unsigned int | do_move_bookmark (struct bookmark *dest, int insert_as_child, struct bookmark list *src, struct listbox_data *box) |
static widget_handler_status_T | push_move_button (struct dialog_data *dlg_data, struct widget_data *blah) |
static widget_handler_status_T | push_toggle_display_button (struct dialog_data *dlg_data, struct widget_data *blah) |
struct_hierbox_browser (bookmark_browser, N_("Bookmark manager"), bookmark_buttons, &bookmarks_listbox_ops) | |
void | bookmark_manager (struct session *ses) |
static int | test_search (struct listbox_item *item, void *data_, int *offset) |
void | free_last_searched_bookmark (void) |
static int | memorize_last_searched_bookmark (const char *title, const char *url) |
static void | bookmark_search_do (void *data) |
static void | bookmark_add_add (void *data) |
void | launch_bm_add_dialog (struct terminal *term, struct dialog_data *parent, struct session *ses, char *title, char *url) |
Open a dialog box for adding a bookmark. | |
void | launch_bm_add_doc_dialog (struct terminal *term, struct dialog_data *parent, struct session *ses) |
void | launch_bm_add_link_dialog (struct terminal *term, struct dialog_data *parent, struct session *ses) |
static void | bookmark_terminal_tabs_ok (void *term_void, char *foldername) |
void | bookmark_terminal_tabs_dialog (struct terminal *term) |
Variables | |
static int | with_urls = 0 |
static struct listbox_ops_messages | bookmarks_messages |
static const struct listbox_ops | bookmarks_listbox_ops |
static struct bookmark * | move_cache_root_avoid |
static const struct hierbox_browser_button | bookmark_buttons [] |
static char * | bm_last_searched_title = NULL |
static char * | bm_last_searched_url = NULL |
#define _GNU_SOURCE /* XXX: we _WANT_ strcasestr() ! */ |
#define BOOKMARKS_RESAVE 1 |
enum move_bookmark_flags |
|
static |
A callback for convert_string().
This ignores errors and can result in truncated strings if out of memory. Accordingly, the resulting string may be displayed in the UI but should not be saved to a file or given to another program.
|
static |
|
static |
|
static |
void bookmark_manager | ( | struct session * | ses | ) |
|
static |
void bookmark_terminal_tabs_dialog | ( | struct terminal * | term | ) |
|
static |
|
static |
|
static |
|
static |
Add a bookmark; if called from the bookmark manager, also move the bookmark to the right place and select it in the manager.
And possibly save the bookmarks.
term | The terminal whose user told ELinks to add the bookmark. Currently, term affects only the charset interpretation of title and url. In the future, this function could also display error messages in term. |
dlg_data | The bookmark manager dialog, or NULL if the bookmark is being added without involving the bookmark manager. If dlg_data is not NULL, dlg_data->win->term should be term. |
title | The title of the new bookmark, in the encoding of term. Must not be NULL. "-" means add a separator. |
url | The URL of the new bookmark, in the encoding of term. NULL or "" means add a bookmark folder, unless title is "-". |
|
static |
Add a bookmark folder.
This is called when the user pushes the OK button in the input dialog that asks for the folder name.
dlg_data | The bookmark manager. Must not be NULL. |
foldername | The folder name that the user typed in the input dialog. This is in the charset of the terminal. |
|
static |
void free_last_searched_bookmark | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
void launch_bm_add_dialog | ( | struct terminal * | term, |
struct dialog_data * | parent, | ||
struct session * | ses, | ||
char * | title, | ||
char * | url ) |
Open a dialog box for adding a bookmark.
term | The terminal in which the dialog box should appear. |
parent | The bookmark manager, or NULL if the user requested this action from somewhere else. |
ses | If title or url is NULL, get defaults from the current document of ses. |
title | The initial title of the new bookmark, in the encoding of term. NULL means use ses. |
url | The initial URL of the new bookmark, in the encoding of term. NULL means use ses. |
void launch_bm_add_doc_dialog | ( | struct terminal * | term, |
struct dialog_data * | parent, | ||
struct session * | ses ) |
void launch_bm_add_link_dialog | ( | struct terminal * | term, |
struct dialog_data * | parent, | ||
struct session * | ses ) |
|
static |
|
static |
|
static |
|
static |
|
static |
Prepare to add a bookmark folder.
This is called when the user pushes the "Add folder" button in the bookmark manager.
dlg_data | The bookmark manager. Must not be NULL. |
widget_data | The "Add folder" button. |
|
static |
Add a bookmark separator.
This is called when the user pushes the "Add separator" button in the bookmark manager.
dlg_data | The bookmark manager. Must not be NULL. |
widget_data | The "Add separator" button. |
|
static |
|
static |
|
static |
|
static |
struct_hierbox_browser | ( | bookmark_browser | , |
N_("Bookmark manager") | , | ||
bookmark_buttons | , | ||
& | bookmarks_listbox_ops ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |