Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members

py_buffer.h

00001 /***************************************************************************
00002                           py_buffer.h 
00003                              -------------------
00004     begin                : Fri  Feb  7 2003
00005     copyright       : (C) 2003 by Heiko Köhler
00006     email                : heicom@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017  
00018 #ifndef __PYBUFFER_H__
00019 #define __PYBUFFER_H__
00020 
00021 #include <qextscintilla.h>
00022 #undef slots
00023 #include <Python.h>
00024 #define slots
00025 
00026 #include "python_api.h"
00027 
00028 namespace API{
00029 
00030 void initEnums(PyObject *module);
00031 
00033 struct Buffer 
00034 {
00035     PyObject_HEAD
00036     QextScintilla *view;
00037 };
00038 
00040 struct Color
00041 {
00042     PyObject_HEAD
00043     QColor color;
00044     operator QColor() { return color; }
00045 };
00046 
00047 extern EnumModule eolModeEnum;
00048 extern EnumModule mdiModeEnum;
00049 extern EnumModule foldStyleEnum;
00050 extern EnumModule braceMatchEnum;
00051 extern EnumModule autoIndentStyleEnum;
00052 extern EnumModule autoCompletionEnum;
00053 extern EnumModule markerSymbolEnum;
00054 extern EnumModule themeEnum;
00055 extern EnumModule whitespaceVisibilityEnum;
00056 
00057 extern PyTypeObject buffer_type;
00058 
00059 #define BUFFER_METHOD_DEF \
00060     {"clear", clear, METH_VARARGS,\
00061     "Deletes all the text in the text edit." }, \
00062     {"copy", copy, METH_VARARGS, \
00063     "Copies any selected text to the clipboard." }, \
00064     {"cut", cut, METH_VARARGS, \
00065     "Copies any selected text to the clipboard and then deletes the text." }, \
00066     {"foldAll", foldAll, METH_VARARGS,\
00067     "If any lines are currently folded then they are all unfolded. Otherwise all lines are folded. This has the same effect as clicking in the fold margin with the shift and control keys pressed." }, \
00068     {"paste", paste, METH_VARARGS,\
00069     "Pastes any text from the clipboard into the text edit at the current cursor position." }, \
00070     {"redo", redo, METH_VARARGS,\
00071     "Redo the last change or sequence of changes." }, \
00072     {"selectToMatchingBrace", selectToMatchingBrace, METH_VARARGS,\
00073     "If the cursor is either side of a brace character then move it to the position of the corresponding brace and select the text between the braces." }, \
00074     {"undo", undo, METH_VARARGS,\
00075     "Undo the last change or sequence of changes." }, \
00076     {"zoomIn", zoomIn, METH_VARARGS, \
00077     "Zooms in on the text by by making the base font size one point larger and recalculating all font sizes." }, \
00078     {"zoomOut", zoomOut, METH_VARARGS, \
00079     "Zooms out on the text by by making the base font size range points smaller and recalculating all font sizes." }, \
00080     {"beginUndoAction", beginUndoAction, METH_VARARGS, \
00081     "Mark the beginning of a sequence of actions that can be undone by a single call to undo()." }, \
00082     {"endUndoAction", endUndoAction, METH_VARARGS, \
00083     "Mark the end of a sequence of actions that can be undone by a single call to undo()." }, \
00084     {"autoIndent", autoIndent, METH_VARARGS, \
00085     "Returns 1 if auto-indentation is enabled." }, \
00086     {"backspaceUnindents", backspaceUnindents, METH_VARARGS, \
00087     "Returns 1 if the backspace key unindents a line instead of deleting a character." }, \
00088     {"braceMatching", braceMatching, METH_VARARGS, \
00089     "Returns the brace matching mode." }, \
00090     {"eolMode", eolMode, METH_VARARGS, \
00091     "Returns the end-of-line mode." }, \
00092     {"eolVisibility", eolVisibility, METH_VARARGS, \
00093     "Returns the visibility of end-of-lines." }, \
00094     {"findNext", findNext, METH_VARARGS, \
00095     "Find the next occurence of the string found using findFirst()" }, \
00096     {"folding", folding, METH_VARARGS, \
00097     "Returns the current folding style." }, \
00098     {"hasSelectedText", hasSelectedText, METH_VARARGS, \
00099     "Returns 1 if some text is selected." }, \
00100     {"indentationGuides", indentationGuides, METH_VARARGS, \
00101     "Returns 1 if the display of indentation guides is enabled." }, \
00102     {"indentationsUseTabs", indentationsUseTabs, METH_VARARGS, \
00103     "Returns 1 if indentations are created using tabs and spaces, rather than just spaces." }, \
00104     {"indentationWidth", indentationWidth, METH_VARARGS, \
00105     "Returns the indentation width in characters. The default is 0 which means that the value returned by tabWidth() is actually used." }, \
00106     {"isModified", isModified, METH_VARARGS, \
00107     "Returns 1 if the text has been modified." }, \
00108     {"isReadOnly", isReadOnly, METH_VARARGS, \
00109     "Returns 1 if the text edit is read-only." }, \
00110     {"isRedoAvailable", isRedoAvailable, METH_VARARGS, \
00111     "Returns 1 if there is something that can be redone." }, \
00112     {"isUndoAvailable", isUndoAvailable, METH_VARARGS, \
00113     "Returns 1 if there is something that can be undone." }, \
00114     {"isUtf8", isUtf8, METH_VARARGS, \
00115     "Returns 1 if text is interpreted as being UTF8 encoded. The default is to interpret the text as Latin1 encoded." }, \
00116     {"lines", lines, METH_VARARGS, \
00117     "Returns the number of lines of text." }, \
00118     {"length", length, METH_VARARGS, \
00119     "Returns the length of the text edit's text." }, \
00120     {"tabIndents", tabIndents, METH_VARARGS, \
00121     "Returns 1 if the tab key indents a line instead of inserting a tab character." }, \
00122     {"tabWidth", tabWidth, METH_VARARGS, \
00123     "Returns the tab width in characters." }, \
00124     {"whitespaceVisibility", whitespaceVisibility, METH_VARARGS, \
00125     "Returns the visibility of whitespace." }, \
00126     {"ensureLineVisible", ensureLineVisible, METH_VARARGS, \
00127     "Ensures that the line number line is visible." }, \
00128     {"setAutoIndent", setAutoIndent, METH_VARARGS, \
00129     "If autoindent is 1 then auto-indentation is enabled." }, \
00130     {"setBackspaceUnindents", setBackspaceUnindents, METH_VARARGS, \
00131     "If deindent is 1 then the backspace key will unindent a line rather then delete a character." }, \
00132     {"setEolMode", setEolMode, METH_VARARGS, \
00133     "Sets the end-of-line mode to mode." }, \
00134     {"setEolVisibility", setEolVisibility, METH_VARARGS, \
00135     "If visible is 1 then end-of-lines are made visible." }, \
00136     {"setFolding", setFolding, METH_VARARGS, \
00137     "Sets the folding style for margin 2 to fold." }, \
00138     {"setIndentationGuidesBackgroundColor", setIndentationGuidesBackgroundColor, METH_VARARGS, \
00139     "Set the background colour of indentation guides." }, \
00140     {"setIndentationGuidesForegroundColor", setIndentationGuidesForegroundColor, METH_VARARGS, \
00141     "Set the foreground colour of indentation guides." }, \
00142     {"setMarginsForegroundColor", setMarginsForegroundColor, METH_VARARGS, \
00143     "Set the foreground color of all margins" }, \
00144     {"setMarginsBackgroundColor", setMarginsBackgroundColor, METH_VARARGS, \
00145     "Set the background color of all margins" }, \
00146     {"setMarkerBackgroundColor", setMarkerBackgroundColor, METH_VARARGS, \
00147     "Set the background color of given marker mnr. If mnr is -1 then the color of all markers is set." }, \
00148     {"setMarkerForegroundColor", setMarkerForegroundColor, METH_VARARGS, \
00149     "Set the foreground color of given marker mnr. If mnr is -1 then the color of all markers is set." }, \
00150     {"setMatchedBraceBackgroundColor", setMatchedBraceBackgroundColor, METH_VARARGS, \
00151     "Set the background color used to display matched braces." }, \
00152     {"setMatchedBraceForegroundColor", setMatchedBraceForegroundColor, METH_VARARGS, \
00153     "Set the foreground color used to display matched braces." }, \
00154     {"setUnmatchedBraceBackgroundColor", setUnmatchedBraceBackgroundColor, METH_VARARGS, \
00155     "Set the background color used to display unmatched braces." }, \
00156     {"setUnmatchedBraceForegroundColor", setUnmatchedBraceForegroundColor, METH_VARARGS, \
00157     "Set the foreground color used to display unmatched braces." }, \
00158     {"setIndentationGuides", setIndentationGuides, METH_VARARGS, \
00159     "Enables or disables this display of indentation guides." }, \
00160     {"setIndentationsUseTabs", setIndentationsUseTabs, METH_VARARGS, \
00161     "If tabs is 1 then indentations are created using tabs and spaces, rather than just spaces." }, \
00162     {"setIndentationWidth", setIndentationWidth, METH_VARARGS, \
00163     "Sets the indentation width. If width is 0 then the value returned by tabWidth() is used." }, \
00164     {"setModified", setModified, METH_VARARGS, \
00165     "Sets the modified state of the text edit. Note that it is only possible to clear the modified state. Attempts to set the modified state are ignored." }, \
00166     {"setReadOnly", setReadOnly, METH_VARARGS, \
00167     "Sets the read-only state of the text edit" }, \
00168     {"setTabIndents", setTabIndents, METH_VARARGS, \
00169     "If indent is 1 then the tab key will indent a line rather then insert a tab character." }, \
00170     {"setTabWidth", setTabWidth, METH_VARARGS, \
00171     "Sets the tab width." }, \
00172     {"setUtf8", setUtf8, METH_VARARGS, \
00173     "Sets the current text encoding. If cp is 1 then UTF8 is used, otherwise Latin1 is used." }, \
00174     {"setWhitespaceVisibility", setWhitespaceVisibility, METH_VARARGS, \
00175     "Sets the visibility of whitespace." }, \
00176     {"unindent", unindent, METH_VARARGS, \
00177     "Decreases the indentation of line line." }, \
00178     {"zoomTo", zoomTo, METH_VARARGS, \
00179     "Zooms the text by making the base font size given points and recalculating all font sizes." }, \
00180     {"convertEol", convertEols, METH_VARARGS, \
00181     "All the lines of the text have their end-of-lines converted to given mode." }, \
00182     {"markerDeleteHandle", markerDeleteHandle, METH_VARARGS, \
00183     "Delete the the marker instance with the marker given handle." }, \
00184     {"zoomIn", zoomIn, METH_VARARGS, \
00185     "Zooms in on the text by by making the base font size one point larger and recalculating all font sizes." }, \
00186     {"zoomOut", zoomOut, METH_VARARGS, \
00187     "Zooms out on the text by by making the base font size range points smaller and recalculating all font sizes." }, \
00188     {"indentation", indentation, METH_VARARGS, \
00189     "Returns the number of characters that given line is indented by." }, \
00190     {"lineLength", lineLength, METH_VARARGS, \
00191     "Returns the length of given line or -1 if there is no such line." }, \
00192     {"marginLineNumbers", marginLineNumbers, METH_VARARGS, \
00193     "Returns 1 if line numbers are enabled for given margin." }, \
00194     {"marginSensitivity", marginSensitivity, METH_VARARGS, \
00195     "Returns 1 if given margin is sensitive to mouse clicks." }, \
00196     {"marginWidth", marginWidth, METH_VARARGS, \
00197     "Returns the width in pixels of given margin." }, \
00198     {"markerDefine", markerDefine, METH_VARARGS, \
00199     "Define a marker using the given symbol with the given marker number. If mnr is -1 then the marker number is automatically allocated." }, \
00200     {"markerLine", markerLine, METH_VARARGS, \
00201     "Return the line number that contains the marker instance with the given marker handle." }, \
00202     {"setCursorPosition", setCursorPosition, METH_VARARGS, \
00203     "Sets the cursor to the given line at the given position index." }, \
00204     {"setIndentation", setIndentation, METH_VARARGS, \
00205     "Sets the indentation of line to given characters." }, \
00206     {"setMarginLineNumbers", setMarginLineNumbers, METH_VARARGS, \
00207     "Enables or disables, according to second arg, the display of line numbers in given margin." }, \
00208     {"setMarginSensitivity", setMarginSensitivity, METH_VARARGS, \
00209     "Enables or disables, according to second arg, the sensitivity of given margin to mouse clicks." }, \
00210     {"setMarginWidth", setMarginWidth, METH_VARARGS, \
00211     "Sets the width of given margin to given pixels. If the width of a margin is 0 then it is not displayed. " },\
00212     {"insert", append, METH_VARARGS, \
00213     "inserts text at current position" },\
00214     {"find", find, METH_VARARGS, \
00215     "Finds a string in current view: find(string, int regExp, int caseSens, int wholeWords, int wrap, int forward, int line, int index)"},\
00216     {"currentLine", currentLine, METH_VARARGS, \
00217     "Returns current line."},\
00218     {"currentColumn", currentIndex, METH_VARARGS, \
00219     "Returns current index."},\
00220     {"selection", selection, METH_VARARGS, \
00221     "returns current selection"},\
00222     {"selectedText", selectedText, METH_VARARGS, \
00223     "returns selected text"},\
00224     {"moveCursor", moveCursor, METH_VARARGS, \
00225     "moves cursor, negative values can also be used: moveCursor(int left, int down)"},\
00226     {"line", line, METH_VARARGS, \
00227     "Returns line at given line number."},\
00228     {"setMarginStringWidth", setMarginStringWidth, METH_VARARGS, \
00229     "Sets margin n width with given string: setMarginStringWidth(int,str)"},\
00230     {"setSelection", setSelection, METH_VARARGS, \
00231     "Sets selection: setSelection(int,int,int,int)"},\
00232     {"insertCommand", insertCommand, METH_VARARGS, \
00233     "Inserts output of a shell command."},\
00234     {"filter", filter, METH_VARARGS, \
00235     "Filters selection with a shell command."},\
00236     {"fileName", fileName, METH_VARARGS, \
00237     "Retrieves file name of view."},
00238 
00239 PyObject *color_new(PyObject *self, PyObject *args);
00240 
00241 PyObject *clear(PyObject *self, PyObject *args);
00242 PyObject *copy(PyObject *self, PyObject *args);
00243 PyObject *cut(PyObject *self, PyObject *args);
00244 PyObject *foldAll(PyObject *self, PyObject *args);
00245 PyObject *paste(PyObject *self, PyObject *args);
00246 PyObject *redo(PyObject *self, PyObject *args);
00247 PyObject *selectToMatchingBrace(PyObject *self, PyObject *args);
00248 PyObject *selectAll(PyObject *self, PyObject *args);
00249 PyObject *undo(PyObject *self, PyObject *args);
00250 PyObject *zoomIn(PyObject *self, PyObject *args);
00251 PyObject *zoomOut(PyObject *self, PyObject *args);
00252 PyObject *beginUndoAction(PyObject *self, PyObject *args);
00253 PyObject *endUndoAction(PyObject *self, PyObject *args);
00254 
00255 PyObject *autoIndent(PyObject *self, PyObject *args);
00256 PyObject *backspaceUnindents(PyObject *self, PyObject *args);
00257 PyObject *braceMatching(PyObject *self, PyObject *args);
00258 PyObject *eolMode(PyObject *self, PyObject *args);
00259 PyObject *eolVisibility(PyObject *self, PyObject *args);
00260 PyObject *findNext(PyObject *self, PyObject *args);
00261 PyObject *folding(PyObject *self, PyObject *args);
00262 PyObject *hasSelectedText(PyObject *self, PyObject *args);
00263 PyObject *indentationGuides(PyObject *self, PyObject *args);
00264 PyObject *indentationsUseTabs(PyObject *self, PyObject *args);
00265 PyObject *indentationWidth(PyObject *self, PyObject *args);
00266 PyObject *isModified(PyObject *self, PyObject *args);
00267 PyObject *isReadOnly(PyObject *self, PyObject *args);
00268 PyObject *isRedoAvailable(PyObject *self, PyObject *args);
00269 PyObject *isUndoAvailable(PyObject *self, PyObject *args);
00270 PyObject *isUtf8(PyObject *self, PyObject *args);
00271 PyObject *lines(PyObject *self, PyObject *args);
00272 PyObject *length(PyObject *self, PyObject *args);
00273 PyObject *tabIndents(PyObject *self, PyObject *args);
00274 PyObject *tabWidth(PyObject *self, PyObject *args);
00275 PyObject *whitespaceVisibility(PyObject *self, PyObject *args);
00276 
00277 PyObject *ensureLineVisible(PyObject *self, PyObject *args);
00278 PyObject *setAutoIndent(PyObject *self, PyObject *args);
00279 PyObject *setBraceMatching(PyObject *self, PyObject *args);
00280 PyObject *setBackspaceUnindents(PyObject *self, PyObject *args);
00281 PyObject *setEolMode(PyObject *self, PyObject *args);
00282 PyObject *setEolVisibility(PyObject *self, PyObject *args);
00283 PyObject *setFolding(PyObject *self, PyObject *args);
00284 PyObject *setIndentationGuides(PyObject *self, PyObject *args);
00285 PyObject *setIndentationsUseTabs(PyObject *self, PyObject *args);
00286 PyObject *setIndentationWidth(PyObject *self, PyObject *args);
00287 PyObject *setModified(PyObject *self, PyObject *args);
00288 PyObject *setMarginsBackgroundColor(PyObject *self, PyObject *args);
00289 PyObject *setMarginsForegroundColor(PyObject *self, PyObject *args);
00290 PyObject *setMarkerBackgroundColor(PyObject *self, PyObject *args);
00291 PyObject *setMarkerForegroundColor(PyObject *self, PyObject *args);
00292 PyObject *setIndentationGuidesBackgroundColor(PyObject *self, PyObject *args);
00293 PyObject *setIndentationGuidesForegroundColor(PyObject *self, PyObject *args);
00294 PyObject *setMatchedBraceBackgroundColor(PyObject *self, PyObject *args);
00295 PyObject *setMatchedBraceForegroundColor(PyObject *self, PyObject *args);
00296 PyObject *setUnmatchedBraceBackgroundColor(PyObject *self, PyObject *args);
00297 PyObject *setUnmatchedBraceForegroundColor (PyObject *self, PyObject *args);
00298 PyObject *setReadOnly (PyObject *self, PyObject *args);
00299 PyObject *setTabIndents (PyObject *self, PyObject *args);
00300 PyObject *setTabWidth (PyObject *self, PyObject *args);
00301 PyObject *setUtf8 (PyObject *self, PyObject *args);
00302 PyObject *setWhitespaceVisibility (PyObject *self, PyObject *args);
00303 PyObject *unindent (PyObject *self, PyObject *args);
00304 PyObject *zoomTo (PyObject *self, PyObject *args);
00305 PyObject *convertEols (PyObject *self, PyObject *args);
00306 PyObject *markerDeleteHandle (PyObject *self, PyObject *args);
00307 PyObject *zoomIn (PyObject *self, PyObject *args);
00308 PyObject *zoomOut(PyObject *self, PyObject *args);
00309 //PyObject *zoomRangeIn (PyObject *self, PyObject *args);
00310 //PyObject *zoomRangeOut(PyObject *self, PyObject *args);
00311 
00312 PyObject *indentation (PyObject *self, PyObject *args);
00313 PyObject *lineLength (PyObject *self, PyObject *args);
00314 PyObject *marginLineNumbers (PyObject *self, PyObject *args);
00315 PyObject *marginSensitivity (PyObject *self, PyObject *args);
00316 PyObject *marginWidth (PyObject *self, PyObject *args);
00317 PyObject *markerDefine (PyObject *self, PyObject *args);
00318 PyObject *markerLine (PyObject *self, PyObject *args);
00319 
00320 PyObject *setCursorPosition (PyObject *self, PyObject *args);
00321 PyObject *setIndentation (PyObject *self, PyObject *args);
00322 PyObject *setMarginLineNumbers (PyObject *self, PyObject *args);
00323 PyObject *setMarginSensitivity (PyObject *self, PyObject *args);
00324 PyObject *setMarginWidth (PyObject *self, PyObject *args);
00325 
00326 PyObject *append(PyObject *self, PyObject *args);
00327 PyObject *find(PyObject *self, PyObject *args);
00328 PyObject *currentLine(PyObject *self, PyObject *args);
00329 PyObject *currentIndex(PyObject *self, PyObject *args);
00330 PyObject *selection(PyObject *self, PyObject *args);
00331 PyObject *selectedText(PyObject *self, PyObject *args);
00332 PyObject *moveCursor(PyObject *self, PyObject *args);
00333 PyObject *line(PyObject *self, PyObject *args);
00334 PyObject *setMarginStringWidth(PyObject *self, PyObject *args);
00335 PyObject *setSelection(PyObject *self, PyObject *args);
00336 PyObject *insertCommand(PyObject *self, PyObject *args);
00337 PyObject *filter(PyObject *self, PyObject *args);
00338 PyObject *fileName(PyObject *self, PyObject *args);
00339 
00340 }   // namespace API
00341 
00342 #endif

Generated on Sun May 2 20:02:58 2004 by doxygen 1.3.2