Go to the documentation of this file.00001
00008
00009
00010 #ifndef __NMEGtk__
00011 #define __NMEGtk__
00012
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016
00017 #include "NME.h"
00018 #include "NMEStyle.h"
00019
00020 #include <gtk/gtk.h>
00021
00022 #define kMaxHeadingLevel 4
00023 #define kMaxListLevel 4
00024
00030 typedef void (*NMEGtkLinkFun)(NMEConstText link, void *data);
00031
00033 typedef struct
00034 {
00035 NMEGtkLinkFun fun;
00036 void *data;
00037 } NMEGtkLinkCB;
00038
00040 typedef struct
00041 {
00042 GtkTextBuffer *textBuffer;
00043 NMEGtkLinkCB *linkCB;
00044 GtkTextTag *plainTag;
00045 GtkTextTag *boldTag;
00046 GtkTextTag *italicTag;
00047 GtkTextTag *underlineTag;
00048 GtkTextTag *superTag;
00049 GtkTextTag *subTag;
00050 GtkTextTag *monoTag;
00051 GtkTextTag *headingTag[kMaxHeadingLevel];
00052 GtkTextTag *parTag;
00053 GtkTextTag *indentTag[kMaxListLevel];
00054 } NMEGtk;
00055
00062 void NMEGtkInit(NMEGtk *nmegtk, GtkTextBuffer *textBuffer, int charSize);
00063
00069 void NMEGtkSetLinkFun(NMEGtk *nmegtk, NMEGtkLinkFun linkFun, void *linkFunData);
00070
00078 void NMEGtkApplyStyle(NMEGtk const *nmegtk,
00079 NMEStyleTable const *spanTable,
00080 NMEInt offset, NMEInt length,
00081 NMEConstText nmeTextForLinks);
00082
00092 NMEErr NMEGtkInsert(GtkTextBuffer *textBuffer,
00093 NMEGtk const *nmegtk,
00094 NMEConstText str, NMEInt len,
00095 NMEBoolean replaceSel,
00096 NMEBoolean links);
00097
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101
00102 #endif