diff options
-rw-r--r-- | !NetSurf/Resources/de/Messages | 1 | ||||
-rw-r--r-- | !NetSurf/Resources/en/Messages | 1 | ||||
-rw-r--r-- | !NetSurf/Resources/fr/Messages | 1 | ||||
-rwxr-xr-x | !NetSurf/Resources/it/Messages | 1 | ||||
-rw-r--r-- | !NetSurf/Resources/nl/Messages | 1 | ||||
-rwxr-xr-x | amiga/clipboard.c | 38 | ||||
-rwxr-xr-x | amiga/context_menu.c | 39 | ||||
-rwxr-xr-x | amiga/context_menu.h | 3 | ||||
-rw-r--r-- | amiga/download.c | 5 | ||||
-rw-r--r-- | amiga/filetype.c | 4 | ||||
-rwxr-xr-x | amiga/gui.c | 85 | ||||
-rwxr-xr-x | amiga/gui.h | 2 | ||||
-rwxr-xr-x | amiga/menu.c | 65 | ||||
-rwxr-xr-x | amiga/menu.h | 13 | ||||
-rw-r--r-- | beos/beos_window.cpp | 4 | ||||
-rw-r--r-- | desktop/gui.h | 1 | ||||
-rw-r--r-- | desktop/selection.c | 2 | ||||
-rw-r--r-- | framebuffer/gui.c | 5 | ||||
-rw-r--r-- | gtk/gtk_selection.c | 4 | ||||
-rw-r--r-- | riscos/textselection.c | 11 | ||||
-rw-r--r-- | windows/gui.c | 4 |
21 files changed, 247 insertions, 43 deletions
diff --git a/!NetSurf/Resources/de/Messages b/!NetSurf/Resources/de/Messages index d482d56a6..8f32ea78b 100644 --- a/!NetSurf/Resources/de/Messages +++ b/!NetSurf/Resources/de/Messages @@ -252,6 +252,7 @@ PrintNS:Drucken... # Edit menu # +CutNS:Ausschneiden CopyNS:Kopieren PasteNS:Einfügen SelectAllNS:Alles auswählen diff --git a/!NetSurf/Resources/en/Messages b/!NetSurf/Resources/en/Messages index b5c1ea0cc..32f4293d3 100644 --- a/!NetSurf/Resources/en/Messages +++ b/!NetSurf/Resources/en/Messages @@ -252,6 +252,7 @@ PrintNS:Print... # Edit menu # +CutNS:Cut CopyNS:Copy PasteNS:Paste SelectAllNS:Select all diff --git a/!NetSurf/Resources/fr/Messages b/!NetSurf/Resources/fr/Messages index c8a6dfa39..65200c708 100644 --- a/!NetSurf/Resources/fr/Messages +++ b/!NetSurf/Resources/fr/Messages @@ -252,6 +252,7 @@ PrintNS:Print... # Edit menu # +CutNS:Cut CopyNS:Copy PasteNS:Paste SelectAllNS:Select all diff --git a/!NetSurf/Resources/it/Messages b/!NetSurf/Resources/it/Messages index f25a7555d..d5ff215d2 100755 --- a/!NetSurf/Resources/it/Messages +++ b/!NetSurf/Resources/it/Messages @@ -254,6 +254,7 @@ PrintNS:Stampa... # Edit menu # +CutNS:Cut CopyNS:Copia PasteNS:Incolla SelectAllNS:Seleziona tutto diff --git a/!NetSurf/Resources/nl/Messages b/!NetSurf/Resources/nl/Messages index 007ddb497..1f08690ec 100644 --- a/!NetSurf/Resources/nl/Messages +++ b/!NetSurf/Resources/nl/Messages @@ -252,6 +252,7 @@ PrintNS:Print... # Edit menu # +CutNS:Cut CopyNS:Copy PasteNS:Paste SelectAllNS:Select all diff --git a/amiga/clipboard.c b/amiga/clipboard.c index 04198c984..01b813667 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -17,21 +17,26 @@ */ #include "desktop/gui.h" +#include "utils/utf8.h" +#include "desktop/selection.h" + #include "amiga/iff_cset.h" -#include <proto/iffparse.h> -#include <datatypes/textclass.h> #include "amiga/options.h" #include "amiga/gui.h" -#include <proto/exec.h> #include "amiga/utf8.h" -#include "utils/utf8.h" -#include "desktop/selection.h" -#include <datatypes/pictureclass.h> -#include <proto/datatypes.h> #include "amiga/bitmap.h" #include "amiga/iff_dr2d.h" +#include "amiga/menu.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> struct IFFHandle *iffh = NULL; @@ -54,6 +59,24 @@ void ami_clipboard_free(void) void gui_start_selection(struct gui_window *g) { + if(!g) return; + if(!g->shared->win) return; + + OnMenu(g->shared->win, AMI_MENU_CLEAR); + OnMenu(g->shared->win, AMI_MENU_COPY); + + if(selection_read_only(g->shared->bw->sel) == false) + OnMenu(g->shared->win, AMI_MENU_CUT); +} + +void gui_clear_selection(struct gui_window *g) +{ + if(!g) return; + if(!g->shared->win) return; + + OffMenu(g->shared->win, AMI_MENU_CLEAR); + OffMenu(g->shared->win, AMI_MENU_CUT); + OffMenu(g->shared->win, AMI_MENU_COPY); } void gui_paste_from_clipboard(struct gui_window *g, int x, int y) @@ -109,6 +132,7 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y) bool gui_empty_clipboard(void) { + return true; } bool gui_add_to_clipboard(const char *text, size_t length, bool space) diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 704bd8c0c..6a53248ec 100755 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -32,6 +32,7 @@ #include "utils/utils.h" #include <proto/asl.h> #include "desktop/textinput.h" +#include "desktop/selection.h" #include "amiga/bitmap.h" #include "amiga/iff_dr2d.h" @@ -53,8 +54,11 @@ void ami_context_menu_init(void) ctxmenulab[CMID_URLOPENWIN] = ami_utf8_easy((char *)messages_get("LinkNewWin")); ctxmenulab[CMID_URLOPENTAB] = ami_utf8_easy((char *)messages_get("LinkNewTab")); + ctxmenulab[CMID_SELCUT] = ami_utf8_easy((char *)messages_get("CutNS")); ctxmenulab[CMID_SELCOPY] = ami_utf8_easy((char *)messages_get("CopyNS")); + ctxmenulab[CMID_SELPASTE] = ami_utf8_easy((char *)messages_get("PasteNS")); ctxmenulab[CMID_SELALL] = ami_utf8_easy((char *)messages_get("SelectAllNS")); + ctxmenulab[CMID_SELCLEAR] = ami_utf8_easy((char *)messages_get("ClearNS")); ctxmenulab[CMSUB_OBJECT] = ami_utf8_easy((char *)messages_get("Object")); ctxmenulab[CMSUB_URL] = ami_utf8_easy((char *)messages_get("Link")); @@ -170,20 +174,38 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) if(curbox->text) { + BOOL disabled_readonly = selection_read_only(gwin->bw->sel); + BOOL disabled_noselection = !selection_defined(gwin->bw->sel); + IDoMethod(gwin->objects[OID_MENU],PM_INSERT, NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMSUB_SEL], - PMSIMPLESUB, + PMIA_SubMenu, NewObject(POPUPMENU_GetClass(), NULL, + PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, + PMIA_Title, (ULONG)ctxmenulab[CMID_SELCUT], + PMIA_ID,CMID_SELCUT, + PMIA_Disabled, disabled_noselection && disabled_readonly, + TAG_DONE), PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMID_SELCOPY], PMIA_ID,CMID_SELCOPY, - //PMIA_UserData,curbox->href, + PMIA_Disabled, disabled_noselection, + TAG_DONE), + PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, + PMIA_Title, (ULONG)ctxmenulab[CMID_SELPASTE], + PMIA_ID,CMID_SELPASTE, + PMIA_Disabled, (gwin->bw->window->c_h == 0), TAG_DONE), PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMID_SELALL], PMIA_ID,CMID_SELALL, //PMIA_UserData,curbox->href, TAG_DONE), + PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, + PMIA_Title, (ULONG)ctxmenulab[CMID_SELCLEAR], + PMIA_ID,CMID_SELALL, + PMIA_Disabled, disabled_noselection, + TAG_DONE), TAG_DONE), TAG_DONE), ~0); @@ -362,14 +384,27 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) } break; + case CMID_SELCUT: + browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); + browser_window_key_press(gwin->bw, KEY_CUT_SELECTION); + break; + case CMID_SELCOPY: browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); break; + case CMID_SELPASTE: + browser_window_key_press(gwin->bw, KEY_PASTE); + break; + case CMID_SELALL: browser_window_key_press(gwin->bw, KEY_SELECT_ALL); break; + + case CMID_SELCLEAR: + browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); + break; } } diff --git a/amiga/context_menu.h b/amiga/context_menu.h index a4d509931..579c59eb6 100755 --- a/amiga/context_menu.h +++ b/amiga/context_menu.h @@ -32,7 +32,10 @@ enum { CMID_SAVEOBJ, CMID_SAVEIFFOBJ, CMID_SELALL, + CMID_SELCLEAR, + CMID_SELCUT, CMID_SELCOPY, + CMID_SELPASTE, CMSUB_OBJECT, CMSUB_URL, CMSUB_SEL, diff --git a/amiga/download.c b/amiga/download.c index 712689b10..0edd9c166 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -336,7 +336,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c, void gui_drag_save_selection(struct selection *s, struct gui_window *g) { - if(strcmp(option_use_pubscreen,"Workbench")) return; +// if(strcmp(option_use_pubscreen,"Workbench")) return; gui_window_set_pointer(g,AMI_GUI_POINTER_DRAG); drag_save_data = s; @@ -364,6 +364,9 @@ void ami_drag_save(struct Window *win) } else if(which == WBO_NONE) { + if(drag_save == GUI_SAVE_TEXT_SELECTION) + ami_drag_selection((struct selection *)drag_save_data); + drag_save = 0; drag_save_data = NULL; return; diff --git a/amiga/filetype.c b/amiga/filetype.c index dbb3f9981..89500edc7 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -103,6 +103,10 @@ const char *fetch_filetype(const char *unix_path) break; case GID_PICTURE: sprintf(mimetype,"image/%s",dth->dth_BaseName); + if(strcmp("sprite",dth->dth_BaseName)==0) + { + strcpy(mimetype,"image/x-riscos-sprite"); + } break; case GID_ANIMATION: case GID_MOVIE: diff --git a/amiga/gui.c b/amiga/gui.c index a3200bc18..82a3a428d 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1291,10 +1291,16 @@ void ami_handle_msg(void) browser_window_key_press(gwin->bw, KEY_SELECT_ALL); break; + case 'x': + browser_window_key_press(gwin->bw, KEY_CUT_SELECTION); + browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); + break; + case 'c': browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); break; + case 'v': browser_window_key_press(gwin->bw, KEY_PASTE); break; @@ -3615,6 +3621,8 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height) g->c_x = x; g->c_y = y; g->c_h = height; + + OnMenu(g->shared->win, AMI_MENU_PASTE); } void gui_window_remove_caret(struct gui_window *g) @@ -3624,6 +3632,8 @@ void gui_window_remove_caret(struct gui_window *g) if(!g) return; + OffMenu(g->shared->win, AMI_MENU_PASTE); + GetAttr(SPACE_AreaBox, g->shared->objects[GID_BROWSER], (ULONG *)&bbox); ami_get_hscroll_pos(g->shared, (ULONG *)&xs); ami_get_vscroll_pos(g->shared, (ULONG *)&ys); @@ -3772,3 +3782,78 @@ uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved) return itemid; } +/* Below two are more suited to clipboard.c but use some functions internal to gui.c, + so we put them here. */ + +bool ami_drag_selection_paste(const char *text, size_t length, struct box *box, + void *handle, const char *whitespace_text,size_t whitespace_length) +{ + struct browser_window *bw = handle; + +printf("dspaste\n"); + + if(whitespace_text) + { + browser_window_paste_text(bw, whitespace_text, whitespace_length, true); + } + + if(text) + { + browser_window_paste_text(bw, text, length, true); + } + + return true; +} + +void ami_drag_selection(struct selection *s) +{ + struct gui_window *g = s->bw->window; + struct IBox *bbox; + ULONG x,y,xs,ys,width,height; + struct box *box,*text_box=0; + hlcache_handle *content; + int box_x=0,box_y=0; + + GetAttr(SPACE_AreaBox, (Object *)g->shared->objects[GID_BROWSER], + (ULONG *)&bbox); + + ami_get_hscroll_pos(g->shared, (ULONG *)&xs); + x = (s->bw->window->shared->win->MouseX) - (bbox->Left) +xs; + + ami_get_vscroll_pos(g->shared, (ULONG *)&ys); + y = (s->bw->window->shared->win->MouseY) - bbox->Top + ys; + + width=bbox->Width; + height=bbox->Height; + + content = s->bw->current_content; + box = html_get_box_tree(content); + while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) + { + if (box->style && css_computed_visibility(box->style) == CSS_VISIBILITY_HIDDEN) continue; + + if (box->gadget) + { + switch (box->gadget->type) + { + case GADGET_TEXTBOX: + case GADGET_TEXTAREA: + case GADGET_PASSWORD: + text_box = box; + break; + + default: + break; + } + } + } + + if(text_box) + { + if(gui_copy_to_clipboard(s)) + { + browser_window_mouse_click(s->bw, BROWSER_MOUSE_PRESS_1, x, y); + browser_window_key_press(s->bw, KEY_PASTE); + } + } +} diff --git a/amiga/gui.h b/amiga/gui.h index e9944dda8..a291649f0 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -128,6 +128,8 @@ void ami_quit_netsurf(void); void ami_do_redraw(struct gui_window_2 *g); STRPTR ami_locale_langs(void); +void ami_drag_selection(struct selection *s); + struct TextFont *origrpfont; struct MinList *window_list; struct Screen *scrn; diff --git a/amiga/menu.c b/amiga/menu.c index 37e6b9ab1..c692c6983 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -95,27 +95,29 @@ void ami_init_menulabs(void) menulab[17] = ami_utf8_easy((char *)messages_get("About")); menulab[18] = ami_utf8_easy((char *)messages_get("Quit")); menulab[19] = ami_utf8_easy((char *)messages_get("Edit")); - menulab[20] = ami_utf8_easy((char *)messages_get("CopyNS")); - menulab[21] = ami_utf8_easy((char *)messages_get("PasteNS")); - menulab[22] = ami_utf8_easy((char *)messages_get("SelectAllNS")); - menulab[23] = ami_utf8_easy((char *)messages_get("ClearNS")); - menulab[24] = ami_utf8_easy((char *)messages_get("Browser")); - menulab[25] = ami_utf8_easy((char *)messages_get("FindTextNS")); - menulab[26] = NM_BARLABEL; - menulab[27] = ami_utf8_easy((char *)messages_get("HistLocalNS")); - menulab[28] = ami_utf8_easy((char *)messages_get("HistGlobalNS")); - menulab[29] = NM_BARLABEL; - menulab[30] = ami_utf8_easy((char *)messages_get("ShowCookies")); + menulab[20] = ami_utf8_easy((char *)messages_get("CutNS")); + menulab[21] = ami_utf8_easy((char *)messages_get("CopyNS")); + menulab[22] = ami_utf8_easy((char *)messages_get("PasteNS")); + menulab[23] = NM_BARLABEL; + menulab[24] = ami_utf8_easy((char *)messages_get("SelectAllNS")); + menulab[25] = ami_utf8_easy((char *)messages_get("ClearNS")); + menulab[26] = ami_utf8_easy((char *)messages_get("Browser")); + menulab[27] = ami_utf8_easy((char *)messages_get("FindTextNS")); + menulab[28] = NM_BARLABEL; + menulab[29] = ami_utf8_easy((char *)messages_get("HistLocalNS")); + menulab[30] = ami_utf8_easy((char *)messages_get("HistGlobalNS")); menulab[31] = NM_BARLABEL; - menulab[32] = ami_utf8_easy((char *)messages_get("ScaleNS")); - menulab[33] = ami_utf8_easy((char *)messages_get("ScaleDec")); - menulab[34] = ami_utf8_easy((char *)messages_get("ScaleNorm")); - menulab[35] = ami_utf8_easy((char *)messages_get("ScaleInc")); - menulab[36] = ami_utf8_easy((char *)messages_get("Redraw")); - menulab[37] = ami_utf8_easy((char *)messages_get("Hotlist")); - menulab[38] = ami_utf8_easy((char *)messages_get("HotlistAdd")); - menulab[39] = ami_utf8_easy((char *)messages_get("HotlistShowNS")); - menulab[40] = NM_BARLABEL; + menulab[32] = ami_utf8_easy((char *)messages_get("ShowCookies")); + menulab[33] = NM_BARLABEL; + menulab[34] = ami_utf8_easy((char *)messages_get("ScaleNS")); + menulab[35] = ami_utf8_easy((char *)messages_get("ScaleDec")); + menulab[36] = ami_utf8_easy((char *)messages_get("ScaleNorm")); + menulab[37] = ami_utf8_easy((char *)messages_get("ScaleInc")); + menulab[38] = ami_utf8_easy((char *)messages_get("Redraw")); + menulab[39] = ami_utf8_easy((char *)messages_get("Hotlist")); + menulab[40] = ami_utf8_easy((char *)messages_get("HotlistAdd")); + menulab[41] = ami_utf8_easy((char *)messages_get("HotlistShowNS")); + menulab[42] = NM_BARLABEL; menulab[AMI_MENU_HOTLIST_MAX] = ami_utf8_easy((char *)messages_get("Settings")); menulab[AMI_MENU_HOTLIST_MAX+1] = ami_utf8_easy((char *)messages_get("SettingsEdit")); @@ -152,8 +154,10 @@ struct NewMenu *ami_create_menu(ULONG type) { NM_ITEM,0,"?",0,0,0,}, // about { NM_ITEM,0,"Q",0,0,0,}, // quit {NM_TITLE,0,0,0,0,0,}, // edit + { NM_ITEM,0,"X",0,0,0,}, // cut { NM_ITEM,0,"C",0,0,0,}, // copy { NM_ITEM,0,"V",0,0,0,}, // paste + { NM_ITEM,NM_BARLABEL,0,0,0,0,}, { NM_ITEM,0,"A",0,0,0,}, // select all { NM_ITEM,0,"Z",0,0,0,}, // clear selection {NM_TITLE,0,0,0,0,0,}, // browser @@ -629,7 +633,12 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) case 1: // edit switch(itemnum) { - case 0: // copy + case 0: // cut + browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); + browser_window_key_press(gwin->bw, KEY_CUT_SELECTION); + break; + + case 1: // copy if(content_get_type(gwin->bw->current_content) <= CONTENT_CSS) { browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); @@ -649,16 +658,16 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) #endif break; - case 1: // paste + case 2: // paste browser_window_key_press(gwin->bw, KEY_PASTE); //gui_paste_from_clipboard(&tgw,0,0); break; - case 2: // select all + case 4: // select all browser_window_key_press(gwin->bw, KEY_SELECT_ALL); break; - case 3: // clear selection + case 5: // clear selection browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); break; } @@ -824,6 +833,10 @@ static const ULONG ami_asl_mime_hook(struct Hook *mh,struct FileRequester *fr,st void ami_menu_update_disabled(struct Window *win, hlcache_handle *c) { + OffMenu(win,AMI_MENU_CUT); + OffMenu(win,AMI_MENU_CLEAR); + OffMenu(win,AMI_MENU_PASTE); // c_h + if(content_get_type(c) <= CONTENT_CSS) { OnMenu(win,AMI_MENU_SAVEAS_TEXT); @@ -831,10 +844,8 @@ void ami_menu_update_disabled(struct Window *win, hlcache_handle *c) #ifdef WITH_PDF_EXPORT OnMenu(win,AMI_MENU_SAVEAS_PDF); #endif - OnMenu(win,AMI_MENU_COPY); - OnMenu(win,AMI_MENU_PASTE); + OffMenu(win,AMI_MENU_COPY); OnMenu(win,AMI_MENU_SELECTALL); - OnMenu(win,AMI_MENU_CLEAR); OnMenu(win,AMI_MENU_FIND); OffMenu(win,AMI_MENU_SAVEAS_IFF); } diff --git a/amiga/menu.h b/amiga/menu.h index 546acfe83..0934a68c9 100755 --- a/amiga/menu.h +++ b/amiga/menu.h @@ -28,10 +28,10 @@ /* Maximum number of menu items - first value is number of static items * (ie. everything not intially defined as NM_IGNORE) */ -#define AMI_MENU_MAX 49 + AMI_HOTLIST_ITEMS +#define AMI_MENU_MAX 51 + AMI_HOTLIST_ITEMS /* Where the hotlist entries start */ -#define AMI_MENU_HOTLIST 41 +#define AMI_MENU_HOTLIST 43 /* Where the hotlist entries end */ #define AMI_MENU_HOTLIST_MAX AMI_MENU_HOTLIST+AMI_HOTLIST_ITEMS @@ -54,10 +54,11 @@ #define AMI_MENU_SAVEAS_PDF FULLMENUNUM(0,4,3) #define AMI_MENU_SAVEAS_IFF FULLMENUNUM(0,4,4) #define AMI_MENU_CLOSETAB FULLMENUNUM(0,6,0) -#define AMI_MENU_COPY FULLMENUNUM(1,0,0) -#define AMI_MENU_PASTE FULLMENUNUM(1,1,0) -#define AMI_MENU_SELECTALL FULLMENUNUM(1,2,0) -#define AMI_MENU_CLEAR FULLMENUNUM(1,3,0) +#define AMI_MENU_CUT FULLMENUNUM(1,0,0) +#define AMI_MENU_COPY FULLMENUNUM(1,1,0) +#define AMI_MENU_PASTE FULLMENUNUM(1,2,0) +#define AMI_MENU_SELECTALL FULLMENUNUM(1,4,0) +#define AMI_MENU_CLEAR FULLMENUNUM(1,5,0) #define AMI_MENU_FIND FULLMENUNUM(2,0,0) char *menulab[AMI_MENU_MAX+1]; diff --git a/beos/beos_window.cpp b/beos/beos_window.cpp index 23c63635f..8708cd2bd 100644 --- a/beos/beos_window.cpp +++ b/beos/beos_window.cpp @@ -1783,6 +1783,10 @@ void gui_start_selection(struct gui_window *g) g->view->UnlockLooper(); } +void gui_clear_selection(struct gui_window *g) +{ +} + void gui_paste_from_clipboard(struct gui_window *g, int x, int y) { BMessage *clip; diff --git a/desktop/gui.h b/desktop/gui.h index ba5912ae7..abfb413cc 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -117,6 +117,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *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_clear_selection(struct gui_window *g); void gui_paste_from_clipboard(struct gui_window *g, int x, int y); bool gui_empty_clipboard(void); diff --git a/desktop/selection.c b/desktop/selection.c index dc66fef91..5962a8f36 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -703,6 +703,8 @@ void selection_clear(struct selection *s, bool redraw) s->start_idx = 0; s->end_idx = 0; + gui_clear_selection(s->bw->window); + if (redraw && was_defined) selection_redraw(s, old_start, old_end); } diff --git a/framebuffer/gui.c b/framebuffer/gui.c index ab1e65cbb..f4ed2bd19 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1454,6 +1454,11 @@ gui_start_selection(struct gui_window *g) } void +gui_clear_selection(struct gui_window *g) +{ +} + +void gui_paste_from_clipboard(struct gui_window *g, int x, int y) { } diff --git a/gtk/gtk_selection.c b/gtk/gtk_selection.c index 8e2bbf46d..334b552e5 100644 --- a/gtk/gtk_selection.c +++ b/gtk/gtk_selection.c @@ -82,6 +82,10 @@ void gui_start_selection(struct gui_window *g) gtk_widget_grab_focus(GTK_WIDGET(nsgtk_window_get_layout(g))); } +void gui_clear_selection(struct gui_window *g) +{ +} + void gui_paste_from_clipboard(struct gui_window *g, int x, int y) { gchar *text; diff --git a/riscos/textselection.c b/riscos/textselection.c index 661f9b9af..659169741 100644 --- a/riscos/textselection.c +++ b/riscos/textselection.c @@ -249,6 +249,17 @@ bool gui_empty_clipboard(void) /** + * Perform tasks after a selection has been cleared. + * + * \param g gui window + */ + +void gui_clear_selection(struct gui_window *g) +{ +} + + +/** * Add some text to the clipboard, optionally appending a trailing space. * * \param text text to be added diff --git a/windows/gui.c b/windows/gui.c index 7f2519196..99e904071 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -2183,6 +2183,10 @@ void gui_start_selection(struct gui_window *w) { } +void gui_clear_selection(struct gui_window *w) +{ +} + void gui_paste_from_clipboard(struct gui_window *w, int x, int y) { HANDLE clipboard_handle; |