nyctergatis.com

Contact

Projects
Sysquake Remote Live
NME
PDF
Hike
Sudoku
GifBuilder
jpeglib for Palm OS
MySQL Client
Cross-GCC for Mac OS

NMEGtk.h File Reference


Detailed Description

Support for GTK+ .

Author:
Yves Piguet. Copyright 2007-2008, Yves Piguet

Definition in file NMEGtk.h.

#include "NME.h"
#include "NMEStyle.h"
#include <gtk/gtk.h>

Go to the source code of this file.


Data Structures

struct  NMEGtkLinkCB
 Private structure. More...
struct  NMEGtk
 Private structure. More...

Defines

#define kMaxHeadingLevel   4
#define kMaxListLevel   4

Typedefs

typedef void(* NMEGtkLinkFun )(NMEConstText link, void *data)
 Callback to handle link clicks.

Functions

void NMEGtkInit (NMEGtk *nmegtk, GtkTextBuffer *textBuffer, int charSize)
 Initialize NMEGtk data structure.
void NMEGtkSetLinkFun (NMEGtk *nmegtk, NMEGtkLinkFun linkFun, void *linkFunData)
 Set the callback which processes clicks on links.
void NMEGtkApplyStyle (NMEGtk const *nmegtk, NMEStyleTable const *spanTable, NMEInt offset, NMEInt length, NMEConstText nmeTextForLinks)
 Apply styles collected by NMEStyle to a GTK+ text buffer.
NMEErr NMEGtkInsert (GtkTextBuffer *textBuffer, NMEGtk const *nmegtk, NMEConstText str, NMEInt len, NMEBoolean replaceSel, NMEBoolean links)
 Insert text with NME markup in a GtkTextBuffer, calling NMEGtkApplyStyle.

Typedef Documentation

typedef void(* NMEGtkLinkFun)(NMEConstText link, void *data)

Callback to handle link clicks.

Parameters:
[in] link raw link, as in NME source text, without leading and trailing spaces (null-terminated string)
[in,out] data data value specific to the callback

Definition at line 27 of file NMEGtk.h.


Function Documentation

void NMEGtkApplyStyle ( NMEGtk const *  nmegtk,
NMEStyleTable const *  spanTable,
NMEInt  offset,
NMEInt  length,
NMEConstText  nmeTextForLinks 
)

Apply styles collected by NMEStyle to a GTK+ text buffer.

Parameters:
[in] nmegtk data structure initialized by NMEGtkInit
[in] spanTable table of style spans created by NMEProcess with NMEStyle
[in] offset offset of NME output in textBuffer, in unicode characters
[in] length length of NME output in unicode characters
[in] nmeTextForLinks set hypertext links if source NME text, don't if NULL

Definition at line 129 of file NMEGtk.c.

void NMEGtkInit ( NMEGtk nmegtk,
GtkTextBuffer *  textBuffer,
int  charSize 
)

Initialize NMEGtk data structure.

Parameters:
[out] nmegtk data structure used by NMEGtkApplyStyle
[in] textBuffer text buffer style is applied to
[in] charSize standard text character size, used as the basis for heading sizes and superscript/subscript offsets

Definition at line 17 of file NMEGtk.c.

NMEErr NMEGtkInsert ( GtkTextBuffer *  textBuffer,
NMEGtk const *  nmegtk,
NMEConstText  str,
NMEInt  len,
NMEBoolean  replaceSel,
NMEBoolean  links 
)

Insert text with NME markup in a GtkTextBuffer, calling NMEGtkApplyStyle.

Parameters:
[in,out] textBuffer GTK+ text buffer
[in] nmegtk NMEGtk structure for textBuffer, initialized with NMEGtkInit
[in] str text with NME markup
[in] len length of str in bytes, or -1 if str is null-terminated
[in] replaceSel if TRUE, replace selection, else replace whole text
[in] links set hypertext links if TRUE

Definition at line 220 of file NMEGtk.c.

void NMEGtkSetLinkFun ( NMEGtk nmegtk,
NMEGtkLinkFun  linkFun,
void *  linkFunData 
)

Set the callback which processes clicks on links.

Parameters:
[in,out] nmegtk data structure used by NMEGtkApplyStyle
[in] linkFun callback which handles link clicks
[in] linkFunData value passed to linkFun

Definition at line 83 of file NMEGtk.c.

Generated by Doxygen.
Copyright 2007-2008, Yves Piguet.
All rights reserved.