Skip to content

Developer: Class Documentation

Ray Haleblian edited this page Jun 7, 2020 · 2 revisions

Summary

Members Descriptions
class App Main application.
class Book Encapsulates metadata and Page vector for a single book.
class Button A very simple button with a text label.
class Cache Homemade glyph cache.
class Page A Page stores the flowed output from the XML parse and is equipped to render a full left and right screen of text.
class Prefs
class Text Typesetter singleton that provides all text rendering services.
struct button_t
struct coord_t
struct epub_data_t
struct epub_item
struct epub_itemref
struct FT_Freeables
struct parsedata_t Expat parsing state.
struct TextCache_
struct TextFaceRec_
struct tm_unz_s
struct unz_file_info_s
struct unz_file_pos_s
struct unz_global_info_s
struct zlib_filefunc_def_s

class App

Main application.

\detail Top-level singleton class that handles application initialization, interaction loop, drawing everything but text, and logging.

Summary

Members Descriptions
public Text*ts
public Prefs myprefs
public Prefs*prefs
public u8 brightness
public u8 mode 4 levels for the Lite.
public string fontdir Are we in book or browser mode?
public bool console Default location to search for TTFs.
public u16 up
public u16 down
public u16 left
public u16 right
public u16 l
public u16 r
public u16 a
public u16 b
public u16 x
public u16 y
public u16 start
public u16 select
public uint32 downrepeat
public struct App::@0 key Can we print to console at the moment?
public vector< Button* >buttons
public Button buttonprev
public Button buttonnext
public Button buttonprefs
public u8 browserstart index into book vector denoting first book visible on library screen.
public string bookdir
public vector< Book* >books Search here for XHTML.
public u8 bookcount
public Book*bookselected which book is currently selected in browser?
public Book*bookcurrent which book is currently being read?
public bool reopen reopen book from last session on startup?
public bool cache Write baked text to cache?
public parsedata_t parsedata user data block passed to expat callbacks.
public vector< u16 > pageindices not used yet; will contain pagination indices for caching.
public u8 orientation
public u8 paraspacing
public u8 paraindent
public Button prefsButtonBooks
public Button prefsButtonFonts
public Button prefsButtonFont
public Button prefsButtonFontBold
public Button prefsButtonFontItalic
public Button prefsButtonFontSize
public Button prefsButtonParaspacing
public Button*prefsButtons
public u8 prefsSelected
public unsigned int fontSelected
public unsigned int fontPage
public vector< Button* >fontButtons
public App()
public ~App()
public void CycleBrightness() in App.cpp
public void PrintStatus(const char * msg)
public void PrintStatus(string msg)
public void Flip()
public void SetProgress(int amount)
public void UpdateClock()
public void Log(const char *)
public void Log(const char * format,const char * msg)
public void Log(const std::string)
public void Log(const char * format,const int value)
public int Run(void)
public bool parse_in(parsedata_t * data,context_t context)
public void parse_init(parsedata_t * data)
public context_t parse_pop(parsedata_t * data)
public void parse_error(XML_ParserStruct * ps)
public void parse_push(parsedata_t * data,context_t context)
public void HandleEventInBrowser() in App_Browser.cpp
public void browser_init(void)
public void browser_draw(void)
public void browser_nextpage(void)
public void browser_prevpage(void)
public void browser_redraw(void)
public void HandleEventInBook() in App_Book.cpp
public int GetBookIndex(Book *)
public void AttemptBookOpen()
public u8 OpenBook(void)
public void HandleEventInPrefs() in App_Prefs.cpps
public void PrefsInit()
public void PrefsDraw()
public void PrefsDraw(bool redraw)
public void PrefsButton()
public void PrefsIncreasePixelSize()
public void PrefsDecreasePixelSize()
public void PrefsIncreaseParaspacing()
public void PrefsDecreaseParaspacing()
public void PrefsRefreshButtonFont()
public void PrefsRefreshButtonFontBold()
public void PrefsRefreshButtonFontItalic()
public void PrefsRefreshButtonFontSize()
public void PrefsRefreshButtonParaspacing()
public void HandleEventInFont() in App_Font.cpp
public void FontInit()
public void FontDeinit()
public void FontDraw()
public void FontDraw(bool redraw)
public void FontNextPage()
public void FontPreviousPage()
public void FontButton()

Members

public Text*ts

public Prefs myprefs

public Prefs*prefs

public u8 brightness

public u8 mode

4 levels for the Lite.

public string fontdir

Are we in book or browser mode?

public bool console

Default location to search for TTFs.

public u16 up

public u16 down

public u16 left

public u16 right

public u16 l

public u16 r

public u16 a

public u16 b

public u16 x

public u16 y

public u16 start

public u16 select

public uint32 downrepeat

public struct App::@0 key

Can we print to console at the moment?

key functions are remappable to support screen flipping.

public vector< Button* >buttons

public u8 browserstart

index into book vector denoting first book visible on library screen.

Buttons on browser bottom.

public string bookdir

public vector< Book* >books

Search here for XHTML.

public u8 bookcount

which book is currently selected in browser?

public Book*bookcurrent

which book is currently being read?

public bool reopen

reopen book from last session on startup?

public bool cache

Write baked text to cache?

user data block passed to expat callbacks.

public vector< u16 > pageindices

not used yet; will contain pagination indices for caching.

public u8 orientation

public u8 paraspacing

public u8 paraindent

public u8 prefsSelected

public unsigned int fontSelected

public unsigned int fontPage

public vector< Button* >fontButtons

public App()

public ~App()

public void CycleBrightness()

in App.cpp

public void PrintStatus(const char * msg)

public void PrintStatus(string msg)

public void Flip()

public void SetProgress(int amount)

public void UpdateClock()

public void Log(const char *)

public void Log(const char * format,const char * msg)

public void Log(const std::string)

public void Log(const char * format,const int value)

public int Run(void)

public bool parse_in(parsedata_t * data,context_t context)

public void parse_init(parsedata_t * data)

public context_t parse_pop(parsedata_t * data)

public void parse_error(XML_ParserStruct * ps)

public void parse_push(parsedata_t * data,context_t context)

public void HandleEventInBrowser()

in App_Browser.cpp

public void browser_init(void)

public void browser_draw(void)

public void browser_nextpage(void)

public void browser_prevpage(void)

public void browser_redraw(void)

public void HandleEventInBook()

in App_Book.cpp

public int GetBookIndex(Book *)

public void AttemptBookOpen()

public u8 OpenBook(void)

public void HandleEventInPrefs()

in App_Prefs.cpps

public void PrefsInit()

public void PrefsDraw()

public void PrefsDraw(bool redraw)

public void PrefsButton()

public void PrefsIncreasePixelSize()

public void PrefsDecreasePixelSize()

public void PrefsIncreaseParaspacing()

public void PrefsDecreaseParaspacing()

public void PrefsRefreshButtonFont()

public void HandleEventInFont()

in App_Font.cpp

public void FontInit()

public void FontDeinit()

public void FontDraw()

public void FontDraw(bool redraw)

public void FontNextPage()

public void FontPreviousPage()

public void FontButton()

class Book

Encapsulates metadata and Page vector for a single book.

Bookmarks are in here too. App maintains a vector of Book to represent the available library.

Summary

Members Descriptions
public format_t format
public Book()
public ~Book()
public inline std::string * GetAuthor()
public std::list< u16 > * GetBookmarks(void)
public int GetNextBookmark(void)
public int GetPreviousBookmark(void)
public int GetNextBookmarkedPage(void)
public int GetPreviousBookmarkedPage(void)
public const char * GetFileName(void)
public const char * GetFolderName(void)
public Page*GetPage()
public Page*GetPage(int i)
public u16 GetPageCount()
public int GetPosition(void)
public int GetPosition(int offset)
public const char * GetTitle()
public void SetAuthor(std::string & s)
public void SetFileName(const char * filename)
public void SetFolderName(const char * foldername)
public void SetFolderName(std::string & foldername)
public void SetPage(u16 index)
public void SetPosition(int pos)
public void SetTitle(const char * title)
public Page*AppendPage()
public Page*AdvancePage()
public Page*RetreatPage()
public void Cache()
public void Close()
public u8 Index()
public void IndexHTML()
public u8 Open()
public u8 Parse(bool fulltext)
public int ParseHTML()
public void Restore()

Members

public format_t format

public Book()

public ~Book()

public inline std::string * GetAuthor()

public std::list< u16 > * GetBookmarks(void)

public int GetNextBookmark(void)

public int GetPreviousBookmark(void)

public int GetNextBookmarkedPage(void)

public int GetPreviousBookmarkedPage(void)

public const char * GetFileName(void)

public const char * GetFolderName(void)

public Page*GetPage()

public Page*GetPage(int i)

public u16 GetPageCount()

public int GetPosition(void)

public int GetPosition(int offset)

public const char * GetTitle()

public void SetAuthor(std::string & s)

public void SetFileName(const char * filename)

public void SetFolderName(const char * foldername)

public void SetFolderName(std::string & foldername)

public void SetPage(u16 index)

public void SetPosition(int pos)

public void SetTitle(const char * title)

public Page*AppendPage()

public Page*AdvancePage()

public Page*RetreatPage()

public void Cache()

public void Close()

public u8 Index()

public void IndexHTML()

public u8 Open()

public u8 Parse(bool fulltext)

public int ParseHTML()

public void Restore()

class Button

A very simple button with a text label.

Summary

Members Descriptions
public Button()
public Button(Text * typesetter)
public inline const char * GetLabel()
public void Init(Text * typesetter)
public void Label(const char * text)
public void SetLabel(std::string & s)
public void SetLabel2(std::string s) label on next line, used for author in the library screen.
public void Draw(u16 * fb,bool highlight)
public void Move(u16 x,u16 y)
public void Resize(u16 x,u16 y)
public bool EnclosesPoint(u16 x,u16 y)

Members

public Button()

public Button(Text * typesetter)

public inline const char * GetLabel()

public void Init(Text * typesetter)

public void Label(const char * text)

public void SetLabel(std::string & s)

public void SetLabel2(std::string s)

label on next line, used for author in the library screen.

public void Draw(u16 * fb,bool highlight)

public void Move(u16 x,u16 y)

public void Resize(u16 x,u16 y)

public bool EnclosesPoint(u16 x,u16 y)

class Cache

Homemade glyph cache.

Fetches from FreeType can be expensive, so keep advance and gylphs handy, keyed by UCS codepoint.

Summary

Members Descriptions
public map< u16, FT_GlyphSlot > cacheMap Associates each glyph cache index (value) with its Unicode code point (key).
public u16 cachenext ??
public inline Cache()

Members

public map< u16, FT_GlyphSlot > cacheMap

Associates each glyph cache index (value) with its Unicode code point (key).

public u16 cachenext

??

public inline Cache()

class Page

A Page stores the flowed output from the XML parse and is equipped to render a full left and right screen of text.

A Book contains a vector of Pages.

Summary

Members Descriptions
public u8 * buf UTF-8 chars, allocated per-page at parse time, to exact length.
public int length Length of buf.
public int start In a book-long char buffer, where would i begin?
public int end Ditto, for end char.
public Page(Book * b)
public Page(Book * b,Text * t)
public ~Page()
public inline u8 * GetBuffer()
public inline int GetLength()
public u8 SetBuffer(u8 * src,u16 len) Copy src to buf for len bytes.
public void Cache(FILE * fp)
public void Draw(Text * ts)

Members

public u8 * buf

UTF-8 chars, allocated per-page at parse time, to exact length.

public int length

Length of buf.

public int start

In a book-long char buffer, where would i begin?

public int end

Ditto, for end char.

public Page(Book * b)

public Page(Book * b,Text * t)

public ~Page()

public inline u8 * GetBuffer()

public inline int GetLength()

public u8 SetBuffer(u8 * src,u16 len)

Copy src to buf for len bytes.

public void Cache(FILE * fp)

public void Draw(Text * ts)

class Prefs

Summary

Members Descriptions
public App*app
public long modtime
public bool swapshoulder
public Prefs()
public Prefs(App * parent)
public ~Prefs()
public int Read()
public int Write()

Members

public App*app

public long modtime

public bool swapshoulder

public Prefs()

public Prefs(App * parent)

public ~Prefs()

public int Read()

public int Write()

class Text

Typesetter singleton that provides all text rendering services.

Implemented atop FreeType 2. Attempts to cache for draw performance using a homemade cache. The code using FreeType's cache is inoperative.

Summary

Members Descriptions
public App*app
public int pixelsize
public u8 r
public u8 g
public u8 b
public struct Text::@1 bgcolor Not used ... really.
public bool usebgcolor
public u16 * screen Pointers to screens and which one is current.
public u16 * screenleft
public u16 * screenright
public u16 * offscreen Offscreen buffer. Only used when OFFSCREEN defined.
public int left
public int right
public int top
public int bottom
public struct Text::@2 margin
public int width
public int height
public struct Text::@3 display
public int linespacing
public bool linebegan
public bool bold
public bool italic
public int stats_hits Total glyph cache hits.
public int stats_misses Total glyph cache misses.
public Text()
public inline Text(class App * parent)
public ~Text()
public int Init()
public void InitPen(void)
public void Begin()
public void End()
public u8 GetAdvance(u32 ucs)
public u8 GetAdvance(u32 ucs,u8 style)
public u8 GetCharCode(const char * txt,u32 * code)
public inline FT_Face GetFace()
public inline FT_Face GetFace(u8 style)
public string GetFontFile(u8 style)
public bool GetFontName(std::string & s)
public u8 GetHeight(void)
public bool GetInvert()
public void GetPen(u16 * x,u16 * y)
public void GetPen(u16 & x,u16 & y)
public u8 GetPenX()
public u8 GetPenY()
public u8 GetPixelSize()
public u16 * GetScreen()
public int GetStringAdvance(const char * txt)
public u8 GetStringWidth(const char * txt,u8 style)
public inline int GetStyle()
public void SetInvert(bool invert)
public void SetPen(u16 x,u16 y)
public void SetPixelSize(u8 size)
public bool SetFace(u8 style)
public void SetFontFile(const char * filename,u8 style)
public void SetScreen(u16 * s)
public inline void SetStyle(int astyle)
public void ClearCache()
public void ClearCache(u8 style)
public void ClearRect(u16 xl,u16 yl,u16 xh,u16 yh)
public void ClearScreen()
public void ClearScreen(u16 *,u8,u8,u8)
public void CopyScreen(u16 * src,u16 * dst)
public void SwapScreens()
public void PrintChar(u32 ucs)
public void PrintChar(u32 ucs,u8 style)
public bool PrintNewLine(void)
public void PrintStats()
public void PrintStatusMessage(const char * msg)
public void PrintString(const char * string)
public void PrintString(const char * string,u8 style)
public void PrintSplash(u16 * screen)

Members

public App*app

public int pixelsize

public u8 r

public u8 g

public u8 b

public struct Text::@1 bgcolor

Not used ... really.

public bool usebgcolor

public u16 * screen

Pointers to screens and which one is current.

public u16 * screenleft

public u16 * screenright

public u16 * offscreen

Offscreen buffer. Only used when OFFSCREEN defined.

public int left

public int right

public int top

public int bottom

public struct Text::@2 margin

public int width

public int height

public struct Text::@3 display

public int linespacing

public bool linebegan

public bool bold

public bool italic

public int stats_hits

Total glyph cache hits.

public int stats_misses

Total glyph cache misses.

public Text()

public inline Text(class App * parent)

public ~Text()

public int Init()

public void InitPen(void)

public void Begin()

public void End()

public u8 GetAdvance(u32 ucs)

public u8 GetAdvance(u32 ucs,u8 style)

public u8 GetCharCode(const char * txt,u32 * code)

public inline FT_Face GetFace()

public inline FT_Face GetFace(u8 style)

public string GetFontFile(u8 style)

public bool GetFontName(std::string & s)

public u8 GetHeight(void)

public bool GetInvert()

public void GetPen(u16 * x,u16 * y)

public void GetPen(u16 & x,u16 & y)

public u8 GetPenX()

public u8 GetPenY()

public u8 GetPixelSize()

public u16 * GetScreen()

public int GetStringAdvance(const char * txt)

public u8 GetStringWidth(const char * txt,u8 style)

public inline int GetStyle()

public void SetInvert(bool invert)

public void SetPen(u16 x,u16 y)

public void SetPixelSize(u8 size)

public bool SetFace(u8 style)

public void SetFontFile(const char * filename,u8 style)

public void SetScreen(u16 * s)

public inline void SetStyle(int astyle)

public void ClearCache()

public void ClearCache(u8 style)

public void ClearRect(u16 xl,u16 yl,u16 xh,u16 yh)

public void ClearScreen()

public void ClearScreen(u16 *,u8,u8,u8)

public void CopyScreen(u16 * src,u16 * dst)

public void SwapScreens()

public void PrintChar(u32 ucs)

public void PrintChar(u32 ucs,u8 style)

public bool PrintNewLine(void)

public void PrintStats()

public void PrintStatusMessage(const char * msg)

public void PrintString(const char * string)

public void PrintString(const char * string,u8 style)

public void PrintSplash(u16 * screen)

struct button_t

Summary

Members Descriptions
public coord_t origin
public coord_t extent
public u8 text

Members

public coord_t origin

public coord_t extent

public u8 text

struct coord_t

Summary

Members Descriptions
public u16 x
public u16 y

Members

public u16 x

public u16 y

struct epub_data_t

Summary

Members Descriptions
public epub_parse_t type
public vector< std::string * > ctx
public std::string rootfile
public std::vector< epub_item* >manifest
public std::vector< epub_itemref* >spine
public Book*book
public bool metadataonly
public std::string title
public std::string creator

Members

public epub_parse_t type

public vector< std::string * > ctx

public std::string rootfile

public std::vector< epub_item* >manifest

public std::vector< epub_itemref* >spine

public Book*book

public bool metadataonly

public std::string title

public std::string creator

struct epub_item

Summary

Members Descriptions
public std::string id
public std::string href

Members

public std::string id

public std::string href

struct epub_itemref

Summary

Members Descriptions
public std::string idref

Members

public std::string idref

struct FT_Freeables

Summary

Members Descriptions
public FT_Face face
public FT_Library library
public FTC_Manager manager

Members

public FT_Face face

public FT_Library library

public FTC_Manager manager

struct parsedata_t

Expat parsing state.

This data structure is made available to all expat callbacks via (void*)data.

Summary

Members Descriptions
public context_t stack
public u8 stacksize
public Book*book
public class Prefs*prefs
public int screen
public FT_Vector pen
public u8 buf
public FILE * cachefile
public int buflen
public int pos Our total parse position in terms of cooked text.
public bool linebegan
public bool bold
public bool italic
public int status
public int totalbytes
public int pagecount

Members

public context_t stack

public u8 stacksize

public Book*book

public class Prefs*prefs

public int screen

public FT_Vector pen

public u8 buf

public FILE * cachefile

public int buflen

public int pos

Our total parse position in terms of cooked text.

public bool linebegan

public bool bold

public bool italic

public int status

public int totalbytes

public int pagecount

struct TextCache_

Summary

Members Descriptions
public FTC_Manager manager
public FTC_CMapCache cmap
public FTC_ImageCache image
public FTC_SBitCache sbit

Members

public FTC_Manager manager

public FTC_CMapCache cmap

public FTC_ImageCache image

public FTC_SBitCache sbit

struct TextFaceRec_

Summary

Members Descriptions
public char file_path
public int face_index

Members

public char file_path

public int face_index

struct tm_unz_s

Summary

Members Descriptions
public uInt tm_sec
public uInt tm_min
public uInt tm_hour
public uInt tm_mday
public uInt tm_mon
public uInt tm_year

Members

public uInt tm_sec

public uInt tm_min

public uInt tm_hour

public uInt tm_mday

public uInt tm_mon

public uInt tm_year

struct unz_file_info_s

Summary

Members Descriptions
public uLong version
public uLong version_needed
public uLong flag
public uLong compression_method
public uLong dosDate
public uLong crc
public uLong compressed_size
public uLong uncompressed_size
public uLong size_filename
public uLong size_file_extra
public uLong size_file_comment
public uLong disk_num_start
public uLong internal_fa
public uLong external_fa
public tm_unz tmu_date

Members

public uLong version

public uLong version_needed

public uLong flag

public uLong compression_method

public uLong dosDate

public uLong crc

public uLong compressed_size

public uLong uncompressed_size

public uLong size_filename

public uLong size_file_extra

public uLong size_file_comment

public uLong disk_num_start

public uLong internal_fa

public uLong external_fa

public tm_unz tmu_date

struct unz_file_pos_s

Summary

Members Descriptions
public uLong pos_in_zip_directory
public uLong num_of_file

Members

public uLong pos_in_zip_directory

public uLong num_of_file

struct unz_global_info_s

Summary

Members Descriptions
public uLong number_entry
public uLong size_comment

Members

public uLong number_entry

public uLong size_comment

struct zlib_filefunc_def_s

Summary

Members Descriptions
public open_file_func zopen_file
public read_file_func zread_file
public write_file_func zwrite_file
public tell_file_func ztell_file
public seek_file_func zseek_file
public close_file_func zclose_file
public testerror_file_func zerror_file
public voidpf opaque

Members

public open_file_func zopen_file

public read_file_func zread_file

public write_file_func zwrite_file

public tell_file_func ztell_file

public seek_file_func zseek_file

public close_file_func zclose_file

public testerror_file_func zerror_file

public voidpf opaque

Generated by Moxygen

Clone this wiki locally