# PySoy Windows API Declarations # # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ cdef extern from "windows.h" nogil : ctypedef void* HDC # handle to device context ctypedef void* HGLRC # handle to GL rendering context ctypedef void* HWND # handle to window ctypedef void* HINSTANCE ctypedef void* HANDLE ctypedef int BOOL ctypedef long LONG ctypedef unsigned long DWORD ctypedef unsigned short WORD ctypedef WORD ATOM ctypedef unsigned int UINT ctypedef long long LONGLONG ctypedef unsigned int UINT_PTR ctypedef long long LONG_PTR ctypedef UINT_PTR WPARAM ctypedef LONG_PTR LPARAM ctypedef LONG_PTR LRESULT ctypedef LRESULT (__stdcall *WNDPROC)(HWND, UINT, WPARAM, LPARAM) cdef LRESULT DefWindowProc(HWND, UINT, WPARAM, LPARAM) ctypedef struct RECT: LONG left LONG top LONG right LONG bottom cdef BOOL AdjustWindowRectEx(RECT*, DWORD, BOOL, DWORD) ctypedef struct WNDCLASS: UINT style WNDPROC lpfnWndProc int cbClsExtra int cbWndExtra HINSTANCE hInstance void* hIcon void* hCursor void* hBrush char* lpszMenuName char* lpszClassName cdef void Sleep(DWORD) cdef LRESULT SendMessage(HWND, UINT, WPARAM, LPARAM) cdef BOOL SendNotifyMessage(HWND, UINT, WPARAM, LPARAM) cdef BOOL SetWindowText(HWND, char*) cdef ATOM RegisterClass(WNDCLASS*) cdef HWND CreateWindow(char*, char*, DWORD, int, int, int, int, HWND, void*, HINSTANCE, void*) cdef BOOL DestroyWindow(HWND) cdef BOOL IsWindowVisible(HWND) cdef BOOL ShowWindow(HWND, int) cdef BOOL SetForegroundWindow(HWND) cdef HDC GetDC(HWND) cdef int ReleaseDC(HWND, HDC) cdef BOOL DeleteDC(HDC) cdef HGLRC wglCreateContext(HDC) cdef BOOL wglMakeCurrent(HDC, HGLRC) cdef BOOL wglDeleteContext(HGLRC) cdef BOOL SwapBuffers(HDC) cdef HANDLE GetCurrentThread() cdef DWORD GetCurrentThreadId() ctypedef struct POINT: LONG x LONG y cdef WORD HIWORD(DWORD) cdef WORD LOWORD(DWORD) # Messages ctypedef struct MSG: HWND hwnd UINT message WPARAM wParam LPARAM lParam DWORD time POINT pt cdef BOOL PeekMessage(MSG*, HWND, UINT, UINT, UINT) cdef BOOL GetMessage(MSG*, HWND, UINT, UINT) cdef LRESULT DispatchMessage(MSG*) cdef BOOL TranslateMessage(MSG*) # Technically, this returns an HMODULE, but for our purposes, this is # Good Enough. cdef HINSTANCE GetModuleHandle(char*) cdef void* LoadCursor(HINSTANCE, char*) cdef char *IDC_ARROW ctypedef struct FILETIME: DWORD dwLowDateTime DWORD dwHighDateTime ctypedef union LARGE_INTEGER: DWORD LowPart LONG HighPart LONGLONG QuadPart cdef void GetSystemTimeAsFileTime(FILETIME*) ctypedef enum: CS_HREDRAW CS_VREDRAW CS_OWNDC PM_REMOVE WM_SIZE WM_PAINT WM_SETTEXT WM_CLOSE WM_KEYDOWN WM_KEYUP WM_CHAR SW_SHOW SIZE_MINIMIZED cdef extern from "support.c": cdef ATOM register_class(HINSTANCE, WNDPROC) cdef BOOL unregister_class(HINSTANCE) cdef HWND make_window(HINSTANCE, char*, int, int, int, int, int) cdef int set_pixel_format(HDC) cdef BOOL set_window_pos(HWND window, int x, int y) cdef BOOL get_window_pos(HWND window, int* x, int* y) cdef BOOL set_window_size(HWND window, int width, int height) cdef BOOL get_window_size(HWND window, int* width, int* height) #cdef HDC get_display_hdc() cdef void get_screen_info(int* width, int* height, int* depth) cdef int minimize ( HWND window ) cdef int maximize ( HWND window ) # vim: sts=2:sw=2:et