g2: g2_win32_P.h Source File

- Main Page
- Modules
- Files
- Related Pages

# g2_win32_P.h

    00001 /*****************************************************************************
    00002 **  Copyright (C) 1998-2001  Ljubomir Milanovic & Horst Wagner
    00003 **  This file is part of the g2 library
    00004 **
    00005 **  This library is free software; you can redistribute it and/or
    00006 **  modify it under the terms of the GNU Lesser General Public
    00007 **  License as published by the Free Software Foundation; either
    00008 **  version 2.1 of the License, or (at your option) any later version.
    00009 **
    00010 **  This library is distributed in the hope that it will be useful,
    00011 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 **  Lesser General Public License for more details.
    00014 **
    00015 **  You should have received a copy of the GNU Lesser General Public
    00016 **  License along with this library; if not, write to the Free Software
    00017 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 ******************************************************************************/
    00019 #ifndef _G2_WIN32_P_H
    00020 #define _G2_WIN32_P_H
    00021
    00022 #include "windows.h"
    00023 #include <stdio.h>
    00024
    00025 extern HMENU hmenu;
    00026 extern HANDLE ghModule;
    00027 extern HINSTANCE g2res_DLL;
    00028
    00029 typedef struct g2_win32_STRUCT {
    00030         HANDLE hThread;
    00031         HWND   hwndThreadWindow;
    00032         HANDLE hinst;
    00033         HBITMAP hBitmap;
    00034         HDC hMemDC;
    00035         HPEN hPen;
    00036         HPEN hNullPen;
    00037         HBRUSH hBrush;
    00038         HFONT hFont;
    00039         int nWidth;
    00040         int nHeight;
    00041         int x;
    00042         int y;
    00043         int NoOfInks;
    00044         int PenWidth;
    00045         int PenStyle;
    00046         DWORD *PenDash;
    00047         int Pen;
    00048         int BkColor;
    00049         COLORREF PenColor;
    00050         COLORREF *Inks;
    00051         char *title;
    00052         int type;
    00053         int messageloop;
    00054         } g2_win32_STRUCT;
    00055
    00056
    00057 BOOL SaveBitmapAs(HWND hWnd,struct XPGTHREADINFO *pThreadInfo);
    00058 LRESULT CALLBACK g2_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
    00059 long WINAPI g2_StartThread(struct g2_win32_STRUCT *pdp);
    00060 void errhandler(LPSTR errtxt,HWND hwnd);
    00061
    00062
    00063 int g2_win32_init_win32(int pid, void *pdp, int vid, int width,int height);
    00064 int g2_win32_init_win32X(int pid, void *pdp,
    00065                      int width, int height,
    00066                      int xposition, int yposition,
    00067                      char *windowname, char *iconname,
    00068                      char *icondata, int iconwidth, int iconheight);
    00069 int g2_win32_Delete(int pid, void *pdp);
    00070 int g2_win32_Clear(int pid, void *pdp);
    00071 int g2_win32_Flush(int pid, void *pdp);
    00072 int g2_win32_Ink(int pid, void *pdp,
    00073                double red, double green, double blue);
    00074 int g2_win32_ClearPalette(int pid, void *pdp);
    00075 int g2_win32_ResetPalette(int pid, void *pdp);
    00076 int g2_win32_SetBackground(int pid, void *pdp, int color);
    00077 int g2_win32_Pen(int pid, void *pdp, int color);
    00078 int g2_win32_Paper(int pid, void *pdp, int color);
    00079 int g2_win32_SetLineWidth(int pid, void *pdp, int w);
    00080 int g2_win32_SetDash(int pid, void *pdp, int n, int *data);
    00081 int g2_win32_SetFontSize(int pid, void *pdp, int size);
    00082 int g2_win32_Plot(int pid, void *pdp, int x, int y);
    00083 int g2_win32_Line(int pid, void *pdp, int x1, int y1, int x2, int y2);
    00084 int g2_win32_PolyLine(int pid, void *pdp, int N, int *p);
    00085 int g2_win32_Polygon(int pid, void *pdp, int N, int *p);
    00086 int g2_win32_FilledPolygon(int pid, void *pdp, int N, int *p);
    00087 int g2_win32_Triangle(int pid, void *pdp,
    00088                     int x1, int y1,
    00089                     int x2, int y2,
    00090                     int x3, int y3);
    00091 int g2_win32_FilledTriangle(int pid, void *pdp, int x1, int y1,
    00092                            int x2, int y2,
    00093                            int x3, int y3);
    00094 int g2_win32_Rectangle(int pid, void *pdp, int x1, int y1, int x2, int y2);
    00095 int g2_win32_FilledRectangle(int pid, void *pdp,
    00096                             int x1, int y1, int x2, int y2);
    00097 int g2_win32_Circle(int pid, void *pdp, int x, int y, int r);
    00098 int g2_win32_FilledCircle(int pid, void *pdp, int x, int y, int r);
    00099 int g2_win32_Arc(int pid, void *pdp, int x, int y,
    00100                int r1, int r2, double a1, double a2);
    00101 int g2_win32_FilledArc(int pid, void *pdp, int x, int y,
    00102                       int r1, int r2, double a1, double a2);
    00103 int g2_win32_Ellipse(int pid, void *pdp, int x, int y, int r1, int r2);
    00104 int g2_win32_FilledEllipse(int pid, void *pdp, int x, int y, int r1, int r2);
    00105 int g2_win32_DrawString(int pid, void *pdp, int x, int y, const char *text);
    00106 int g2_win32_QueryPointer(int pid, void *pdp, int *x, int *y, unsigned int *button);
    00107
    00108 int g2_win32_AllocateBasicColors(int pid, void *pdp);
    00109
    00110 int g2_win32_Cleanup(int pid, void *pdp);
    00111
    00112 #endif /* _G2_WIN32_P_H */