Browser 5.49 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/***************************************************/
/* File   : Browser.h                              */
17
/*                                                 */
18
/* Purpose: Browser window services.               */
19
/*                                                 */
20
/* Author : A.D.Hodgkinson                         */
21 22
/*                                                 */
/* History: 15-Mar-97: Created from Windows.h.     */
23 24 25 26 27 28 29 30
/***************************************************/

/* Definitions */

/* CanBeSelected will be non-zero if the token may be selected in some way */
/* (e.g. by drawing a box around it, changing its colour, etc.) and has    */
/* some defined action if clicked on.                                      */

Kevin Bracey's avatar
Kevin Bracey committed
31 32
#define CanBeSelected(t) (                                            \
                           ISLINK(t) ||                               \
33 34
                           (t)->tagno == TAG_TEXTAREA ||              \
                           (t)->tagno == TAG_SELECT   ||              \
Kevin Bracey's avatar
Kevin Bracey committed
35
                           (                                          \
36
                             ((t)->tagno == TAG_INPUT) &&             \
Kevin Bracey's avatar
Kevin Bracey committed
37 38
                             (HtmlINPUTtype(t) != inputtype_HIDDEN)   \
                           )                                          \
39 40 41 42 43 44 45 46 47 48 49 50 51 52
                         )

/* Function prototypes */

_kernel_oserror * browser_scroll_page_v           (browser_data * b, WimpOpenWindowBlock * o, int dir, int page, int line, int amount, int * limit);
_kernel_oserror * browser_scroll_page_h           (browser_data * b, WimpOpenWindowBlock * o, int dir, int page, int line, int amount, int * limit);
_kernel_oserror * browser_scroll_page_by_key      (browser_data * b, int key, int * limit);

HStream         * browser_find_first_selectable   (browser_data * b, WimpGetWindowStateBlock * s, int dir);
HStream         * browser_find_another_selectable (browser_data * b, HStream * token, int dir, int horiz);
int               browser_move_selection          (browser_data * b, int key);

char            * browser_fetch_url               (browser_data * b);
char            * browser_current_url             (browser_data * b);
53
char            * browser_current_title           (browser_data * b);
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82

void              browser_destroy_source          (browser_data * b);

int               browser_pointer_entering        (int eventcode, WimpPollBlock * block, IdBlock * idb, void * handle);
int               browser_pointer_leaving         (int eventcode, WimpPollBlock * block, IdBlock * idb, void * handle);
void              browser_pointer_over_deleted    (browser_data * b);
int               browser_pointer_check           (int eventcode, WimpPollBlock * b, IdBlock * idb, browser_data * handle);
HStream         * browser_get_pointer_token       (browser_data * b, WimpGetPointerInfoBlock * p, int * ox, int * oy);

int               browser_line_at_y               (browser_data * b, reformat_cell * cell, int y);
int               browser_top_line                (browser_data * b, reformat_cell ** ret_cell, WimpGetWindowStateBlock * s, int fully_visible);
int               browser_bottom_line             (browser_data * b, reformat_cell ** ret_cell, WimpGetWindowStateBlock * s, int fully_visible);

_kernel_oserror * browser_update                  (browser_data * b, WimpRedrawWindowBlock * r, int noback, HStream * nocontent);
_kernel_oserror * browser_update_token            (browser_data * b, HStream * token, int noback, HStream * nocontent);
_kernel_oserror * browser_update_bottom           (browser_data * b, int top_y);

void              browser_highlight_token         (browser_data * b, HStream * token);
void              browser_clear_highlight         (browser_data * b, int wait);
void              browser_flash_token             (browser_data * b, HStream * token);
void              browser_select_token            (browser_data * b, HStream * token, int visible);
void              browser_clear_selection         (browser_data * b, int wait);

int               browser_show_token              (browser_data * b, HStream * token, int offset);
int               browser_ensure_visible          (browser_data * b, WimpGetWindowStateBlock * state, HStream * token);
int               browser_check_visible           (browser_data * b, WimpGetWindowStateBlock * state, HStream * token);
void              browser_show_named_anchor       (browser_data * b, char * anchor);
int               browser_display_local_reference (browser_data * b, char * url_requested, char * url_current);

83
_kernel_oserror * browser_set_look                (browser_data * b, ObjectId source, int underline_links, int use_source_cols, int show_foreground, int show_background);
84

85
_kernel_oserror * browser_give_general_focus      (browser_data * b);
86 87

_kernel_oserror * browser_inherit                 (browser_data * parent, browser_data * child);
88
_kernel_oserror * browser_inherit_post_data       (browser_data * parent, browser_data * child);