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

Support for GTK+ . More...

#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.

Detailed Description

Support for GTK+ .

Author:
Yves Piguet.

Definition in file NMEGtk.h.


Typedef Documentation

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

Callback to handle link clicks.

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

Definition at line 30 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]nmegtkdata structure initialized by NMEGtkInit
[in]spanTabletable of style spans created by NMEProcess with NMEStyle
[in]offsetoffset of NME output in textBuffer, in unicode characters
[in]lengthlength of NME output in unicode characters
[in]nmeTextForLinksset hypertext links if source NME text, don't if NULL

Definition at line 130 of file NMEGtk.c.

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

Initialize NMEGtk data structure.

Parameters:
[out]nmegtkdata structure used by NMEGtkApplyStyle
[in]textBuffertext buffer style is applied to
[in]charSizestandard text character size, used as the basis for heading sizes and superscript/subscript offsets

Definition at line 18 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]textBufferGTK+ text buffer
[in]nmegtkNMEGtk structure for textBuffer, initialized with NMEGtkInit
[in]strtext with NME markup
[in]lenlength of str in bytes, or -1 if str is null-terminated
[in]replaceSelif TRUE, replace selection, else replace whole text
[in]linksset hypertext links if TRUE

Definition at line 221 of file NMEGtk.c.

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

Set the callback which processes clicks on links.

Parameters:
[in,out]nmegtkdata structure used by NMEGtkApplyStyle
[in]linkFuncallback which handles link clicks
[in]linkFunDatavalue passed to linkFun

Definition at line 84 of file NMEGtk.c.

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