-
Notifications
You must be signed in to change notification settings - Fork 3
/
PluginDefinition.h
154 lines (121 loc) · 3.62 KB
/
PluginDefinition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//this file is part of notepad++
//Copyright (C)2003 Don HO <[email protected]>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef PLUGINDEFINITION_H
#define PLUGINDEFINITION_H
//
// All difinitions of plugin interface
//
#include "PluginInterface.h"
//-------------------------------------//
//-- STEP 1. DEFINE YOUR PLUGIN NAME --//
//-------------------------------------//
// Here define your plugin name
//
const TCHAR NPP_PLUGIN_NAME[] = TEXT("Notepad#");
//-----------------------------------------------//
//-- STEP 2. DEFINE YOUR PLUGIN COMMAND NUMBER --//
//-----------------------------------------------//
//
// Here define the number of your plugin commands
//
const int nbFunc = 20;
//
// Initialization of your plugin data
// It will be called while plugin loading
//
void pluginInit(HANDLE hModule);
//
// Cleaning of your plugin
// It will be called while plugin unloading
//
void pluginCleanUp();
//
//Initialization of your plugin commands
//
void commandMenuInit();
//
//Clean up your plugin commands allocation (if any)
//
void commandMenuCleanUp();
//
// Function which sets your command
//
bool setCommand(size_t index, TCHAR *cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey *sk = NULL, bool check0nInit = false);
//
// Your plugin command functions
//
void show_features();
void show_about();
// Commenting helpers
void Newline();
int poundComment(HWND &curScintilla, char *line);
int cStyleComment(HWND &curScintilla, char *line, int line_number);
// Cyrly brace indentation
int indentAfterCurlyBrace(HWND &curScintilla, int line_number);
void indentEndingCurlyBrace();
// XML/HTML tags indentation
char* create_ending_tag(char *tag);
void XHTMLindent(HWND &curScintilla, int position, int line_number);
void delete_current_line();
// Switching buffers
void buffer_left();
void buffer_right();
// Undo closed files functions
void get_all_files();
void get_files_now();
void find_missing();
void undo_closed_tab();
void closed_file_list();
void insertList();
void wrap_with_tag();
void end_tag();
// Url encode/decode selection
void url_encode_selection();
void url_decode_selection();
char from_hex(char ch);
char to_hex(char code);
char *url_encode(char *str);
char *url_decode(char *str);
// Helpers for embeded code like php and ruby
void EMBED_code();
void ruler();
int auto_numbering();
void Ruby_Newline(HWND &curScintilla);
void RubyExtra(int character);
void docblock_keywords();
// Peek HEX/CSS colors
void peek_hex_color();
void clear_hex_indicators();
long htoi (char s[]);
long hchartoi (char hexdig, int pos);
// Convert TABS to SPACES and reverse
void spaces_to_tabs();
void tabs_to_spaces();
void spaces_tabs(bool tabs);
void paste_indented();
// dblclick tag select
void watch_dblclick(int position, int line);
bool is_string_style(int style);
void select_string();
// Heper functions
HWND getCurrentScintilla();
char* getEOL();
char* trim_left(char *s);
char* trim(char *s);
char* substr(char* string, int begin, int end);
int strpos(char *haystack, char *needle);
#endif //PLUGINDEFINITION_H