NetSurf
|
#include "assert.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/inttypes.h"
#include "netsurf/core_window.h"
#include "netsurf/plotters.h"
#include "atari/gui.h"
#include "atari/plot/plot.h"
#include "atari/misc.h"
#include "atari/gemtk/gemtk.h"
#include "atari/treeview.h"
#include "atari/res/netsurf.rsh"
Go to the source code of this file.
Data Structures | |
struct | atari_treeview_window |
Functions | |
static void | atari_treeview_redraw_grect_request (struct core_window *cw, GRECT *area) |
Schedule a redraw of the treeview content. More... | |
static bool | atari_treeview_is_iconified (struct core_window *cw) |
static void | atari_treeview_redraw_icon (struct core_window *cw, GRECT *clip) |
static void __CDECL | on_redraw_event (struct core_window *cw, EVMULT_OUT *ev_out, short msg[8]) |
static void __CDECL | on_mbutton_event (struct core_window *cw, EVMULT_OUT *ev_out, short msg[8]) |
static void __CDECL | on_keybd_event (struct core_window *cw, EVMULT_OUT *ev_out, short msg[8]) |
static short | handle_event (GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) |
GEMTK (netsurf's GEM toolkit) event sink. More... | |
static nserror | atari_treeview_invalidate_area (struct core_window *cw, const struct rect *r) |
callback from core to request an invalidation of a window area. More... | |
static nserror | atari_treeview_update_size (struct core_window *cw, int width, int height) |
Update the limits of the window. More... | |
static nserror | atari_treeview_set_scroll (struct core_window *cw, int x, int y) |
Scroll the window to make area visible. More... | |
static nserror | atari_treeview_get_scroll (const struct core_window *cw, int *x, int *y) |
static nserror | atari_treeview_get_window_dimensions (const struct core_window *cw, int *width, int *height) |
Get window viewport dimensions. More... | |
static nserror | atari_treeview_drag_status (struct core_window *cw, core_window_drag_status ds) |
Inform corewindow owner of drag status. More... | |
struct core_window * | atari_treeview_create (GUIWIN *win, struct atari_treeview_callbacks *callbacks, void *user_data, uint32_t flags) |
Initalize an window to be an treeview window. More... | |
void | atari_treeview_get_grect (struct core_window *cw, enum treeview_area_e mode, GRECT *dest) |
Get an specific area inside the window. More... | |
GUIWIN * | atari_treeview_get_gemtk_window (struct core_window *cw) |
Get the window manager window handle. More... | |
void | atari_treeview_redraw (struct core_window *cw) |
Process all pending redraw requests for a single treeview. More... | |
void | atari_treeview_delete (struct core_window *cw) |
Free the Treeview, but not the gemtk window used for the treeview. More... | |
void | atari_treeview_open (struct core_window *cw, GRECT *pos) |
Open the treeview window. More... | |
bool | atari_treeview_is_open (struct core_window *cw) |
Returns the window "open" state. More... | |
void | atari_treeview_set_user_data (struct core_window *cw, void *user_data_ptr) |
Attach arbitary user data to the treeview. More... | |
void * | atari_treeview_get_user_data (struct core_window *cw) |
Return the arbitary user data set by atari_treeview_set_user_data() More... | |
void | atari_treeview_close (struct core_window *cw) |
Closes (hides) the treeview window. More... | |
void | atari_treeview_flush_redraws (void) |
Process all redraw request of all open Treeview windows. More... | |
Variables | |
static struct atari_treeview_window * | treeviews_open |
static struct core_window_table | cw_t |
Declare Core Window Callbacks: More... | |
struct core_window_table * | atari_core_window_table = &cw_t |
void atari_treeview_close | ( | struct core_window * | cw | ) |
Closes (hides) the treeview window.
Definition at line 804 of file treeview.c.
References atari_treeview_window::is_open, atari_treeview_window::next_open, atari_treeview_window::prev_open, treeviews_open, and atari_treeview_window::window.
Referenced by atari_cookie_manager_close(), atari_global_history_close(), and atari_hotlist_close().
struct core_window * atari_treeview_create | ( | GUIWIN * | win, |
struct atari_treeview_callbacks * | callbacks, | ||
void * | user_data, | ||
uint32_t | flags | ||
) |
Initalize an window to be an treeview window.
Definition at line 547 of file treeview.c.
References atari_warn_user(), callbacks, handle_event(), atari_treeview_callbacks::init_phase2, atari_treeview_window::io, messages_get_errorcode(), NSERROR_NOMEM, NSERROR_OK, NSLOG, atari_treeview_window::user_data, and atari_treeview_window::window.
Referenced by atari_cookie_manager_init(), atari_global_history_init(), and atari_hotlist_init().
void atari_treeview_delete | ( | struct core_window * | cw | ) |
Free the Treeview, but not the gemtk window used for the treeview.
Definition at line 740 of file treeview.c.
References atari_treeview_callbacks::finish, and atari_treeview_window::io.
Referenced by atari_cookie_manager_destroy(), atari_global_history_destroy(), and atari_hotlist_destroy().
|
static |
Inform corewindow owner of drag status.
cw | the core window object |
ds | the current drag status |
Definition at line 525 of file treeview.c.
References NSERROR_NOT_IMPLEMENTED.
void atari_treeview_flush_redraws | ( | void | ) |
Process all redraw request of all open Treeview windows.
Definition at line 825 of file treeview.c.
References atari_treeview_is_iconified(), atari_treeview_redraw(), atari_treeview_window::is_open, atari_treeview_window::redraw, and treeviews_open.
Referenced by atari_poll().
GUIWIN * atari_treeview_get_gemtk_window | ( | struct core_window * | cw | ) |
Get the window manager window handle.
Definition at line 619 of file treeview.c.
References atari_treeview_window::window.
Referenced by handle_event().
void atari_treeview_get_grect | ( | struct core_window * | cw, |
enum treeview_area_e | mode, | ||
GRECT * | dest | ||
) |
Get an specific area inside the window.
Definition at line 602 of file treeview.c.
References mode, TREEVIEW_AREA_CONTENT, TREEVIEW_AREA_TOOLBAR, and atari_treeview_window::window.
Referenced by atari_treeview_get_window_dimensions(), atari_treeview_invalidate_area(), atari_treeview_update_size(), handle_event(), and on_redraw_event().
|
static |
Definition at line 487 of file treeview.c.
References NSERROR_NOT_IMPLEMENTED.
void * atari_treeview_get_user_data | ( | struct core_window * | cw | ) |
Return the arbitary user data set by atari_treeview_set_user_data()
Definition at line 796 of file treeview.c.
References atari_treeview_window::user_data.
|
static |
Get window viewport dimensions.
cw | the core window object |
width | to be set to viewport width in px, if non NULL |
height | to be set to viewport height in px, if non NULL |
Definition at line 502 of file treeview.c.
References atari_treeview_get_grect(), height, NSERROR_OK, TREEVIEW_AREA_CONTENT, and width.
|
static |
callback from core to request an invalidation of a window area.
The specified area of the window should now be considered out of date. If the area is NULL the entire window must be invalidated.
[in] | cw | The core window to invalidate. |
[in] | r | area to redraw or NULL for the entire window area. |
Definition at line 391 of file treeview.c.
References atari_treeview_get_grect(), atari_treeview_redraw_grect_request(), NSERROR_OK, RECT_TO_GRECT, TREEVIEW_AREA_CONTENT, atari_treeview_window::window, rect::y0, and rect::y1.
|
static |
Definition at line 107 of file treeview.c.
References atari_treeview_window::window.
Referenced by atari_treeview_flush_redraws(), and on_redraw_event().
bool atari_treeview_is_open | ( | struct core_window * | cw | ) |
Returns the window "open" state.
Definition at line 780 of file treeview.c.
References atari_treeview_window::is_open.
Referenced by atari_cookie_manager_destroy(), atari_cookie_manager_open(), atari_global_history_destroy(), atari_global_history_open(), atari_hotlist_destroy(), and atari_hotlist_open().
void atari_treeview_open | ( | struct core_window * | cw, |
GRECT * | pos | ||
) |
Open the treeview window.
Definition at line 754 of file treeview.c.
References atari_treeview_window::is_open, atari_treeview_window::next_open, atari_treeview_window::prev_open, treeviews_open, and atari_treeview_window::window.
Referenced by atari_cookie_manager_open(), atari_global_history_open(), and atari_hotlist_open().
void atari_treeview_redraw | ( | struct core_window * | cw | ) |
Process all pending redraw requests for a single treeview.
Definition at line 627 of file treeview.c.
References atari_plotters, clip(), atari_treeview_callbacks::draw, redraw_context::interactive, atari_treeview_window::io, atari_treeview_window::is_open, PLOT_FLAG_OFFSCREEN, plot_get_flags(), plot_get_vdi_handle(), plot_lock(), plot_set_dimensions(), plot_unlock(), atari_treeview_window::rdw_area, atari_treeview_window::redraw, and atari_treeview_window::window.
Referenced by atari_cookie_manager_redraw(), atari_global_history_redraw(), atari_hotlist_redraw(), atari_treeview_flush_redraws(), and on_mbutton_event().
|
static |
Schedule a redraw of the treeview content.
Definition at line 57 of file treeview.c.
References MIN, atari_treeview_window::rdw_area, and atari_treeview_window::redraw.
Referenced by atari_treeview_invalidate_area(), and on_redraw_event().
|
static |
Definition at line 115 of file treeview.c.
References atari_treeview_window::window.
Referenced by on_redraw_event().
|
static |
Scroll the window to make area visible.
cw | the core window object |
r | rectangle to make visible |
Definition at line 480 of file treeview.c.
References NSERROR_OK.
void atari_treeview_set_user_data | ( | struct core_window * | cw, |
void * | user_data_ptr | ||
) |
Attach arbitary user data to the treeview.
Definition at line 788 of file treeview.c.
References atari_treeview_window::user_data.
|
static |
Update the limits of the window.
cw | the core window object |
width | the width in px, or negative if don't care |
height | the height in px, or negative if don't care |
Definition at line 430 of file treeview.c.
References atari_treeview_get_grect(), atari_treeview_window::disposing, atari_treeview_window::extent, height, NSERROR_INVALID, NSERROR_OK, TREEVIEW_AREA_CONTENT, width, atari_treeview_window::window, point_s::x, and point_s::y.
|
static |
GEMTK (netsurf's GEM toolkit) event sink.
Definition at line 342 of file treeview.c.
References atari_treeview_callbacks::gemtk_user_func, atari_treeview_window::io, NSLOG, on_keybd_event(), on_mbutton_event(), and on_redraw_event().
Referenced by atari_treeview_create().
|
static |
Definition at line 312 of file treeview.c.
References atari_treeview_window::io, atari_treeview_callbacks::keypress, and nkc_to_input_key().
Referenced by handle_event().
|
static |
Definition at line 204 of file treeview.c.
References s_gem_cursors::arrow, atari_treeview_redraw(), BROWSER_MOUSE_CLICK_1, BROWSER_MOUSE_DOUBLE_CLICK, BROWSER_MOUSE_DRAG_1, BROWSER_MOUSE_DRAG_ON, BROWSER_MOUSE_HOLDING_1, BROWSER_MOUSE_HOVER, BROWSER_MOUSE_PRESS_1, gem_cursors, gem_set_cursor(), s_gem_cursors::hand, atari_treeview_window::io, atari_treeview_callbacks::mouse_action, atari_treeview_window::redraw, atari_treeview_window::startdrag, atari_treeview_window::window, point_s::x, and point_s::y.
Referenced by handle_event().
|
static |
Definition at line 145 of file treeview.c.
References atari_treeview_get_grect(), atari_treeview_is_iconified(), atari_treeview_redraw_grect_request(), atari_treeview_redraw_icon(), clip(), TREEVIEW_AREA_CONTENT, and atari_treeview_window::window.
Referenced by handle_event().
struct core_window_table* atari_core_window_table = &cw_t |
Definition at line 543 of file treeview.c.
Referenced by main().
|
static |
Declare Core Window Callbacks:
Definition at line 534 of file treeview.c.
|
static |
Definition at line 50 of file treeview.c.
Referenced by atari_treeview_close(), atari_treeview_flush_redraws(), and atari_treeview_open().