Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
  3.  * Copyright 2006 James Bursa <bursa@users.sourceforge.net>
  4.  *
  5.  * This file is part of NetSurf, http://www.netsurf-browser.org/
  6.  *
  7.  * NetSurf is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; version 2 of the License.
  10.  *
  11.  * NetSurf is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  */
  19.  
  20. /** \file
  21.  * Browser window private structure.
  22.  */
  23.  
  24. #ifndef _NETSURF_DESKTOP_BROWSER_PRIVATE_H_
  25. #define _NETSURF_DESKTOP_BROWSER_PRIVATE_H_
  26.  
  27. #include <stdbool.h>
  28.  
  29. #include "desktop/browser.h"
  30.  
  31.  
  32. struct box;
  33. struct hlcache_handle;
  34. struct gui_window;
  35. struct history;
  36. struct selection;
  37.  
  38. /** Browser window data. */
  39. struct browser_window {
  40.         /** Page currently displayed, or 0. Must have status READY or DONE. */
  41.         struct hlcache_handle *current_content;
  42.         /** Page being loaded, or 0. */
  43.         struct hlcache_handle *loading_content;
  44.  
  45.         /** Page Favicon */
  46.         struct hlcache_handle *current_favicon;
  47.         /** handle for favicon which we started loading early */
  48.         struct hlcache_handle *loading_favicon;
  49.         /** favicon fetch already failed - prevents infinite error looping */
  50.         bool failed_favicon;
  51.  
  52.         /** Window history structure. */
  53.         struct history *history;
  54.  
  55.         /** Handler for keyboard input, or 0. */
  56.         browser_caret_callback caret_callback;
  57.         /** Handler for pasting text, or 0. */
  58.         browser_paste_callback paste_callback;
  59.         /** Handler for repositioning caret, or 0. */
  60.         browser_move_callback move_callback;
  61.  
  62.         /** User parameters for caret_callback, paste_callback, and
  63.          *  move_callback */
  64.         void *caret_p1;
  65.         void *caret_p2;
  66.  
  67.         /** Platform specific window data. */
  68.         struct gui_window *window;
  69.  
  70.         /** Busy indicator is active. */
  71.         bool throbbing;
  72.         /** Add loading_content to the window history when it loads. */
  73.         bool history_add;
  74.  
  75.         /** Fragment identifier for current_content. */
  76.         lwc_string *frag_id;
  77.  
  78.         /** Current drag status. */
  79.         browser_drag_type drag_type;
  80.  
  81.         /** Current drag's browser window, when not in root bw. */
  82.         struct browser_window *drag_window;
  83.  
  84.         /** Mouse position at start of current scroll drag. */
  85.         int drag_start_x;
  86.         int drag_start_y;
  87.         /** Scroll offsets at start of current scroll draw. */
  88.         int drag_start_scroll_x;
  89.         int drag_start_scroll_y;
  90.         /** Frame resize directions for current frame resize drag. */
  91.         unsigned int drag_resize_left : 1;
  92.         unsigned int drag_resize_right : 1;
  93.         unsigned int drag_resize_up : 1;
  94.         unsigned int drag_resize_down : 1;
  95.  
  96.         /** Current fetch is download */
  97.         bool download;
  98.  
  99.         /** Refresh interval (-1 if undefined) */
  100.         int refresh_interval;
  101.  
  102.         /** Window has been resized, and content needs reformatting. */
  103.         bool reformat_pending;
  104.  
  105.         /** Window dimensions */
  106.         int x;
  107.         int y;
  108.         int width;
  109.         int height;
  110.  
  111.         struct scrollbar *scroll_x;  /**< Horizontal scroll. */
  112.         struct scrollbar *scroll_y;  /**< Vertical scroll. */
  113.  
  114.         /** scale of window contents */
  115.         float scale;
  116.  
  117.         /** Window characteristics */
  118.         enum {
  119.                 BROWSER_WINDOW_NORMAL,
  120.                 BROWSER_WINDOW_IFRAME,
  121.                 BROWSER_WINDOW_FRAME,
  122.                 BROWSER_WINDOW_FRAMESET,
  123.         } browser_window_type;
  124.  
  125.         /** frameset characteristics */
  126.         int rows;
  127.         int cols;
  128.  
  129.         /** frame dimensions */
  130.         struct frame_dimension frame_width;
  131.         struct frame_dimension frame_height;
  132.         int margin_width;
  133.         int margin_height;
  134.  
  135.         /** frame name for targetting */
  136.         char *name;
  137.  
  138.         /** frame characteristics */
  139.         bool no_resize;
  140.         frame_scrolling scrolling;
  141.         bool border;
  142.         colour border_colour;
  143.  
  144.         /** iframe parent box */
  145.         struct box *box;
  146.  
  147.         /** [cols * rows] children */
  148.         struct browser_window *children;
  149.         struct browser_window *parent;
  150.  
  151.         /** [iframe_count] iframes */
  152.         int iframe_count;
  153.         struct browser_window *iframes;
  154.  
  155.         /** browser window child of root browser window which has input focus */
  156.         struct browser_window *focus;
  157.  
  158.         /** Last time a link was followed in this window */
  159.         unsigned int last_action;
  160.  
  161.         /** Current selection, or NULL if none */
  162.         struct selection *cur_sel;
  163.  
  164.         /** Current context for free text search, or NULL if none */
  165.         struct search_context *cur_search;
  166.  
  167.         /** current javascript context */
  168.         struct jscontext *jsctx;
  169.  
  170.         /** cache of the currently displayed status text. */
  171.         char *status_text; /**< Current status bar text. */
  172.         int status_text_len; /**< Length of the browser_window::status_text buffer. */
  173.         int status_match; /**< Number of times an idempotent status-set operation was performed. */
  174.         int status_miss; /**< Number of times status was really updated. */
  175. };
  176.  
  177. #endif
  178.