NetSurf
Data Structures | Functions
pageinfo.c File Reference

Amiga implementation of page info using core windows. More...

#include <stdint.h>
#include <stdlib.h>
#include <proto/intuition.h>
#include <classes/window.h>
#include <gadgets/layout.h>
#include <gadgets/scroller.h>
#include <gadgets/space.h>
#include <images/label.h>
#include <intuition/icclass.h>
#include <reaction/reaction_macros.h>
#include "utils/log.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/page-info.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "amiga/corewindow.h"
#include "amiga/libs.h"
#include "amiga/pageinfo.h"
#include "amiga/schedule.h"
#include "amiga/utf8.h"
Include dependency graph for pageinfo.c:

Go to the source code of this file.

Data Structures

struct  ami_pageinfo_window
 Amiga page info window context. More...
 

Functions

static void ami_pageinfo_destroy (struct ami_corewindow *ami_cw)
 destroy a previously created pageinfo window More...
 
static void ami_pageinfo_close_cb (void *p)
 close pageinfo window (callback) More...
 
static BOOL ami_pageinfo_event (struct ami_corewindow *ami_cw, ULONG result)
 callback for unknown events on Amiga core window (result & WMHI_CLASSMASK) gives the class of event (eg. More...
 
static nserror ami_pageinfo_mouse (struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse action for pageinfo on core window More...
 
static nserror ami_pageinfo_key (struct ami_corewindow *ami_cw, uint32_t nskey)
 callback for keypress for pageinfo on core window More...
 
static nserror ami_pageinfo_draw (struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx)
 callback on draw event for pageinfo on core window More...
 
static nserror ami_pageinfo_create_window (struct ami_pageinfo_window *pageinfo_win, ULONG left, ULONG top)
 
nserror ami_pageinfo_open (struct browser_window *bw, ULONG left, ULONG top)
 Open the page info window. More...
 

Detailed Description

Amiga implementation of page info using core windows.

Definition in file pageinfo.c.

Function Documentation

◆ ami_pageinfo_close_cb()

static void ami_pageinfo_close_cb ( void *  p)
static

close pageinfo window (callback)

Definition at line 84 of file pageinfo.c.

References ami_pageinfo_destroy().

Referenced by ami_pageinfo_event(), and ami_pageinfo_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_create_window()

static nserror ami_pageinfo_create_window ( struct ami_pageinfo_window pageinfo_win,
ULONG  left,
ULONG  top 
)
static

Definition at line 174 of file pageinfo.c.

References ami_gui_get_screen(), ami_gui_get_screen_title(), ami_gui_get_shared_msgport(), ami_pageinfo_window::core, GID_CW_DRAW, GID_CW_MAIN, GID_CW_WIN, IDCMP_EXTENDEDMOUSE, ami_corewindow::idcmp_hook, LayoutVObj, NSERROR_NOMEM, NSERROR_OK, nsoption_bool, ami_corewindow::objects, scrn, SpaceObj, and WindowObj.

Referenced by ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_destroy()

static void ami_pageinfo_destroy ( struct ami_corewindow ami_cw)
static

destroy a previously created pageinfo window

Definition at line 66 of file pageinfo.c.

References ami_corewindow_fini(), ami_pageinfo_window::core, NSERROR_OK, page_info_destroy(), and ami_pageinfo_window::pi.

Referenced by ami_pageinfo_close_cb(), and ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_draw()

static nserror ami_pageinfo_draw ( struct ami_corewindow ami_cw,
int  x,
int  y,
struct rect r,
struct redraw_context ctx 
)
static

callback on draw event for pageinfo on core window

Parameters
ami_cwThe Amiga core window structure.
xthe x coordinate to draw
ythe y coordinate to draw
rThe rectangle of the window that needs updating.
ctxThe drawing context
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 164 of file pageinfo.c.

References NSERROR_OK, page_info_redraw(), and ami_pageinfo_window::pi.

Referenced by ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_event()

static BOOL ami_pageinfo_event ( struct ami_corewindow ami_cw,
ULONG  result 
)
static

callback for unknown events on Amiga core window (result & WMHI_CLASSMASK) gives the class of event (eg.

WMHI_GADGETUP) (result & WMHI_GADGETMASK) gives the gadget ID (eg. GID_SSLCERT_ACCEPT)

Parameters
ami_cwThe Amiga core window structure.
resultevent as returned by RA_HandleInput()
Returns
TRUE if window closed during event processing

Definition at line 99 of file pageinfo.c.

References ami_pageinfo_close_cb(), ami_schedule(), and result.

Referenced by ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_key()

static nserror ami_pageinfo_key ( struct ami_corewindow ami_cw,
uint32_t  nskey 
)
static

callback for keypress for pageinfo on core window

Parameters
ami_cwThe Amiga core window structure.
nskeyThe netsurf key code
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 143 of file pageinfo.c.

References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, page_info_keypress(), and ami_pageinfo_window::pi.

Referenced by ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_mouse()

static nserror ami_pageinfo_mouse ( struct ami_corewindow ami_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse action for pageinfo on core window

Parameters
ami_cwThe Amiga core window structure.
mouse_statenetsurf mouse state on event
xlocation of event
ylocation of event
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 119 of file pageinfo.c.

References ami_pageinfo_close_cb(), ami_schedule(), NSERROR_OK, page_info_mouse_action(), and ami_pageinfo_window::pi.

Referenced by ami_pageinfo_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_pageinfo_open()

nserror ami_pageinfo_open ( struct browser_window bw,
ULONG  left,
ULONG  top 
)

Open the page info window.

Parameters
bwthe browser window
Returns
NSERROR_OK or error code if window creation failed.

Definition at line 224 of file pageinfo.c.

References ami_corewindow_init(), ami_pageinfo_create_window(), ami_pageinfo_destroy(), ami_pageinfo_draw(), ami_pageinfo_event(), ami_pageinfo_key(), ami_pageinfo_mouse(), ami_utf8_easy(), ami_utf8_free(), ami_corewindow::close, ami_pageinfo_window::core, ami_corewindow::draw, ami_corewindow::event, GID_CW_WIN, height, ami_corewindow::key, messages_get(), ami_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, ami_corewindow::objects, page_info_create(), page_info_get_size(), ami_pageinfo_window::pi, width, and ami_corewindow::wintitle.

Referenced by ami_gui_event().

Here is the call graph for this function:
Here is the caller graph for this function: