make the clipboard operation table and members static to textselection module and cleanup unnecessary includes

This commit is contained in:
Vincent Sanders 2014-02-01 10:45:20 +00:00
parent 356461244e
commit 1f62b5a980
6 changed files with 43 additions and 35 deletions

View File

@ -50,7 +50,13 @@
#include "oslib/wimpspriteop.h"
#include "oslib/uri.h"
#include "rufl.h"
#include "utils/config.h"
#include "utils/filename.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
#include "utils/utils.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
@ -61,6 +67,7 @@
#include "desktop/save_complete.h"
#include "desktop/treeview.h"
#include "render/font.h"
#include "riscos/content-handlers/artworks.h"
#include "riscos/bitmap.h"
#include "riscos/buffer.h"
@ -92,11 +99,6 @@
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
#include "riscos/window.h"
#include "utils/filename.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
#include "utils/utils.h"
@ -2348,10 +2350,6 @@ static bool path_add_part(char *path, int length, const char *newpart)
return true;
}
static struct gui_clipboard_table riscos_clipboard_table = {
.get = gui_get_clipboard,
.set = gui_set_clipboard,
};
static struct gui_fetch_table riscos_fetch_table = {
.filename_from_path = filename_from_path,
@ -2388,7 +2386,7 @@ int main(int argc, char** argv)
struct gui_table riscos_gui_table = {
.browser = &riscos_browser_table,
.window = riscos_window_table,
.clipboard = &riscos_clipboard_table,
.clipboard = riscos_clipboard_table,
.download = riscos_download_table,
.fetch = &riscos_fetch_table,
};

View File

@ -27,7 +27,6 @@
#include "oslib/wimp.h"
#include "rufl.h"
#include "desktop/browser.h"
#include "desktop/gui.h"
#include "content/content_type.h"
#include "utils/config.h"
@ -213,10 +212,6 @@ extern int ro_plot_origin_y;
/* in theme_install.c */
bool ro_gui_theme_install_apply(wimp_w w);
/* in textselection.c */
void gui_get_clipboard(char **buffer, size_t *length);
void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles);
/* in sslcert.c */
void gui_cert_verify(nsurl *url,
const struct ssl_cert_info *certs, unsigned long num,

View File

@ -35,6 +35,13 @@
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
#include "oslib/wimpspriteop.h"
#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/hotlist.h"
@ -43,8 +50,10 @@
#include "desktop/save_complete.h"
#include "desktop/save_text.h"
#include "desktop/thumbnail.h"
#include "desktop/gui.h"
#include "image/bitmap.h"
#include "render/form.h"
#include "riscos/bitmap.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
@ -60,12 +69,6 @@
#include "riscos/thumbnail.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/utils.h"
//typedef enum
//{

View File

@ -25,25 +25,27 @@
#include <string.h>
#include "oslib/osfile.h"
#include "oslib/wimp.h"
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "content/hlcache.h"
#include "desktop/gui.h"
#include "desktop/textinput.h"
#include "riscos/gui.h"
#include "riscos/menus.h"
#include "riscos/message.h"
#include "riscos/mouse.h"
#include "riscos/save.h"
#include "riscos/textselection.h"
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#ifndef wimp_DRAG_CLAIM_SUPPRESS_DRAGBOX
#define wimp_DRAG_CLAIM_SUPPRESS_DRAGBOX ((wimp_drag_claim_flags) 0x2u)
#endif
/** Receive of Dragging message has claimed it */
static bool dragging_claimed = false;
static wimp_t dragging_claimant;
@ -194,7 +196,7 @@ static void ro_gui_selection_drag_end(wimp_dragged *drag, void *data)
* \param styles Array of styles given to text runs, owned by core, or NULL
* \param n_styles Number of text run styles in array
*/
void gui_set_clipboard(const char *buffer, size_t length,
static void gui_set_clipboard(const char *buffer, size_t length,
nsclipboard_styles styles[], int n_styles)
{
char *new_cb;
@ -245,7 +247,7 @@ void gui_set_clipboard(const char *buffer, size_t length,
* \param buffer UTF-8 text, allocated by front end, ownership yielded to core
* \param length Byte length of UTF-8 text in buffer
*/
void gui_get_clipboard(char **buffer, size_t *length)
static void gui_get_clipboard(char **buffer, size_t *length)
{
*buffer = NULL;
*length = 0;
@ -652,3 +654,10 @@ void ro_gui_dragging_bounced(wimp_message *message)
{
dragging_claimed = false;
}
static struct gui_clipboard_table clipboard_table = {
.get = gui_get_clipboard,
.set = gui_set_clipboard,
};
struct gui_clipboard_table *riscos_clipboard_table = &clipboard_table;

View File

@ -24,7 +24,8 @@
#define _NETSURF_RISCOS_TEXTSELECTION_H_
#include "oslib/wimp.h"
#include "desktop/gui.h"
struct gui_clipboard_table *riscos_clipboard_table;
void gui_start_selection(struct gui_window *g);

View File

@ -40,7 +40,15 @@
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
#include "oslib/wimpspriteop.h"
#include "utils/config.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/talloc.h"
#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "utils/messages.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
@ -58,6 +66,7 @@
#include "desktop/gui.h"
#include "render/form.h"
#include "render/html.h"
#include "riscos/bitmap.h"
#include "riscos/buffer.h"
#include "riscos/cookies.h"
@ -69,7 +78,6 @@
#include "riscos/hotlist.h"
#include "riscos/menus.h"
#include "riscos/mouse.h"
#include "utils/nsoption.h"
#include "riscos/oslib_pre7.h"
#include "riscos/save.h"
#include "riscos/content-handlers/sprite.h"
@ -82,12 +90,6 @@
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
#include "riscos/window.h"
#include "utils/log.h"
#include "utils/talloc.h"
#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "utils/messages.h"
void gui_window_redraw_window(struct gui_window *g);