server/bufferiface

Search:
Group by:

Types

BufferCommand = enum
  bcCancel = "cancel", bcCheckRefresh = "checkRefresh", bcClick = "click",
  bcClone = "clone", bcContextMenu = "contextMenu",
  bcFindNextLink = "findNextLink", bcFindNextMatch = "findNextMatch",
  bcFindNextParagraph = "findNextParagraph", bcFindPrevLink = "findPrevLink",
  bcFindPrevMatch = "findPrevMatch", bcFindRevNthLink = "findRevNthLink",
  bcForceReshape = "forceReshape", bcGetLines = "getLines",
  bcGetLinks = "getLinks", bcGetSelectionText = "getSelectionText",
  bcGetTitle = "getTitle", bcGotoAnchor = "gotoAnchor",
  bcHideHints = "hideHints", bcLoad = "load", bcMarkURL = "markURL",
  bcOnReshape = "onReshape", bcReadCanceled = "readCanceled",
  bcReadSuccess = "readSuccess", bcSelect = "select", bcShowHints = "showHints",
  bcSubmitForm = "submitForm", bcToggleImages = "toggleImages",
  bcUpdateHover = "updateHover", bcWindowChange = "windowChange"
BufferConfig = object
  refererFrom*: bool
  styling*: bool
  scripting*: ScriptingMode
  images*: bool
  headless*: HeadlessMode
  autofocus*: bool
  history*: bool
  markLinks*: bool
  charsetOverride*: Charset
  metaRefresh*: MetaRefresh
  charsets*: seq[Charset]
  imageTypes*: Table[string, string]
  userAgent*: string
  referrer*: string
  userStyle*: string
BufferConnectionResult = enum
  bcrFail = "fail", bcrCancel = "cancel", bcrConnected = "connected",
  bcrSave = "save", bcrRedirect = "redirect", bcrUnauthorized = "unauthorized",
  bcrMailcap = "mailcap"
BufferIfaceItem = object
  id*: int
BufferInit = ref object of MapData
  config*: BufferConfig
  loaderConfig*: LoaderClientConfig
  filterCmd*: string
  contentType* {.jsget.}: string
  shortContentType* {.jsget.}: string
  loadInfo* {.jsgetset.}: string
  request*: Request
  url* {.jsget.}: URL
  cacheId* {.jsget.}: int
  width* {.jsgetset.}: int
  height* {.jsgetset.}: int
  connectionState*: ConnectDataState
  flags*: set[BufferInitFlag]
  charset*: Charset
  charsetStack*: seq[Charset]
  ostream*: PosixStream
  istreamOutputId*: int
  ostreamOutputId*: int
BufferInitFlag = enum
  bifSave, bifHTML, bifHistory, bifTailOnLoad, bifCrashed, bifHasStart,
  bifPendingStart, bifPartialStart, bifRedirected, bifMailcapCancel,
  bifForceType
BufferInterface = ref object of MapData
  numLines* {.jsget.}: int
  images*: seq[PosBitmap]
  hoverText*: array[HoverType, string]
  phandle*: ProcessHandle
  bgcolor*: CellColor
  redraw*: bool
  refreshStatus*: bool
  dead* {.jsget.}: bool
  loadState* {.jsgetset.}: LoadState
  init*: BufferInit
BufferMatch = object
  x*: int
  y*: int
  w*: int
BufferState = enum
  bsLoadingPage = "loadingPage", bsLoadingStyle = "loadingStyle",
  bsLoadingImages = "loadingImages", bsLoaded = "loaded"
CachedImage = ref object
  state*: CachedImageState
  width*: int
  height*: int
  data*: Blob
  cacheId*: int
  bmp*: NetworkBitmap
  offx*: int
  dispw*: int
  erry*: int
  transparent*: bool
  preludeLen*: int
CachedImageState = enum
  cisLoading, cisCanceled, cisLoaded
ClickResult = object
  case t*: ClickResultType
  of crtNone:
    nil
  of crtOpen:
    open*: Request
    contentType*: string
  of crtReadArea, crtReadText, crtReadPassword, crtReadFile:
    prompt*: string
    value*: string
  of crtSelect:
    options*: seq[SelectOption]
    selected*: int
ClickResultType = enum
  crtNone = "none", crtOpen = "open", crtReadText = "read-text",
  crtReadPassword = "read-password", crtReadArea = "read-area",
  crtReadFile = "read-file", crtSelect = "select"
CursorXY = object
  x*: int
  y*: int
GotoAnchorResult = object
  x*: int
  y*: int
  focus*: ClickResult
Highlight = ref object
  t* {.jsget.}: HighlightType
  selectionType* {.jsget.}: SelectionType
  mouse* {.jsget.}: bool
  x1*: int
  y1*: int
  x2* {.jsgetset.}: int
  y2* {.jsgetset.}: int
HighlightType = enum
  hltSearch, hltSelect
HoverType = enum
  htTitle, htLink, htImage, htCachedImage
IfaceResult = enum
  irOk, irException, irEOF
LoadResult = tuple[n: uint64, len: uint64, bs: BufferState]
LoadState = enum
  lsLoading = "loading", lsCanceled = "canceled", lsLoaded = "loaded"
PagePos = tuple[x: int, y: int]
ProcessHandle = ref object
  process*: int
  refc*: int
SelectionType = enum
  stNormal = "normal", stBlock = "block", stLine = "line"
UpdateHoverResult = seq[tuple[t: HoverType, s: string]]

Consts

ClickResultReadLine = {crtReadText, crtReadPassword, crtReadFile}

Procs

proc acursorx(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc acursory(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc addBufferInterfaceModule(ctx: JSContext): Opt[void] {....raises: [], tags: [],
    forbids: [].}
proc addCachedImage(iface: BufferInterface; image: CachedImage) {....raises: [],
    tags: [], forbids: [].}
proc applyResponse(init: BufferInit; response: Response;
                   mimeTypes: MimeTypesTable) {....raises: [],
    tags: [TimeEffect, RootEffect], forbids: [].}
proc atPercentOf(iface: BufferInterface): int {....raises: [], tags: [],
    forbids: [].}
proc cancel(iface: BufferInterface) {....raises: [], tags: [], forbids: [].}
proc clearCachedImages(iface: BufferInterface; loader: FileLoader) {....raises: [],
    tags: [], forbids: [].}
proc clearHover(iface: BufferInterface) {....raises: [], tags: [], forbids: [].}
proc clone(iface: BufferInterface; newurl: URL; pstreamFd: cint): Opt[void] {.
    ...raises: [], tags: [RootEffect], forbids: [].}
proc closeMailcap(init: BufferInit) {....raises: [], tags: [], forbids: [].}
proc connected(ctx: JSContext; init: BufferInit; res: BufferConnectionResult;
               arg1: JSValue): JSValue {....raises: [], tags: [], forbids: [].}
proc cursory(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc drawLines(iface: BufferInterface; display: var FixedGrid;
               hlcolor: CellColor) {....raises: [], tags: [], forbids: [].}
proc findCachedImage(iface: BufferInterface;
                     imageId, width, height, offx, erry, dispw: int): CachedImage {.
    ...raises: [], tags: [], forbids: [].}
proc findColBytes(s: string; endx: int; startx = 0; starti = 0): int {.
    ...raises: [], tags: [], forbids: [].}
proc flushWrite(iface: BufferInterface): bool {....raises: [], tags: [],
    forbids: [].}
proc fromx(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc fromy(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc getHoverText(iface: BufferInterface): string {....raises: [], tags: [],
    forbids: [].}
proc getPeekCursorStr(iface: BufferInterface): string {....raises: [], tags: [],
    forbids: [].}
proc handleCommand(ctx: JSContext; iface: BufferInterface): IfaceResult {.
    ...raises: [], tags: [RootEffect], forbids: [].}
proc highlightMarks(iface: BufferInterface; display: var FixedGrid;
                    hlcolor: CellColor) {....raises: [], tags: [], forbids: [].}
proc initClickResult(): ClickResult {....raises: [], tags: [], forbids: [].}
proc initClickResult(open: RawRequest; contentType = ""): ClickResult {.
    ...raises: [], tags: [], forbids: [].}
proc initClickResult(open: Request; contentType = ""): ClickResult {....raises: [],
    tags: [], forbids: [].}
proc initClickResult(options: seq[SelectOption]; selected: int): ClickResult {.
    ...raises: [], tags: [], forbids: [].}
proc newBufferInit(config: BufferConfig; loaderConfig: LoaderClientConfig;
                   url: URL; request: Request; attrs: WindowAttributes;
                   title: string; redirectDepth: int;
                   flags: set[BufferInitFlag]; contentType, filterCmd: string;
                   charsetStack: seq[Charset]): BufferInit {....raises: [],
    tags: [], forbids: [].}
proc newBufferInit(url: URL; init: BufferInit): BufferInit {....raises: [],
    tags: [], forbids: [].}
proc newBufferInterface(stream: PosixStream; loader: FileLoader;
                        phandle: ProcessHandle; attrsp: ptr WindowAttributes;
                        init: BufferInit): BufferInterface {....raises: [],
    tags: [], forbids: [].}
proc newProcessHandle(pid: int): ProcessHandle {....raises: [], tags: [],
    forbids: [].}
proc process(iface: BufferInterface): int {....raises: [], tags: [], forbids: [].}
proc queueDraw(iface: BufferInterface) {....raises: [], tags: [], forbids: [].}
proc requestLinesFast(iface: BufferInterface; force = false) {....raises: [],
    tags: [], forbids: [].}
proc requestLinesSync(ctx: JSContext; iface: BufferInterface;
                      handle: HandleReadLine): IfaceResult {....raises: [],
    tags: [RootEffect], forbids: [].}
proc sread(r: var PacketReader; x: var ClickResult) {....raises: [],
    tags: [RootEffect], forbids: [].}
proc swrite(w: var PacketWriter; x: ClickResult) {....raises: [],
    tags: [RootEffect], forbids: [].}
proc title(init: BufferInit): string {....raises: [], tags: [], forbids: [].}