NetSurf
Macros | Functions | Variables
clipboard.c File Reference
#include <stdlib.h>
#include <string.h>
#include <proto/iffparse.h>
#include <proto/intuition.h>
#include <proto/exec.h>
#include <proto/datatypes.h>
#include <proto/diskfont.h>
#include <diskfont/diskfonttag.h>
#include <datatypes/textclass.h>
#include <datatypes/pictureclass.h>
#include "utils/nsoption.h"
#include "utils/utf8.h"
#include "utils/nsurl.h"
#include "netsurf/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
#include "netsurf/window.h"
#include "netsurf/clipboard.h"
#include "amiga/bitmap.h"
#include "amiga/clipboard.h"
#include "amiga/drag.h"
#include "amiga/filetype.h"
#include "amiga/gui.h"
#include "amiga/iff_cset.h"
#include "amiga/iff_dr2d.h"
#include "amiga/gui_menu.h"
#include "amiga/utf8.h"
Include dependency graph for clipboard.c:

Go to the source code of this file.

Macros

#define ID_UTF8   MAKE_ID('U','T','F','8')
 

Functions

static struct IFFHandle * ami_clipboard_init_internal (int unit)
 
void ami_clipboard_init (void)
 
static void ami_clipboard_free_internal (struct IFFHandle *iffhandle)
 
void ami_clipboard_free (void)
 
void gui_start_selection (struct gui_window *g)
 
static char * ami_clipboard_cat_collection (struct CollectionItem *ci, LONG codeset, size_t *text_length)
 
static void gui_get_clipboard (char **buffer, size_t *length)
 
static void gui_set_clipboard (const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
 
void ami_drag_selection (struct gui_window *g)
 
bool ami_easy_clipboard (const char *text)
 
bool ami_easy_clipboard_bitmap (struct bitmap *bitmap)
 

Variables

static struct IFFHandle * iffh = NULL
 
static struct gui_clipboard_table clipboard_table
 
struct gui_clipboard_tableamiga_clipboard_table = &clipboard_table
 

Macro Definition Documentation

◆ ID_UTF8

#define ID_UTF8   MAKE_ID('U','T','F','8')

Definition at line 51 of file clipboard.c.

Function Documentation

◆ ami_clipboard_cat_collection()

static char * ami_clipboard_cat_collection ( struct CollectionItem *  ci,
LONG  codeset,
size_t *  text_length 
)
static

Definition at line 100 of file clipboard.c.

References ObtainCharsetInfo, text(), utf8_from_enc(), and utf8_from_local_encoding().

Referenced by gui_get_clipboard().

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

◆ ami_clipboard_free()

void ami_clipboard_free ( void  )

Definition at line 82 of file clipboard.c.

References ami_clipboard_free_internal(), and iffh.

Referenced by gui_quit().

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

◆ ami_clipboard_free_internal()

static void ami_clipboard_free_internal ( struct IFFHandle *  iffhandle)
static

Definition at line 75 of file clipboard.c.

Referenced by ami_clipboard_free(), and ami_drag_selection().

Here is the caller graph for this function:

◆ ami_clipboard_init()

void ami_clipboard_init ( void  )

Definition at line 70 of file clipboard.c.

References ami_clipboard_init_internal(), and iffh.

Referenced by main().

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

◆ ami_clipboard_init_internal()

static struct IFFHandle * ami_clipboard_init_internal ( int  unit)
static

Definition at line 55 of file clipboard.c.

Referenced by ami_clipboard_init(), and ami_drag_selection().

Here is the caller graph for this function:

◆ ami_drag_selection()

void ami_drag_selection ( struct gui_window g)

◆ ami_easy_clipboard()

bool ami_easy_clipboard ( const char *  text)

Definition at line 332 of file clipboard.c.

References gui_set_clipboard(), and text().

Here is the call graph for this function:

◆ ami_easy_clipboard_bitmap()

bool ami_easy_clipboard_bitmap ( struct bitmap bitmap)

Definition at line 338 of file clipboard.c.

References ami_datatype_object_from_bitmap().

Referenced by HOOKF().

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

◆ gui_get_clipboard()

static void gui_get_clipboard ( char **  buffer,
size_t *  length 
)
static

Definition at line 177 of file clipboard.c.

References ami_clipboard_cat_collection(), buffer, CSet::CodeSet, ID_CSET, ID_UTF8, and iffh.

Here is the call graph for this function:

◆ gui_set_clipboard()

static void gui_set_clipboard ( const char *  buffer,
size_t  length,
nsclipboard_styles  styles[],
int  n_styles 
)
static

Definition at line 206 of file clipboard.c.

References ami_utf8_free(), buffer, CSet::CodeSet, ID_CSET, ID_UTF8, iffh, NSERROR_OK, nsoption_bool, text(), and utf8_to_local_encoding().

Referenced by ami_easy_clipboard().

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

◆ gui_start_selection()

void gui_start_selection ( struct gui_window g)

Definition at line 87 of file clipboard.c.

References ami_gui_get_browser_window(), ami_gui_get_menu(), ami_gui_get_window(), ami_gui_menu_set_disabled(), browser_window_get_editor_flags(), BW_EDITOR_CAN_CUT, M_CLEAR, M_COPY, M_CUT, and nsoption_bool.

Referenced by gui_window_event(), HOOKF(), and ro_gui_window_event().

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

Variable Documentation

◆ amiga_clipboard_table

struct gui_clipboard_table* amiga_clipboard_table = &clipboard_table

Definition at line 381 of file clipboard.c.

Referenced by main().

◆ clipboard_table

struct gui_clipboard_table clipboard_table
static
Initial value:
= {
}
static void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
Definition: clipboard.c:206
static void gui_get_clipboard(char **buffer, size_t *length)
Definition: clipboard.c:177

Definition at line 376 of file clipboard.c.

◆ iffh

struct IFFHandle* iffh = NULL
static