NetSurf
Data Structures | Typedefs | Functions | Variables
plugin_hack.c File Reference

Plugin=>external program handler (implementation) More...

#include "amiga/os3support.h"
#include <stdlib.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/plotters.h"
#include "netsurf/content.h"
#include "amiga/filetype.h"
#include "amiga/plugin_hack.h"
#include "content/content_protected.h"
#include "content/content_factory.h"
#include "content/llcache.h"
Include dependency graph for plugin_hack.c:

Go to the source code of this file.

Data Structures

struct  amiga_plugin_hack_content
 

Typedefs

typedef struct amiga_plugin_hack_content amiga_plugin_hack_content
 

Functions

static nserror amiga_plugin_hack_create (const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
 
static bool amiga_plugin_hack_convert (struct content *c)
 
static void amiga_plugin_hack_reformat (struct content *c, int width, int height)
 
static void amiga_plugin_hack_destroy (struct content *c)
 
static bool amiga_plugin_hack_redraw (struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
 
static nserror amiga_plugin_hack_open (struct content *c, struct browser_window *bw, struct content *page, struct object_params *params)
 Handle a window containing a CONTENT_PLUGIN being opened. More...
 
static nserror amiga_plugin_hack_close (struct content *c)
 
static nserror amiga_plugin_hack_clone (const struct content *old, struct content **newc)
 
static content_type amiga_plugin_hack_content_type (void)
 
nserror amiga_plugin_hack_init (void)
 
void amiga_plugin_hack_execute (struct hlcache_handle *c)
 

Variables

static const content_handler amiga_plugin_hack_content_handler
 

Detailed Description

Plugin=>external program handler (implementation)

Definition in file plugin_hack.c.

Typedef Documentation

◆ amiga_plugin_hack_content

Function Documentation

◆ amiga_plugin_hack_clone()

nserror amiga_plugin_hack_clone ( const struct content old,
struct content **  newc 
)
static

Definition at line 221 of file plugin_hack.c.

References amiga_plugin_hack_convert(), amiga_plugin_hack_content::base, content__clone(), content_destroy(), CONTENT_STATUS_DONE, CONTENT_STATUS_READY, NSERROR_CLONE_FAILED, NSERROR_NOMEM, NSERROR_OK, NSLOG, and content::status.

Here is the call graph for this function:

◆ amiga_plugin_hack_close()

nserror amiga_plugin_hack_close ( struct content c)
static

Definition at line 205 of file plugin_hack.c.

References NSERROR_OK, and NSLOG.

◆ amiga_plugin_hack_content_type()

content_type amiga_plugin_hack_content_type ( void  )
static

Definition at line 252 of file plugin_hack.c.

References CONTENT_PLUGIN.

◆ amiga_plugin_hack_convert()

bool amiga_plugin_hack_convert ( struct content c)
static

Definition at line 126 of file plugin_hack.c.

References content_set_done(), content_set_ready(), content_set_status(), and NSLOG.

Referenced by amiga_plugin_hack_clone().

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

◆ amiga_plugin_hack_create()

nserror amiga_plugin_hack_create ( const content_handler handler,
lwc_string *  imime_type,
const struct http_parameter params,
llcache_handle llcache,
const char *  fallback_charset,
bool  quirks,
struct content **  c 
)
static

Definition at line 102 of file plugin_hack.c.

References amiga_plugin_hack_content::base, content__init(), llcache, NSERROR_NOMEM, and NSERROR_OK.

Here is the call graph for this function:

◆ amiga_plugin_hack_destroy()

void amiga_plugin_hack_destroy ( struct content c)
static

Definition at line 138 of file plugin_hack.c.

References NSLOG.

◆ amiga_plugin_hack_execute()

void amiga_plugin_hack_execute ( struct hlcache_handle c)

Definition at line 257 of file plugin_hack.c.

References ami_mime_content_to_cmd(), ASPrintf(), hlcache_handle_get_url(), NSLOG, and nsurl_access().

Here is the call graph for this function:

◆ amiga_plugin_hack_init()

nserror amiga_plugin_hack_init ( void  )

Definition at line 75 of file plugin_hack.c.

References ami_mime_has_cmd(), amiga_plugin_hack_content_handler, content_factory_register_handler(), NSERROR_OK, NSLOG, and type.

Referenced by main().

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

◆ amiga_plugin_hack_open()

nserror amiga_plugin_hack_open ( struct content c,
struct browser_window bw,
struct content page,
struct object_params params 
)
static

Handle a window containing a CONTENT_PLUGIN being opened.

Parameters
ccontent that has been opened
bwbrowser window containing the content
pagecontent of type CONTENT_HTML containing c, or 0 if not an object within a page
paramsobject parameters, or 0 if not an object

Definition at line 189 of file plugin_hack.c.

References content_get_url(), content::height, NSERROR_OK, NSLOG, nsurl_access(), and content::width.

Here is the call graph for this function:

◆ amiga_plugin_hack_redraw()

bool amiga_plugin_hack_redraw ( struct content c,
struct content_redraw_data data,
const struct rect clip,
const struct redraw_context ctx 
)
static

Definition at line 147 of file plugin_hack.c.

References content__get_mime_type(), plot_style_s::fill_type, content_redraw_data::height, NSERROR_OK, NSLOG, redraw_context::plot, PLOT_OP_TYPE_SOLID, plot_style_font, plot_style_int_to_fixed, plotter_table::rectangle, plotter_table::text, content_redraw_data::width, content_redraw_data::x, rect::x0, rect::x1, content_redraw_data::y, rect::y0, and rect::y1.

Here is the call graph for this function:

◆ amiga_plugin_hack_reformat()

void amiga_plugin_hack_reformat ( struct content c,
int  width,
int  height 
)
static

Definition at line 211 of file plugin_hack.c.

References content::height, height, NSLOG, content::width, and width.

Variable Documentation

◆ amiga_plugin_hack_content_handler

const content_handler amiga_plugin_hack_content_handler
static
Initial value:
= {
.data_complete = amiga_plugin_hack_convert,
.no_share = false,
}
static void amiga_plugin_hack_destroy(struct content *c)
Definition: plugin_hack.c:138
static content_type amiga_plugin_hack_content_type(void)
Definition: plugin_hack.c:252
static nserror amiga_plugin_hack_create(const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c)
Definition: plugin_hack.c:102
static nserror amiga_plugin_hack_clone(const struct content *old, struct content **newc)
Definition: plugin_hack.c:221
static nserror amiga_plugin_hack_open(struct content *c, struct browser_window *bw, struct content *page, struct object_params *params)
Handle a window containing a CONTENT_PLUGIN being opened.
Definition: plugin_hack.c:189
static void amiga_plugin_hack_reformat(struct content *c, int width, int height)
Definition: plugin_hack.c:211
static bool amiga_plugin_hack_redraw(struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx)
Definition: plugin_hack.c:147
static bool amiga_plugin_hack_convert(struct content *c)
Definition: plugin_hack.c:126
static nserror amiga_plugin_hack_close(struct content *c)
Definition: plugin_hack.c:205

Definition at line 62 of file plugin_hack.c.

Referenced by amiga_plugin_hack_init().