NetSurf
|
Implementation of Amiga global history viewer using core windows. More...
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <proto/asl.h>
#include <proto/dos.h>
#include <proto/intuition.h>
#include <classes/window.h>
#include <gadgets/layout.h>
#include <gadgets/space.h>
#include <reaction/reaction_macros.h>
#include "desktop/global_history.h"
#include "netsurf/browser_window.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "amiga/corewindow.h"
#include "amiga/drag.h"
#include "amiga/file.h"
#include "amiga/history.h"
#include "amiga/libs.h"
#include "amiga/menu.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
Go to the source code of this file.
Data Structures | |
struct | ami_history_global_window |
Amiga history viewer window context. More... | |
Functions | |
static void | ami_history_global_menu_free (struct ami_history_global_window *history_win) |
static void | ami_history_global_destroy (struct ami_corewindow *ami_cw) |
destroy a previously created history view More... | |
static nserror | ami_history_global_mouse (struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse action for history viewer on core window More... | |
static nserror | ami_history_global_key (struct ami_corewindow *ami_cw, uint32_t nskey) |
callback for keypress for history viewer on core window More... | |
static nserror | ami_history_global_draw (struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx) |
callback on draw event for history viewer on core window More... | |
static nserror | ami_history_global_drag_end (struct ami_corewindow *ami_cw, int x, int y) |
callback on drag end for history viewer More... | |
HOOKF (void, ami_history_global_menu_item_project_export, APTR, window, struct IntuiMessage *) | |
menu stuff More... | |
HOOKF (void, ami_history_global_menu_item_project_expand_all, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_expand_folders, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_expand_links, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_collapse_all, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_collapse_folders, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_collapse_links, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_snapshot, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_project_close, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_edit_select_all, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_edit_clear, APTR, window, struct IntuiMessage *) | |
HOOKF (void, ami_history_global_menu_item_edit_delete, APTR, window, struct IntuiMessage *) | |
static void | ami_history_global_menulabs (struct ami_menu_data **md) |
static struct Menu * | ami_history_global_menu_create (struct ami_history_global_window *history_win) |
static nserror | ami_history_global_create_window (struct ami_history_global_window *history_win) |
nserror | ami_history_global_present (void) |
Open the global history viewer. More... | |
Variables | |
static struct ami_history_global_window * | history_window = NULL |
Implementation of Amiga global history viewer using core windows.
Definition in file history.c.
anonymous enum |
|
static |
Definition at line 365 of file history.c.
References ami_gui_get_screen(), ami_gui_get_screen_title(), ami_gui_get_shared_msgport(), ami_history_global_menu_create(), BVS_DISPLAY, ami_history_global_window::core, GID_CW_DRAW, GID_CW_MAIN, GID_CW_WIN, IDCMP_EXTENDEDMOUSE, ami_corewindow::idcmp_hook, LayoutVObj, NSERROR_NOMEM, NSERROR_OK, nsoption_bool, nsoption_int, ami_corewindow::objects, SpaceObj, WindowObj, and ami_corewindow::wintitle.
Referenced by ami_history_global_present().
|
static |
destroy a previously created history view
Definition at line 110 of file history.c.
References ami_corewindow_fini(), ami_history_global_menu_free(), ami_history_global_window::core, global_history_fini(), history_window, and NSERROR_OK.
Referenced by ami_history_global_present().
|
static |
callback on drag end for history viewer
ami_cw | The Amiga core window structure. |
x | mouse x co-ordinate |
y | mouse y co-ordinate |
Definition at line 190 of file history.c.
References ami_gui2_get_browser_window(), ami_gui_beep(), ami_window_at_pointer(), AMINS_COREWINDOW, AMINS_WINDOW, browser_window_navigate(), BW_NAVIGATE_HISTORY, global_history_get_selection(), global_history_has_selection(), ami_corewindow::icon_drop, and NSERROR_OK.
Referenced by ami_history_global_present().
|
static |
callback on draw event for history viewer on core window
ami_cw | The Amiga core window structure. |
x | The x coordinate of global history area to redraw |
y | The y coordinate of global history area to redraw |
r | The rectangle of the window that needs updating. |
ctx | The drawing context |
Definition at line 172 of file history.c.
References global_history_redraw(), and NSERROR_OK.
Referenced by ami_history_global_present().
|
static |
callback for keypress for history viewer on core window
ami_cw | The Amiga core window structure. |
nskey | The netsurf key code |
Definition at line 153 of file history.c.
References global_history_keypress(), NSERROR_NOT_IMPLEMENTED, and NSERROR_OK.
Referenced by ami_history_global_present().
|
static |
Definition at line 354 of file history.c.
References ami_history_global_menulabs(), AMI_HISTORY_M_LAST, ami_menu_layout(), ami_history_global_window::imenu, and ami_history_global_window::menu_data.
Referenced by ami_history_global_create_window().
|
static |
Definition at line 97 of file history.c.
References AMI_HISTORY_M_LAST, ami_menu_free_menu(), ami_history_global_window::core, GID_CW_WIN, ami_history_global_window::imenu, ami_history_global_window::menu_data, and ami_corewindow::objects.
Referenced by ami_history_global_destroy().
|
static |
Definition at line 314 of file history.c.
References AMI_HISTORY_M_BAR_E1, AMI_HISTORY_M_BAR_P1, AMI_HISTORY_M_BAR_P2, AMI_HISTORY_M_BAR_P3, AMI_HISTORY_M_CLEAR, AMI_HISTORY_M_CLOSE, AMI_HISTORY_M_COLLAPSE, AMI_HISTORY_M_COLLAPSE_ALL, AMI_HISTORY_M_COLLAPSE_FOLDERS, AMI_HISTORY_M_COLLAPSE_LINKS, AMI_HISTORY_M_DELETE, AMI_HISTORY_M_EDIT, AMI_HISTORY_M_EXPAND, AMI_HISTORY_M_EXPAND_ALL, AMI_HISTORY_M_EXPAND_FOLDERS, AMI_HISTORY_M_EXPAND_LINKS, AMI_HISTORY_M_EXPORT, AMI_HISTORY_M_LAST, AMI_HISTORY_M_PROJECT, AMI_HISTORY_M_SELECTALL, AMI_HISTORY_M_SNAPSHOT, ami_menu_alloc_item(), and NSA_SPACE.
Referenced by ami_history_global_menu_create().
|
static |
callback for mouse action for history viewer on core window
ami_cw | The Amiga core window structure. |
mouse_state | netsurf mouse state on event |
x | location of event |
y | location of event |
Definition at line 136 of file history.c.
References global_history_mouse_action(), and NSERROR_OK.
Referenced by ami_history_global_present().
nserror ami_history_global_present | ( | void | ) |
Open the global history viewer.
Definition at line 422 of file history.c.
References ami_corewindow_init(), ami_history_global_create_window(), ami_history_global_destroy(), ami_history_global_drag_end(), ami_history_global_draw(), ami_history_global_key(), ami_history_global_mouse(), ami_utf8_easy(), ami_utf8_free(), ami_corewindow::close, ami_history_global_window::core, ami_corewindow::drag_end, ami_corewindow::draw, ami_corewindow::event, GID_CW_WIN, global_history_init(), history_window, ami_corewindow::icon_drop, ami_corewindow::key, messages_get(), ami_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, ami_corewindow::objects, and ami_corewindow::wintitle.
Referenced by HOOKF().
HOOKF | ( | void | , |
ami_history_global_menu_item_edit_clear | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 301 of file history.c.
References global_history_keypress(), and NS_KEY_CLEAR_SELECTION.
HOOKF | ( | void | , |
ami_history_global_menu_item_edit_delete | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 306 of file history.c.
References global_history_keypress(), and NS_KEY_DELETE_LEFT.
HOOKF | ( | void | , |
ami_history_global_menu_item_edit_select_all | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 296 of file history.c.
References global_history_keypress(), and NS_KEY_SELECT_ALL.
HOOKF | ( | void | , |
ami_history_global_menu_item_project_close | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 288 of file history.c.
References ami_corewindow::close_window.
HOOKF | ( | void | , |
ami_history_global_menu_item_project_collapse_all | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 262 of file history.c.
References global_history_contract().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_collapse_folders | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 267 of file history.c.
References global_history_contract().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_collapse_links | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 272 of file history.c.
References global_history_contract().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_expand_all | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 247 of file history.c.
References global_history_expand().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_expand_folders | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 252 of file history.c.
References global_history_expand().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_expand_links | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 257 of file history.c.
References global_history_expand().
HOOKF | ( | void | , |
ami_history_global_menu_item_project_export | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
menu stuff
Definition at line 226 of file history.c.
References ami_gui_get_screen(), ami_update_pointer(), global_history_export(), GUI_POINTER_DEFAULT, GUI_POINTER_WAIT, messages_get(), savereq, and ami_corewindow::win.
HOOKF | ( | void | , |
ami_history_global_menu_item_project_snapshot | , | ||
APTR | , | ||
window | , | ||
struct IntuiMessage * | |||
) |
Definition at line 277 of file history.c.
References nsoption_set_int, and ami_corewindow::win.
|
static |
Definition at line 93 of file history.c.
Referenced by ami_history_global_destroy(), and ami_history_global_present().