2004-12-09 13:30:44 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net>
|
2010-10-05 23:14:46 +04:00
|
|
|
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
|
2007-08-08 20:16:03 +04:00
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf 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; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf 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, see <http://www.gnu.org/licenses/>.
|
2004-12-09 13:30:44 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
2013-09-03 01:58:18 +04:00
|
|
|
* deprecated compatibility layer for new treeview modules. Do not use.
|
2004-12-09 13:30:44 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_DESKTOP_TREE_H_
|
|
|
|
#define _NETSURF_DESKTOP_TREE_H_
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2006-07-13 16:46:02 +04:00
|
|
|
#include <stdint.h>
|
2006-04-10 03:21:13 +04:00
|
|
|
|
2014-02-04 19:19:24 +04:00
|
|
|
#include "desktop/mouse.h"
|
2010-10-05 23:14:46 +04:00
|
|
|
|
2013-08-12 13:32:54 +04:00
|
|
|
struct sslcert_session_data;
|
2014-02-04 19:19:24 +04:00
|
|
|
struct tree;
|
|
|
|
struct redraw_context;
|
2013-08-18 20:17:41 +04:00
|
|
|
|
|
|
|
extern struct sslcert_session_data *ssl_current_session;
|
|
|
|
extern const char *tree_hotlist_path;
|
2013-08-12 13:32:54 +04:00
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/* Tree flags */
|
|
|
|
enum tree_flags {
|
2013-09-02 19:19:16 +04:00
|
|
|
TREE_HISTORY,
|
|
|
|
TREE_COOKIES,
|
|
|
|
TREE_SSLCERT,
|
|
|
|
TREE_HOTLIST
|
2004-12-09 13:30:44 +03:00
|
|
|
};
|
|
|
|
|
2010-10-29 21:40:36 +04:00
|
|
|
typedef enum {
|
|
|
|
TREE_NO_DRAG = 0,
|
|
|
|
TREE_SELECT_DRAG,
|
2010-10-30 14:43:14 +04:00
|
|
|
TREE_MOVE_DRAG,
|
2010-12-19 15:27:33 +03:00
|
|
|
TREE_TEXTAREA_DRAG, /** < A drag that is passed to a textarea */
|
2010-10-30 14:43:14 +04:00
|
|
|
TREE_UNKNOWN_DRAG /** < A drag the tree itself won't handle */
|
2010-10-29 21:40:36 +04:00
|
|
|
} tree_drag_type;
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
/** callbacks to perform necessary operations on treeview. */
|
|
|
|
struct treeview_table {
|
|
|
|
void (*redraw_request)(int x, int y, int width, int height,
|
|
|
|
void *data); /**< request a redraw. */
|
|
|
|
void (*resized)(struct tree *tree, int width, int height,
|
|
|
|
void *data); /**< resize treeview area. */
|
|
|
|
void (*scroll_visible)(int y, int height, void *data); /**< scroll visible treeview area. */
|
|
|
|
void (*get_window_dimensions)(int *width, int *height, void *data); /**< get dimensions of window */
|
2004-12-09 13:30:44 +03:00
|
|
|
};
|
|
|
|
|
2010-10-05 23:14:46 +04:00
|
|
|
struct tree *tree_create(unsigned int flags,
|
|
|
|
const struct treeview_table *callbacks,
|
|
|
|
void *client_data);
|
2013-05-04 00:17:11 +04:00
|
|
|
|
2013-09-03 01:58:18 +04:00
|
|
|
/** deprecated compatibility layer for new treeview modules. Do not use. */
|
2010-10-05 23:14:46 +04:00
|
|
|
void tree_delete(struct tree *tree);
|
2010-10-29 21:40:36 +04:00
|
|
|
tree_drag_type tree_drag_status(struct tree *tree);
|
2010-10-05 23:14:46 +04:00
|
|
|
void tree_draw(struct tree *tree, int x, int y,
|
2011-06-30 19:48:07 +04:00
|
|
|
int clip_x, int clip_y, int clip_width, int clip_height,
|
|
|
|
const struct redraw_context *ctx);
|
2010-10-05 23:14:46 +04:00
|
|
|
bool tree_mouse_action(struct tree *tree, browser_mouse_state mouse,
|
|
|
|
int x, int y);
|
|
|
|
void tree_drag_end(struct tree *tree, browser_mouse_state mouse, int x0, int y0,
|
|
|
|
int x1, int y1);
|
|
|
|
bool tree_keypress(struct tree *tree, uint32_t key);
|
2010-12-19 15:27:33 +03:00
|
|
|
|
|
|
|
|
2004-12-09 13:30:44 +03:00
|
|
|
#endif
|