nyctergatis.com

Contact

Projects
Sysquake Remote Live
NME
PDF
Hike
Sudoku
GifBuilder
jpeglib for Palm OS
MySQL Client
Cross-GCC for Mac OS
NMEGtk.c File Reference

Support for GTK+ . More...

#include "NMEGtk.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

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.
static gboolean linkEvent (GtkTextTag *tag, GtkWidget *w, GdkEventButton *event, GtkTextIter *iter, gpointer d)
 Signal handler for GTK+ link events.
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.

Variables

static GdkCursor * textCursor = NULL
 cursor over nonlink text
static GdkCursor * linkCursor = NULL
 cursor over links

Detailed Description

Support for GTK+ .

Author:
Yves Piguet.

Definition in file NMEGtk.c.


Function Documentation

static gboolean linkEvent ( GtkTextTag *  tag,
GtkWidget *  w,
GdkEventButton *  event,
GtkTextIter *  iter,
gpointer  d 
) [static]

Signal handler for GTK+ link events.

Parameters:
[in]tagGTK+ tag of the link
[in]wGTK+ textview widget
[in]eventevent description
[in]iterlocation of the event in the textbuffer
[in]dadress of a NMEGtkLinkCB structure

Definition at line 100 of file NMEGtk.c.

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.