Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15386/win32/src
Added Files:
win32consolemodule.cpp
Log Message:
Add win32console module, wrapping Windows console API functions
--- NEW FILE: win32consolemodule.cpp ---
// @doc
#define _WIN32_WINNT 0x501
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "structmember.h"
#include "malloc.h"
#define PyW32_BEGIN_ALLOW_THREADS PyThreadState *_save = PyEval_SaveThread();
#define PyW32_END_ALLOW_THREADS PyEval_RestoreThread(_save);
#define PyW32_BLOCK_THREADS Py_BLOCK_THREADS
// function pointers
#define CHECK_PFN(fname)if (pfn##fname==NULL) return PyErr_Format(PyExc_NotImplementedError,"%s is not available on this platform", #fname);
HMODULE kernel32_dll;
typedef DWORD (WINAPI* GetConsoleProcessListfunc)(LPDWORD, DWORD);
static GetConsoleProcessListfunc pfnGetConsoleProcessList=NULL;
typedef BOOL (WINAPI *GetConsoleDisplayModefunc)(LPDWORD);
static GetConsoleDisplayModefunc pfnGetConsoleDisplayMode=NULL;
[...1395 lines suppressed...]
PyModule_AddIntConstant(mod, "COMMON_LVB_GRID_RVERTICAL", COMMON_LVB_GRID_RVERTICAL);
PyModule_AddIntConstant(mod, "COMMON_LVB_REVERSE_VIDEO", COMMON_LVB_REVERSE_VIDEO);
PyModule_AddIntConstant(mod, "COMMON_LVB_UNDERSCORE", COMMON_LVB_UNDERSCORE);
// selection flags for GetConsoleSelectionInfo
PyModule_AddIntConstant(mod, "CONSOLE_NO_SELECTION", CONSOLE_NO_SELECTION);
PyModule_AddIntConstant(mod, "CONSOLE_SELECTION_IN_PROGRESS", CONSOLE_SELECTION_IN_PROGRESS);
PyModule_AddIntConstant(mod, "CONSOLE_SELECTION_NOT_EMPTY", CONSOLE_SELECTION_NOT_EMPTY);
PyModule_AddIntConstant(mod, "CONSOLE_MOUSE_SELECTION", CONSOLE_MOUSE_SELECTION);
PyModule_AddIntConstant(mod, "CONSOLE_MOUSE_DOWN", CONSOLE_MOUSE_DOWN);
PyModule_AddIntConstant(mod, "LOCALE_USER_DEFAULT", LOCALE_USER_DEFAULT);
// event types for INPUT_RECORD
PyModule_AddIntConstant(mod, "KEY_EVENT", KEY_EVENT);
PyModule_AddIntConstant(mod, "MOUSE_EVENT", MOUSE_EVENT);
PyModule_AddIntConstant(mod, "WINDOW_BUFFER_SIZE_EVENT", WINDOW_BUFFER_SIZE_EVENT);
PyModule_AddIntConstant(mod, "MENU_EVENT", MENU_EVENT);
PyModule_AddIntConstant(mod, "FOCUS_EVENT", FOCUS_EVENT);
}
|