1 /* Bluefish HTML Editor 2 * snippets.h - plugin for snippets sidebar 3 * 4 * Copyright (C) 2006 Olivier Sessink 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 #ifndef __SNIPPETS_H_ 20 #define __SNIPPETS_H_ 21 22 #define ENABLEPLUGINS 23 /* #define DEBUG */ 24 25 #include <gtk/gtk.h> 26 27 #include <libxml/xmlmemory.h> 28 #include <libxml/parser.h> 29 #include <libxml/xpath.h> 30 #include <libxml/xmlwriter.h> 31 32 33 #include "../config.h" 34 #include "../bluefish.h" 35 #ifdef ENABLE_NLS 36 #undef _ 37 #define _(String) dgettext(PACKAGE"_plugin_snippets", String) 38 #endif 39 40 enum { 41 PIXMAP_COLUMN, 42 TITLE_COLUMN, 43 NODE_COLUMN, 44 NUM_COLUMNS 45 46 }; 47 48 typedef struct { 49 GHashTable* lookup; /* pointers are stored here */ 50 xmlDocPtr doc; 51 GtkTreeStore *store; 52 } Tsnippets; 53 54 typedef struct { 55 Tbfwin *bfwin; 56 GtkWidget *snippetsmenu; 57 GtkWidget *view; 58 /*TreeTips *ttips;*/ 59 GtkAccelGroup *accel_group; 60 xmlNodePtr lastclickednode; 61 GtkTreePath *lastclickedpath; 62 } Tsnippetswin; 63 64 typedef struct { 65 gboolean show_as_menu; 66 } Tsnippetssession; 67 extern Tsnippets snippets_v; 68 69 Tsnippetssession *snippets_get_session(Tsessionvars *session); 70 Tsnippetswin *snippets_get_win(Tbfwin *bfwin); 71 #endif /* __SNIPPETS_H_ */ 72