From 26203b22157e0b92caa973d712968f4f4bbeee6c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 2 Aug 2008 14:31:32 +0000 Subject: Initial Amiga port files, mostly empty stub functions. svn path=/trunk/netsurf/; revision=4864 --- amiga/bitmap.c | 164 ++++++++++++++++++++++++++++ amiga/bitmap.h | 28 +++++ amiga/compat.c | 98 +++++++++++++++++ amiga/compat.h | 35 ++++++ amiga/filetype.c | 55 ++++++++++ amiga/font.c | 83 ++++++++++++++ amiga/gui.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ amiga/gui.h | 28 +++++ amiga/history.c | 32 ++++++ amiga/hotlist.c | 23 ++++ amiga/login.c | 24 ++++ amiga/misc.c | 42 +++++++ amiga/plotters.c | 125 +++++++++++++++++++++ amiga/plotters.h | 48 ++++++++ amiga/schedule.c | 32 ++++++ amiga/thumbnail.c | 24 ++++ amiga/tree.c | 62 +++++++++++ amiga/utf8.c | 25 +++++ 18 files changed, 1249 insertions(+) create mode 100644 amiga/bitmap.c create mode 100755 amiga/bitmap.h create mode 100755 amiga/compat.c create mode 100755 amiga/compat.h create mode 100644 amiga/filetype.c create mode 100644 amiga/font.c create mode 100755 amiga/gui.c create mode 100755 amiga/gui.h create mode 100755 amiga/history.c create mode 100755 amiga/hotlist.c create mode 100755 amiga/login.c create mode 100755 amiga/misc.c create mode 100755 amiga/plotters.c create mode 100755 amiga/plotters.h create mode 100755 amiga/schedule.c create mode 100755 amiga/thumbnail.c create mode 100755 amiga/tree.c create mode 100755 amiga/utf8.c diff --git a/amiga/bitmap.c b/amiga/bitmap.c new file mode 100644 index 000000000..4c270a170 --- /dev/null +++ b/amiga/bitmap.c @@ -0,0 +1,164 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "assert.h" +#include "image/bitmap.h" +#include "amiga/bitmap.h" +#include + +/** + * Create a bitmap. + * + * \param width width of image in pixels + * \param height width of image in pixels + * \param state a flag word indicating the initial state + * \return an opaque struct bitmap, or NULL on memory exhaustion + */ + +struct bitmap *bitmap_create(int width, int height, unsigned int state) +{ + struct bitmap *bitmap; + + DebugPrintF("creating bitmap\n"); + + bitmap = AllocVec(sizeof(struct bitmap),MEMF_CLEAR); + if(bitmap) + { + bitmap->pixdata = AllocVec(width*height*4,MEMF_CLEAR); + bitmap->width = width; + bitmap->height = height; + } + return bitmap; +} + + +/** + * Return a pointer to the pixel data in a bitmap. + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \return pointer to the pixel buffer + * + * The pixel data is packed as BITMAP_FORMAT, possibly with padding at the end + * of rows. The width of a row in bytes is given by bitmap_get_rowstride(). + */ + +char *bitmap_get_buffer(struct bitmap *bitmap) +{ + return bitmap->pixdata; +} + + +/** + * Find the width of a pixel row in bytes. + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \return width of a pixel row in the bitmap + */ + +size_t bitmap_get_rowstride(struct bitmap *bitmap) +{ + return (bitmap->width)*4; +} + + +/** + * Free a bitmap. + * + * \param bitmap a bitmap, as returned by bitmap_create() + */ + +void bitmap_destroy(struct bitmap *bitmap) +{ + FreeVec(bitmap->pixdata); + FreeVec(bitmap); +} + + +/** + * Save a bitmap in the platform's native format. + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \param path pathname for file + * \return true on success, false on error and error reported + */ + +bool bitmap_save(struct bitmap *bitmap, const char *path, unsigned flags) +{ + return true; +} + + +/** + * The bitmap image has changed, so flush any persistant cache. + * + * \param bitmap a bitmap, as returned by bitmap_create() + */ +void bitmap_modified(struct bitmap *bitmap) { +} + + +/** + * The bitmap image can be suspended. + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \param private_word a private word to be returned later + * \param suspend the function to be called upon suspension + * \param resume the function to be called when resuming + */ +void bitmap_set_suspendable(struct bitmap *bitmap, void *private_word, + void (*invalidate)(struct bitmap *bitmap, void *private_word)) { +} + +/** + * Sets whether a bitmap should be plotted opaque + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \param opaque whether the bitmap should be plotted opaque + */ +void bitmap_set_opaque(struct bitmap *bitmap, bool opaque) +{ + assert(bitmap); +/* todo: set bitmap as opaque */ +} + + +/** + * Tests whether a bitmap has an opaque alpha channel + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \return whether the bitmap is opaque + */ +bool bitmap_test_opaque(struct bitmap *bitmap) +{ + assert(bitmap); +/* todo: test if bitmap as opaque */ + return false; +} + + +/** + * Gets whether a bitmap should be plotted opaque + * + * \param bitmap a bitmap, as returned by bitmap_create() + */ +bool bitmap_get_opaque(struct bitmap *bitmap) +{ + assert(bitmap); +/* todo: get whether bitmap is opaque */ + return false; +} diff --git a/amiga/bitmap.h b/amiga/bitmap.h new file mode 100755 index 000000000..8466bd0a3 --- /dev/null +++ b/amiga/bitmap.h @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMIGA_BITMAP_H +#define AMIGA_BITMAP_H +#include +struct bitmap { + ULONG width; + ULONG height; + UBYTE *pixdata; +}; + +#endif diff --git a/amiga/compat.c b/amiga/compat.c new file mode 100755 index 000000000..39b17e370 --- /dev/null +++ b/amiga/compat.c @@ -0,0 +1,98 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include "compat.h" +#include + +/* +char *strndup(const char *s,size_t n) +{ + char *res; + size_t len = strlen(s); + + if(nrelease,"%ld.%ld",VersionBase->lib_Version,VersionBase->lib_Version); + CloseLibrary(VersionBase); + } + + strcpy(uts->sysname,"AmigaOS"); + strcpy(uts->nodename,"amiga"); + strcpy(uts->version,"4.0"); + strcpy(uts->machine,"ppc"); + +} + +uid_t geteuid(void) +{ + return 0; +} + +uid_t getuid(void) +{ + return 0; +} + +gid_t getgid(void) +{ + return 0; +} + +gid_t getegid(void) +{ + return 0; +} + +int tcsetattr(int fildes, int optional_actions, const struct termios *termios_p) +{ + return 0; +} + +int tcgetattr(int fildes, struct termios *termios_p) +{ + return 0; +} diff --git a/amiga/compat.h b/amiga/compat.h new file mode 100755 index 000000000..ff418e161 --- /dev/null +++ b/amiga/compat.h @@ -0,0 +1,35 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMIGA_COMPAT_H +#define AMIGA_COMPAT_H +//#include +#include +#include + +extern gid_t getegid(void); +extern uid_t geteuid(void); +extern uid_t getuid(void); +extern gid_t getgid(void); +extern int tcsetattr(int fildes, int optional_actions, const struct termios *termios_p); +extern int tcgetattr(int fildes, struct termios *termios_p); + +//char *strndup(const char *,size_t); +extern int strcasecmp(const char *, const char *); +extern int uname(struct utsname *); +#endif diff --git a/amiga/filetype.c b/amiga/filetype.c new file mode 100644 index 000000000..d15890ce4 --- /dev/null +++ b/amiga/filetype.c @@ -0,0 +1,55 @@ +/* + * Copyright 2003 James Bursa + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "content/fetch.h" +#include "utils/log.h" +#include "utils/utils.h" + +/** + * filetype -- determine the MIME type of a local file + */ + +const char *fetch_filetype(const char *unix_path) +{ + int l; + LOG(("unix path %s", unix_path)); + l = strlen(unix_path); + if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) + return "text/css"; + if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0) + return "image/jpeg"; + if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0) + return "image/jpeg"; + if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0) + return "image/gif"; + if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0) + return "image/png"; + if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0) + return "image/jng"; + if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0) + return "image/svg"; + return "text/html"; +} + + +char *fetch_mimetype(const char *ro_path) +{ + return strdup("text/plain"); +} diff --git a/amiga/font.c b/amiga/font.c new file mode 100644 index 000000000..49c1cdc8c --- /dev/null +++ b/amiga/font.c @@ -0,0 +1,83 @@ +/* + * Copyright 2005 James Bursa + * 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "css/css.h" +#include "render/font.h" + +static bool nsfont_width(const struct css_style *style, + const char *string, size_t length, + int *width); + +static bool nsfont_position_in_string(const struct css_style *style, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x); + +static bool nsfont_split(const struct css_style *style, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x); + +const struct font_functions nsfont = { + nsfont_width, + nsfont_position_in_string, + nsfont_split +}; + +bool nsfont_width(const struct css_style *style, + const char *string, size_t length, + int *width) +{ + assert(style); + assert(string); + + *width = length * 10; + return true; +} + + +bool nsfont_position_in_string(const struct css_style *style, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x) +{ + assert(style); + assert(string); + + *char_offset = (x + 5) / 10; + if (length < *char_offset) + *char_offset = length; + *actual_x = *char_offset * 10; + return true; +} + + +bool nsfont_split(const struct css_style *style, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x) +{ + assert(style); + assert(string); + + *char_offset = x / 10; + if (length < *char_offset) + *char_offset = length; + while (*char_offset && string[*char_offset] != ' ') + (*char_offset)--; + *actual_x = *char_offset * 10; + return true; +} diff --git a/amiga/gui.c b/amiga/gui.c new file mode 100755 index 000000000..2f52ba400 --- /dev/null +++ b/amiga/gui.c @@ -0,0 +1,321 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/gui.h" +#include "desktop/netsurf.h" +#include "utils/messages.h" +#include +#include +#include "amiga/gui.h" +#include "amiga/plotters.h" + +struct browser_window *curbw; + +char *default_stylesheet_url; +char *adblock_stylesheet_url; +struct gui_window *search_current_window = NULL; + +static bool gui_start = true; + +void gui_init(int argc, char** argv) +{ + verbose_log = true; + messages_load("amiga_temp_build/messages"); + default_stylesheet_url = "file://netsurf/amiga_temp_build/default.css"; //"http://www.unsatisfactorysoftware.co.uk/newlook.css"; //path_to_url(buf); + options_read("options"); + + plot=amiplot; +} + +void gui_init2(int argc, char** argv) +{ + struct browser_window *bw; + const char *addr = "http://netsurf-browser.org/welcome/"; + + curbw = browser_window_create(addr, 0, 0, true); // curbw = temp +} + +void ami_get_msg(void) +{ + struct IntuiMessage *message = NULL; + ULONG class; + + while(message = (struct IntuiMessage *)GetMsg(curwin->win->UserPort)) + { + class = message->Class; + + switch(class) + { + case IDCMP_CLOSEWINDOW: + gui_window_destroy(curwin); + gui_quit(); + exit(0); + break; + + default: + break; + } + ReplyMsg((struct Message *)message); + } +} + +void gui_multitask(void) +{ + printf("mtask\n"); + ami_get_msg(); + +/* Commented out the below as we seem to have an odd concept of multitasking + where we can't wait for input as other things need to be done. + + ULONG winsignal = 1L << curwin->win->UserPort->mp_SigBit; + ULONG signalmask = winsignal; + ULONG signals; + + signals = Wait(signalmask); + + if(signals & winsignal) + { + ami_get_msg(); + } +*/ +} + +void gui_poll(bool active) +{ +// printf("poll\n"); + ami_get_msg(); + schedule_run(); +} + +void gui_quit(void) +{ +} + +struct gui_window *gui_create_browser_window(struct browser_window *bw, + struct browser_window *clone) +{ + struct gui_window *gwin = NULL; + + gwin = AllocVec(sizeof(struct gui_window),MEMF_CLEAR); + + if(!gwin) + { + printf("not enough mem"); + return 0; + } + + gwin->win = OpenWindowTags(NULL, + WA_CloseGadget, TRUE, + WA_DragBar, TRUE, + WA_DepthGadget, TRUE, + WA_Width, 800, + WA_Height, 600, + WA_IDCMP, IDCMP_CLOSEWINDOW, + WA_Title, "NetSurf", + TAG_DONE); + +curwin=gwin; //test + + return gwin; +} + +void gui_window_destroy(struct gui_window *g) +{ + CloseWindow(g->win); + FreeVec(g); +} + +void gui_window_set_title(struct gui_window *g, const char *title) +{ + SetWindowTitles(g->win,title,"NetSurf"); +} + +void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1) +{ + DebugPrintF("REDRAW\n"); +} + +void gui_window_redraw_window(struct gui_window *g) +{ + DebugPrintF("REDRAW2\n"); // next +} + +void gui_window_update_box(struct gui_window *g, + const union content_msg_data *data) +{ +} + +bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) +{ +} + +void gui_window_set_scroll(struct gui_window *g, int sx, int sy) +{ +} + +void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, + int x1, int y1) +{ +} + +void gui_window_position_frame(struct gui_window *g, int x0, int y0, + int x1, int y1) +{ +} + +void gui_window_get_dimensions(struct gui_window *g, int *width, int *height, + bool scaled) +{ +} + +void gui_window_update_extent(struct gui_window *g) +{ +} + +void gui_window_set_status(struct gui_window *g, const char *text) +{ + printf("STATUS: %s\n",text); +} + +void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) +{ +} + +void gui_window_hide_pointer(struct gui_window *g) +{ +} + +void gui_window_set_url(struct gui_window *g, const char *url) +{ +} + +void gui_window_start_throbber(struct gui_window *g) +{ +} + +void gui_window_stop_throbber(struct gui_window *g) +{ +} + +void gui_window_place_caret(struct gui_window *g, int x, int y, int height) +{ +} + +void gui_window_remove_caret(struct gui_window *g) +{ +} + +void gui_window_new_content(struct gui_window *g) +{ +} + +bool gui_window_scroll_start(struct gui_window *g) +{ +} + +bool gui_window_box_scroll_start(struct gui_window *g, + int x0, int y0, int x1, int y1) +{ +} + +bool gui_window_frame_resize_start(struct gui_window *g) +{ +} + +void gui_window_save_as_link(struct gui_window *g, struct content *c) +{ +} + +void gui_window_set_scale(struct gui_window *g, float scale) +{ +} + +struct gui_download_window *gui_download_window_create(const char *url, + const char *mime_type, struct fetch *fetch, + unsigned int total_size, struct gui_window *gui) +{ +} + +void gui_download_window_data(struct gui_download_window *dw, const char *data, + unsigned int size) +{ +} + +void gui_download_window_error(struct gui_download_window *dw, + const char *error_msg) +{ +} + +void gui_download_window_done(struct gui_download_window *dw) +{ +} + +void gui_drag_save_object(gui_save_type type, struct content *c, + struct gui_window *g) +{ +} + +void gui_drag_save_selection(struct selection *s, struct gui_window *g) +{ +} + +void gui_start_selection(struct gui_window *g) +{ +} + +void gui_paste_from_clipboard(struct gui_window *g, int x, int y) +{ +} + +bool gui_empty_clipboard(void) +{ +} + +bool gui_add_to_clipboard(const char *text, size_t length, bool space) +{ +} + +bool gui_commit_clipboard(void) +{ +} + +bool gui_copy_to_clipboard(struct selection *s) +{ +} + +void gui_create_form_select_menu(struct browser_window *bw, + struct form_control *control) +{ +} + +void gui_launch_url(const char *url) +{ +} + +bool gui_search_term_highlighted(struct gui_window *g, + unsigned start_offset, unsigned end_offset, + unsigned *start_idx, unsigned *end_idx) +{ +} + +#ifdef WITH_SSL +void gui_cert_verify(struct browser_window *bw, struct content *c, + const struct ssl_cert_info *certs, unsigned long num) +{ +} +#endif diff --git a/amiga/gui.h b/amiga/gui.h new file mode 100755 index 000000000..220846704 --- /dev/null +++ b/amiga/gui.h @@ -0,0 +1,28 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMIGA_GUI_H +#define AMIGA_GUI_H +void ami_get_msg(void); + +struct gui_window { + struct Window *win; +}; + +struct gui_window *curwin; +#endif diff --git a/amiga/history.c b/amiga/history.c new file mode 100755 index 000000000..927828f8b --- /dev/null +++ b/amiga/history.c @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/browser.h" + +void global_history_add(const char *url) +{ +} + +void global_history_add_recent(const char *url) +{ +} + +char **global_history_get_recent(int *count) +{ +} + diff --git a/amiga/hotlist.c b/amiga/hotlist.c new file mode 100755 index 000000000..c05a55ea3 --- /dev/null +++ b/amiga/hotlist.c @@ -0,0 +1,23 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/browser.h" + +void hotlist_visited(struct content *content) +{ +} diff --git a/amiga/login.c b/amiga/login.c new file mode 100755 index 000000000..47e708e58 --- /dev/null +++ b/amiga/login.c @@ -0,0 +1,24 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/401login.h" + +void gui_401login_open(struct browser_window *bw, struct content *c, + const char *realm) +{ +} diff --git a/amiga/misc.c b/amiga/misc.c new file mode 100755 index 000000000..ee6eecdeb --- /dev/null +++ b/amiga/misc.c @@ -0,0 +1,42 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +//#include "utils/url.h" +#include "desktop/cookies.h" + +void warn_user(const char *warning, const char *detail) +{ + printf("WARNING: %s %s\n", warning, detail); +} + +void die(const char *error) +{ + printf("die: %s\n", error); + exit(1); +} + +bool cookies_update(const char *domain, const struct cookie_data *data) +{ return true; } + +char *url_to_path(const char *url) +{ + return strdup(url + 5); +} diff --git a/amiga/plotters.c b/amiga/plotters.c new file mode 100755 index 000000000..12e7a15b3 --- /dev/null +++ b/amiga/plotters.c @@ -0,0 +1,125 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "amiga/plotters.h" +#include "amiga/gui.h" +#include "amiga/bitmap.h" +#include +#include + +struct plotter_table plot; +const struct plotter_table amiplot = { + ami_clg, + ami_rectangle, + ami_line, + ami_polygon, + ami_fill, + ami_clip, + ami_text, + ami_disc, + ami_arc, + ami_bitmap, + ami_bitmap_tile, + ami_group_start, + ami_group_end, + ami_flush, + ami_path +}; + +bool ami_clg(colour c) +{ + printf("clg\n"); +} + +bool ami_rectangle(int x0, int y0, int width, int height, + int line_width, colour c, bool dotted, bool dashed) +{ + printf("rect\n"); +} + +bool ami_line(int x0, int y0, int x1, int y1, int width, + colour c, bool dotted, bool dashed) +{ + printf("line\n"); +} + +bool ami_polygon(int *p, unsigned int n, colour fill) +{ +} + +bool ami_fill(int x0, int y0, int x1, int y1, colour c) +{ +} + +bool ami_clip(int x0, int y0, int x1, int y1) +{ +} + +bool ami_text(int x, int y, const struct css_style *style, + const char *text, size_t length, colour bg, colour c) +{ + printf("%s\n",text); +} + +bool ami_disc(int x, int y, int radius, colour c, bool filled) +{ +} + +bool ami_arc(int x, int y, int radius, int angle1, int angle2, + colour c) +{ +} + +bool ami_bitmap(int x, int y, int width, int height, + struct bitmap *bitmap, colour bg) +{ + struct RenderInfo ri; + +printf("bitmap plotter\n"); + ri.Memory = bitmap->pixdata; + ri.BytesPerRow = bitmap->width * 3; + ri.RGBFormat = RGBFB_B8G8R8; + + p96WritePixelArray((struct RenderInfo *)&ri,0,0,curwin->win->RPort,x,y,width,height); +} + +bool ami_bitmap_tile(int x, int y, int width, int height, + struct bitmap *bitmap, colour bg, + bool repeat_x, bool repeat_y) +{ + printf("bitmap tile plotter\n"); +} + +bool ami_group_start(const char *name) +{ + /** optional */ +} + +bool ami_group_end(void) +{ + /** optional */ +} + +bool ami_flush(void) +{ +} + +bool ami_path(float *p, unsigned int n, colour fill, float width, + colour c, float *transform) +{ +} diff --git a/amiga/plotters.h b/amiga/plotters.h new file mode 100755 index 000000000..3de1b497d --- /dev/null +++ b/amiga/plotters.h @@ -0,0 +1,48 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef AMIGA_PLOTTERS_H +#define AMIGA_PLOTTERS_H +#include "desktop/plotters.h" + +extern const struct plotter_table amiplot; + +bool ami_clg(colour c); +bool ami_rectangle(int x0, int y0, int width, int height, + int line_width, colour c, bool dotted, bool dashed); +bool ami_line(int x0, int y0, int x1, int y1, int width, + colour c, bool dotted, bool dashed); +bool ami_polygon(int *p, unsigned int n, colour fill); +bool ami_fill(int x0, int y0, int x1, int y1, colour c); +bool ami_clip(int x0, int y0, int x1, int y1); +bool ami_text(int x, int y, const struct css_style *style, + const char *text, size_t length, colour bg, colour c); +bool ami_disc(int x, int y, int radius, colour c, bool filled); +bool ami_arc(int x, int y, int radius, int angle1, int angle2, + colour c); +bool ami_bitmap(int x, int y, int width, int height, + struct bitmap *bitmap, colour bg); +bool ami_bitmap_tile(int x, int y, int width, int height, + struct bitmap *bitmap, colour bg, + bool repeat_x, bool repeat_y); +bool ami_group_start(const char *name); +bool ami_group_end(void); +bool ami_flush(void); +bool ami_path(float *p, unsigned int n, colour fill, float width, + colour c, float *transform); +#endif diff --git a/amiga/schedule.c b/amiga/schedule.c new file mode 100755 index 000000000..8d99a8271 --- /dev/null +++ b/amiga/schedule.c @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/browser.h" + +void schedule(int t, void (*callback)(void *p), void *p) +{ + printf("adding callback %lx\n",callback); +} + +void schedule_remove(void (*callback)(void *p), void *p) +{ +} + +void schedule_run(void) +{ +} diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c new file mode 100755 index 000000000..5535f76c7 --- /dev/null +++ b/amiga/thumbnail.c @@ -0,0 +1,24 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/browser.h" + +bool thumbnail_create(struct content *content, struct bitmap *bitmap, + const char *url) +{ +} diff --git a/amiga/tree.c b/amiga/tree.c new file mode 100755 index 000000000..3b6d1d5db --- /dev/null +++ b/amiga/tree.c @@ -0,0 +1,62 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "desktop/tree.h" + +void tree_initialise_redraw(struct tree *tree) +{ +} + +void tree_redraw_area(struct tree *tree, int x, int y, int width, int height) +{ +} + +void tree_draw_line(int x, int y, int width, int height) +{ +} + +void tree_draw_node_element(struct tree *tree, struct node_element *element) +{ +} + +void tree_draw_node_expansion(struct tree *tree, struct node *node) +{ +} + +void tree_recalculate_node_element(struct node_element *element) +{ +} + +void tree_update_URL_node(struct node *node, const char *url, + const struct url_data *data) +{ +} + +void tree_resized(struct tree *tree) +{ +} + +void tree_set_node_sprite_folder(struct node *node) +{ +} + +void tree_set_node_sprite(struct node *node, const char *sprite, + const char *expanded) +{ +} + diff --git a/amiga/utf8.c b/amiga/utf8.c new file mode 100755 index 000000000..22812ba0c --- /dev/null +++ b/amiga/utf8.c @@ -0,0 +1,25 @@ +/* + * Copyright 2008 Chris Young + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "utils/utf8.h" + +utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len, + char **result) +{ +} -- cgit v1.2.3