From: <sm...@us...> - 2009-03-19 12:02:14
|
Revision: 9752 http://plplot.svn.sourceforge.net/plplot/?rev=9752&view=rev Author: smekal Date: 2009-03-19 12:02:01 +0000 (Thu, 19 Mar 2009) Log Message: ----------- Add missing debug macros. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2009-03-18 15:46:17 UTC (rev 9751) +++ trunk/drivers/wingcc.c 2009-03-19 12:02:01 UTC (rev 9752) @@ -165,9 +165,13 @@ #define Debug3(a,b,c) do {if (pls->debug){fprintf(stderr,(a),(b),(c));}}while(0) #elif defined(__BORLANDC__) #define Debug if (pls->debug) printf + #define Debug2 if (pls->debug) printf + #define Debug3 if (pls->debug) printf #else #define Verbose(...) do {if (pls->verbose){fprintf(stderr,__VA_ARGS__);}}while(0) #define Debug(...) do {if (pls->debug){fprintf(stderr,__VA_ARGS__);}}while(0) + #define Debug2(...) do {if (pls->debug){fprintf(stderr,__VA_ARGS__);}}while(0) + #define Debug3(...) do {if (pls->debug){fprintf(stderr,__VA_ARGS__);}}while(0) #endif #define ReportWinError() do { \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-06-16 07:10:07
|
Revision: 11069 http://plplot.svn.sourceforge.net/plplot/?rev=11069&view=rev Author: arjenmarkus Date: 2010-06-16 07:10:00 +0000 (Wed, 16 Jun 2010) Log Message: ----------- Correct information about the capabilities of the wingcc driver - it does not in fact implement the clear escape. The stripchart example (x17) failed because of this. As there seems to be no simple way of clearing the window in the GDI library, leave it to the default method - drawing a filled rectangle. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-06-08 01:58:52 UTC (rev 11068) +++ trunk/drivers/wingcc.c 2010-06-16 07:10:00 UTC (rev 11069) @@ -441,7 +441,7 @@ pls->graphx = GRAPHICS_MODE; /* No text mode for this driver (at least for now, might add a console window if I ever figure it out and have the inclination) */ pls->dev_fill0 = 1; /* driver can do solid area fills */ pls->dev_xor = 1; /* driver supports xor mode */ - pls->dev_clear = 1; /* driver supports clear */ + pls->dev_clear = 0; /* driver does not support clear - what is the proper API? */ pls->dev_dash = 0; /* driver can not do dashed lines (yet) */ pls->plbuf_write = 1; /* driver uses the buffer for redraws */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-06-21 07:22:41
|
Revision: 11081 http://plplot.svn.sourceforge.net/plplot/?rev=11081&view=rev Author: arjenmarkus Date: 2010-06-21 07:22:35 +0000 (Mon, 21 Jun 2010) Log Message: ----------- Incorporate the changes suggested by Sisyphus on plplot-general for support of the Windows 64-bits platform. Note: untested for lack of such a system. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-06-20 05:28:43 UTC (rev 11080) +++ trunk/drivers/wingcc.c 2010-06-21 07:22:35 UTC (rev 11081) @@ -27,6 +27,10 @@ #include <string.h> #include <windows.h> +#ifdef _WIN64 +#define GWL_USERDATA GWLP_USERDATA +#define GCL_HCURSOR GCLP_HCURSOR +#endif #include "plplotP.h" #include "drivers.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-06-30 09:57:59
|
Revision: 11084 http://plplot.svn.sourceforge.net/plplot/?rev=11084&view=rev Author: arjenmarkus Date: 2010-06-30 09:57:53 +0000 (Wed, 30 Jun 2010) Log Message: ----------- Adopt the proposed changes by Alessandro Piras. Verified that they worked with gcc on a 32-bits Windows system. (If it turns out that the two functions are not available on older platforms, then we can easily fix that via a suitable macro. In all likelihood, this solves the issue for both 32-bits and 64-bits systems.) Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-06-30 00:01:10 UTC (rev 11083) +++ trunk/drivers/wingcc.c 2010-06-30 09:57:53 UTC (rev 11084) @@ -256,7 +256,7 @@ } else { - pls = (PLStream *) GetWindowLong( hwnd, GWL_USERDATA ); /* Try to get the address to pls for this window */ + pls = (PLStream *) GetWindowLongPtr( hwnd, GWL_USERDATA ); /* Try to get the address to pls for this window */ if ( pls ) /* If we got it, then we will initialise this windows plplot private data area */ { dev = (wingcc_Dev *) pls->dev; @@ -561,7 +561,7 @@ * process this window */ - SetWindowLong( dev->hwnd, GWL_USERDATA, (long) pls ); + SetWindowLongPtr( dev->hwnd, GWL_USERDATA, (LONG_PTR) pls ); dev->SCRN_hdc = dev->hdc = GetDC( dev->hwnd ); /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2010-10-03 13:40:47
|
Revision: 11243 http://plplot.svn.sourceforge.net/plplot/?rev=11243&view=rev Author: arjenmarkus Date: 2010-10-03 13:40:40 +0000 (Sun, 03 Oct 2010) Log Message: ----------- Add support for (very) old version of Windows SDK - alias for SetWindowLongPtr and GetWindowLongPtr Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-10-03 13:08:26 UTC (rev 11242) +++ trunk/drivers/wingcc.c 2010-10-03 13:40:40 UTC (rev 11243) @@ -256,6 +256,9 @@ } else { +#ifndef _WIN64 +#define GetWindowLongPtr GetWindowLong +#endif pls = (PLStream *) GetWindowLongPtr( hwnd, GWL_USERDATA ); /* Try to get the address to pls for this window */ if ( pls ) /* If we got it, then we will initialise this windows plplot private data area */ { @@ -561,7 +564,12 @@ * process this window */ +#ifdef _WIN64 SetWindowLongPtr( dev->hwnd, GWL_USERDATA, (LONG_PTR) pls ); +#else + SetWindowLong( dev->hwnd, GWL_USERDATA, (LONG) pls ); +#endif + dev->SCRN_hdc = dev->hdc = GetDC( dev->hwnd ); /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-08 17:18:11
|
Revision: 11248 http://plplot.svn.sourceforge.net/plplot/?rev=11248&view=rev Author: airwin Date: 2010-10-08 17:18:04 +0000 (Fri, 08 Oct 2010) Log Message: ----------- Style previous commit. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-10-05 01:07:23 UTC (rev 11247) +++ trunk/drivers/wingcc.c 2010-10-08 17:18:04 UTC (rev 11248) @@ -257,7 +257,7 @@ else { #ifndef _WIN64 -#define GetWindowLongPtr GetWindowLong +#define GetWindowLongPtr GetWindowLong #endif pls = (PLStream *) GetWindowLongPtr( hwnd, GWL_USERDATA ); /* Try to get the address to pls for this window */ if ( pls ) /* If we got it, then we will initialise this windows plplot private data area */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-26 01:51:23
|
Revision: 11274 http://plplot.svn.sourceforge.net/plplot/?rev=11274&view=rev Author: airwin Date: 2010-10-26 01:51:16 +0000 (Tue, 26 Oct 2010) Log Message: ----------- Remove corrupted character 0x85 from file where it occurs in comments and one menu string. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2010-10-26 01:31:20 UTC (rev 11273) +++ trunk/drivers/wingcc.c 2010-10-26 01:51:16 UTC (rev 11274) @@ -102,7 +102,7 @@ HBRUSH fillbrush; /* brush used for fills */ HCURSOR cursor; /* Current windows cursor for this window */ HBITMAP bitmap; /* Bitmap of current display; used for fast redraws via blitting */ - HGDIOBJ oldobject; /* Used for tracking objects\x85 probably not really needed but\x85 */ + HGDIOBJ oldobject; /* Used for tracking objects probably not really needed but */ HMENU PopupMenu; PLINT draw_mode; @@ -578,7 +578,7 @@ dev->PopupMenu = CreatePopupMenu(); AppendMenu( dev->PopupMenu, MF_STRING, PopupPrint, "Print" ); - AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, "Next Page\x85" ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, "Next Page" ); AppendMenu( dev->PopupMenu, MF_STRING, PopupQuit, "Quit" ); #ifdef HAVE_FREETYPE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-03 00:53:54
|
Revision: 11589 http://plplot.svn.sourceforge.net/plplot/?rev=11589&view=rev Author: airwin Date: 2011-03-03 00:53:48 +0000 (Thu, 03 Mar 2011) Log Message: ----------- Make -dev wingcc honor the -eofill option. The -eofill option with -dev wingcc now gives the same results for example 27 under wine as -dev xwin under Linux. This was expected since the wine display must ultimately be translated into an X display. A more interesting experiment would be to run -dev wingcc under Microsoft Windows with and without the -eofill option for example 27. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2011-03-02 20:47:12 UTC (rev 11588) +++ trunk/drivers/wingcc.c 2011-03-03 00:53:48 UTC (rev 11589) @@ -646,6 +646,12 @@ plP_setpxl( dev->scale * pls->xdpi / 25.4, dev->scale * pls->ydpi / 25.4 ); plP_setphy( 0, (PLINT) ( dev->scale * dev->width ), 0, (PLINT) ( dev->scale * dev->height ) ); + // Set fill rule. + if( pls->dev_eofill) + SetPolyFillMode( dev->hdc, ALTERNATE); + else + SetPolyFillMode( dev->hdc, WINDING); + #ifdef HAVE_FREETYPE if ( pls->dev_text ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-09-03 14:32:06
|
Revision: 12228 http://plplot.svn.sourceforge.net/plplot/?rev=12228&view=rev Author: andrewross Date: 2012-09-03 14:31:55 +0000 (Mon, 03 Sep 2012) Log Message: ----------- Commit patch from Phil Rosenberg so wingcc works with unicode. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2012-08-27 18:52:02 UTC (rev 12227) +++ trunk/drivers/wingcc.c 2012-09-03 14:31:55 UTC (rev 12228) @@ -27,6 +27,7 @@ #include <string.h> #include <windows.h> +#include <tchar.h> #ifdef _WIN64 #define GWL_USERDATA GWLP_USERDATA #define GCL_HCURSOR GCLP_HCURSOR @@ -145,8 +146,8 @@ // Local Function definitions and function-like defines //-------------------------------------------------------------------------- -static int GetRegValue( char *key_name, char *key_word, char *buffer, int size ); -static int SetRegValue( char *key_name, char *key_word, char *buffer, int dwType, int size ); +static int GetRegValue( TCHAR *key_name, TCHAR *key_word, char *buffer, int size ); +static int SetRegValue( TCHAR *key_name, TCHAR *key_word, char *buffer, int dwType, int size ); static void Resize( PLStream *pls ); static void plD_fill_polygon_wingcc( PLStream *pls ); static void CopySCRtoBMP( PLStream *pls ); @@ -226,7 +227,7 @@ pdt->pl_esc = (plD_esc_fp) plD_esc_wingcc; } -static char* szWndClass = "PlplotWin"; +static TCHAR* szWndClass = _T("PlplotWin"); //-------------------------------------------------------------------------- @@ -257,6 +258,7 @@ else { #ifndef _WIN64 +#undef GetWindowLongPtr #define GetWindowLongPtr GetWindowLong #endif pls = (PLStream *) GetWindowLongPtr( hwnd, GWL_USERDATA ); // Try to get the address to pls for this window @@ -301,7 +303,7 @@ if ( dev->ps.fErase ) { dev->oldcolour = SetBkColor( dev->hdc, RGB( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b ) ); - ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, "", 0, 0 ); + ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T(""), 0, 0 ); SetBkColor( dev->hdc, dev->oldcolour ); } @@ -372,7 +374,7 @@ // dev->oldcolour = SetBkColor( dev->hdc, RGB( pls->cmap0[0].r, pls->cmap0[0].g, pls->cmap0[0].b ) ); - ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, "", 0, 0 ); + ExtTextOut( dev->hdc, 0, 0, ETO_OPAQUE, &dev->rect, _T(""), 0, 0 ); SetBkColor( dev->hdc, dev->oldcolour ); dev->already_erased = 1; @@ -416,9 +418,9 @@ // Variables used for reading the registary keys // might eventually add a user defined pallette here, but for now it just does freetype // - char key_name[] = "Software\\PLplot\\wingcc"; - char Keyword_text[] = "freetype"; - char Keyword_smooth[] = "smooth"; + TCHAR key_name[] = _T("Software\\PLplot\\wingcc"); + TCHAR Keyword_text[] = _T("freetype"); + TCHAR Keyword_smooth[] = _T("smooth"); #endif DrvOpt wingcc_options[] = { @@ -431,6 +433,12 @@ { NULL, DRV_INT, NULL, NULL } }; +// +// Variable for storing the program name +// + TCHAR *program; + int programlength; + // Allocate and initialize device-specific data if ( pls->dev != NULL ) @@ -539,13 +547,24 @@ RegisterClassEx( &dev->wndclass ); + // + //convert the program name to wide char if needed + // +#ifdef UNICODE + printf(pls->program); + programlength=strlen(pls->program)+1; + program=malloc(programlength*sizeof(TCHAR)); + MultiByteToWideChar(CP_UTF8,0,pls->program,programlength,program,programlength); +#else + program=pls->program; +#endif // // Create our main window using that window class. // dev->hwnd = CreateWindowEx( WS_EX_WINDOWEDGE + WS_EX_LEFT, szWndClass, // Class name - pls->program, // Caption + program, // Caption WS_OVERLAPPEDWINDOW, // Style pls->xoffset, // Initial x (use default) pls->yoffset, // Initial y (use default) @@ -557,6 +576,9 @@ NULL // Creation parameters ); +#ifdef UNICODE + free(program); +#endif // // Attach a pointer to the stream to the window's user area @@ -577,9 +599,9 @@ // dev->PopupMenu = CreatePopupMenu(); - AppendMenu( dev->PopupMenu, MF_STRING, PopupPrint, "Print" ); - AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, "Next Page" ); - AppendMenu( dev->PopupMenu, MF_STRING, PopupQuit, "Quit" ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupPrint, _T("Print") ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupNextPage, _T("Next Page") ); + AppendMenu( dev->PopupMenu, MF_STRING, PopupQuit, _T("Quit") ); #ifdef HAVE_FREETYPE @@ -1070,7 +1092,7 @@ // that is is there ! //-------------------------------------------------------------------------- -static int SetRegValue( char *key_name, char *key_word, char *buffer, int dwType, int size ) +static int SetRegValue( TCHAR *key_name, TCHAR *key_word, char *buffer, int dwType, int size ) { int j = 0; @@ -1106,7 +1128,7 @@ // Return code is 1 for success, and 0 for failure. //-------------------------------------------------------------------------- -static int GetRegValue( char *key_name, char *key_word, char *buffer, int size ) +static int GetRegValue( TCHAR *key_name, TCHAR *key_word, char *buffer, int size ) { int ret = 0; HKEY hKey; @@ -1375,7 +1397,7 @@ ZeroMemory( &docinfo, sizeof ( docinfo ) ); docinfo.cbSize = sizeof ( docinfo ); - docinfo.lpszDocName = "Plplot Page"; + docinfo.lpszDocName = _T("Plplot Page"); // // Reset out printer structure to zero and initialise it This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2013-06-27 06:50:39
|
Revision: 12390 http://sourceforge.net/p/plplot/code/12390 Author: arjenmarkus Date: 2013-06-27 06:50:34 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Use an alternative header file for tchar.h, as that is not available in the current version of Cygwin. This requires also defining the macro _T(). Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2013-06-26 21:34:49 UTC (rev 12389) +++ trunk/drivers/wingcc.c 2013-06-27 06:50:34 UTC (rev 12390) @@ -27,7 +27,12 @@ #include <string.h> #include <windows.h> +#if !defined( __CYGWIN__ ) #include <tchar.h> +#else +#include <winnt.h> +#define _T(a) __TEXT(a) +#endif #ifdef _WIN64 #define GWL_USERDATA GWLP_USERDATA #define GCL_HCURSOR GCLP_HCURSOR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-06-27 19:47:13
|
Revision: 12392 http://sourceforge.net/p/plplot/code/12392 Author: andrewross Date: 2013-06-27 19:47:10 +0000 (Thu, 27 Jun 2013) Log Message: ----------- Style recent changes. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2013-06-27 08:02:46 UTC (rev 12391) +++ trunk/drivers/wingcc.c 2013-06-27 19:47:10 UTC (rev 12392) @@ -27,11 +27,11 @@ #include <string.h> #include <windows.h> -#if !defined( __CYGWIN__ ) +#if !defined ( __CYGWIN__ ) #include <tchar.h> #else #include <winnt.h> -#define _T(a) __TEXT(a) +#define _T( a ) __TEXT( a ) #endif #ifdef _WIN64 #define GWL_USERDATA GWLP_USERDATA This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2013-07-07 12:59:54
|
Revision: 12404 http://sourceforge.net/p/plplot/code/12404 Author: arjenmarkus Date: 2013-07-07 12:59:52 +0000 (Sun, 07 Jul 2013) Log Message: ----------- Use the SetClassLongPtr() function in stead of SetClassLong() to make the code useable for both 32-bits and 64-bits versions. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2013-07-02 00:04:52 UTC (rev 12403) +++ trunk/drivers/wingcc.c 2013-07-07 12:59:52 UTC (rev 12404) @@ -199,14 +199,14 @@ SetClassLong( dev->hwnd, GCL_HCURSOR, (long) dev->cursor ); \ SetCursor( dev->cursor ); } while ( 0 ) -#define NormalCursor() do { \ - dev->cursor = LoadCursor( NULL, IDC_ARROW ); \ - SetClassLong( dev->hwnd, GCL_HCURSOR, (long) dev->cursor ); \ +#define NormalCursor() do { \ + dev->cursor = LoadCursor( NULL, IDC_ARROW ); \ + SetClassLongPtr( dev->hwnd, GCL_HCURSOR, (LONG_PTR) dev->cursor ); \ SetCursor( dev->cursor ); } while ( 0 ) -#define BusyCursor() do { \ - dev->cursor = LoadCursor( NULL, IDC_WAIT ); \ - SetClassLong( dev->hwnd, GCL_HCURSOR, (long) dev->cursor ); \ +#define BusyCursor() do { \ + dev->cursor = LoadCursor( NULL, IDC_WAIT ); \ + SetClassLongPtr( dev->hwnd, GCL_HCURSOR, (LONG_PTR) dev->cursor ); \ SetCursor( dev->cursor ); } while ( 0 ) #define PopupPrint 0x08A1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2014-04-06 19:41:24
|
Revision: 13098 http://sourceforge.net/p/plplot/code/13098 Author: arjenmarkus Date: 2014-04-06 19:41:22 +0000 (Sun, 06 Apr 2014) Log Message: ----------- Implement the PL_ESC_GETC escape to add interactivity to the wingcc device. Notes: - No platform-neutral macros to identify the button - the xwin device I used as a template has more functionality (XOR-ing lines for instance) - Not all fields in the PLGraphicsIn structure may be meaningful to MS Windows. "state" is an example, or perhaps that is my limited understanding. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2014-04-04 17:33:29 UTC (rev 13097) +++ trunk/drivers/wingcc.c 2014-04-06 19:41:22 UTC (rev 13098) @@ -84,6 +84,8 @@ PLINT PRNT_width; PLINT PRNT_height; + PLGraphicsIn gin; + char FT_smooth_text; // // WIN32 API variables @@ -987,14 +989,92 @@ dev->pen = CreatePen( PS_SOLID, pls->width, dev->colour ); } +//-------------------------------------------------------------------------- +// GetCursorCmd() +// +// Handle events connected to selecting points (modelled after xwin) +//-------------------------------------------------------------------------- + +static void +GetCursorCmd( PLStream *pls, PLGraphicsIn *gin ) +{ + wingcc_Dev *dev = (wingcc_Dev *) pls->dev; + + HCURSOR crosshair; + HCURSOR previous; + + plGinInit( gin ); + + crosshair = LoadCursor( GetModuleHandle( NULL ), IDC_CROSS ); + previous = SetCursor( crosshair ); + + while ( gin->pX < 0 ) + { + GetMessage( &dev->msg, NULL, 0, 0 ); + TranslateMessage( &dev->msg ); + switch ( (int) dev->msg.message ) + { + case WM_LBUTTONDOWN: + if ( dev->msg.wParam & MK_LBUTTON ) + { + gin->pX = dev->msg.pt.x; + gin->pY = dev->msg.pt.y; + gin->dX = (PLFLT) gin->pX / ( dev->width - 1 ); + gin->dY = 1.0 - (PLFLT) gin->pY / ( dev->height - 1 ); + + gin->button = 1; // AM: there is no macro to indicate the pressed button! + gin->state = 0; // AM: is there an equivalent under Windows? + gin->keysym = 0x20; + } + break; + case WM_CHAR: + // Handle escape + if ( dev->msg.wParam == 0x1b ) + { + gin->pX = 1; // This point is outside the window, but breaks the loop + gin->pY = -1; + gin->dX = (PLFLT) gin->pX / ( dev->width - 1 ); + gin->dY = 1.0 - (PLFLT) gin->pY / ( dev->height - 1 ); + + gin->button = 0; + gin->state = 0; + gin->keysym = 0x1a; + } + break; + } + } + + // Restore the previous cursor + SetCursor( previous ); + +// if ( GetCursorPos(&p) ) +// { +// if ( ScreenToClient( dev->hwnd, &p ) ) +// { +// // Fill the fields, but actually we need to run the event loop +// // We need to call GetMessage() in a loop. Unclear as yet to the +// // actual interface: key/button presses? +// } +// } +} + +//-------------------------------------------------------------------------- +// plD_esc_wingcc() +// +// Handle PLplot escapes +//-------------------------------------------------------------------------- + void plD_esc_wingcc( PLStream *pls, PLINT op, void *ptr ) { wingcc_Dev *dev = (wingcc_Dev *) pls->dev; + PLGraphicsIn *gin = &( dev->gin ); + switch ( op ) { case PLESC_GETC: + GetCursorCmd( pls, (PLGraphicsIn *) ptr ); break; case PLESC_FILL: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2014-04-08 06:52:56
|
Revision: 13100 http://sourceforge.net/p/plplot/code/13100 Author: arjenmarkus Date: 2014-04-08 06:52:52 +0000 (Tue, 08 Apr 2014) Log Message: ----------- Slightly more rational approach to handling keyboard and mouse events. All characters are now passed on to the caller, so the escape character is no longer special - this is left to the calling program, as it should be. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2014-04-07 21:43:17 UTC (rev 13099) +++ trunk/drivers/wingcc.c 2014-04-08 06:52:52 UTC (rev 13100) @@ -1028,18 +1028,15 @@ } break; case WM_CHAR: - // Handle escape - if ( dev->msg.wParam == 0x1b ) - { - gin->pX = 1; // This point is outside the window, but breaks the loop - gin->pY = -1; - gin->dX = (PLFLT) gin->pX / ( dev->width - 1 ); - gin->dY = 1.0 - (PLFLT) gin->pY / ( dev->height - 1 ); + gin->pX = dev->msg.pt.x; + gin->pY = dev->msg.pt.y; + gin->dX = (PLFLT) gin->pX / ( dev->width - 1 ); + gin->dY = 1.0 - (PLFLT) gin->pY / ( dev->height - 1 ); - gin->button = 0; - gin->state = 0; - gin->keysym = 0x1a; - } + gin->button = 0; + gin->state = 0; + gin->keysym = dev->msg.wParam; + break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-04-26 02:02:57
|
Revision: 13107 http://sourceforge.net/p/plplot/code/13107 Author: airwin Date: 2014-04-26 02:02:55 +0000 (Sat, 26 Apr 2014) Log Message: ----------- Style previous commit. Modified Paths: -------------- trunk/drivers/wingcc.c Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2014-04-21 04:34:46 UTC (rev 13106) +++ trunk/drivers/wingcc.c 2014-04-26 02:02:55 UTC (rev 13107) @@ -76,17 +76,17 @@ typedef struct { - PLFLT scale; // scaling factor to "blow up" to the "virtual" page in removing hidden lines - PLINT width; // Window width (which can change) - PLINT height; // Window Height + PLFLT scale; // scaling factor to "blow up" to the "virtual" page in removing hidden lines + PLINT width; // Window width (which can change) + PLINT height; // Window Height - PLFLT PRNT_scale; - PLINT PRNT_width; - PLINT PRNT_height; + PLFLT PRNT_scale; + PLINT PRNT_width; + PLINT PRNT_height; PLGraphicsIn gin; - char FT_smooth_text; + char FT_smooth_text; // // WIN32 API variables // @@ -1000,13 +1000,13 @@ { wingcc_Dev *dev = (wingcc_Dev *) pls->dev; - HCURSOR crosshair; - HCURSOR previous; + HCURSOR crosshair; + HCURSOR previous; plGinInit( gin ); crosshair = LoadCursor( GetModuleHandle( NULL ), IDC_CROSS ); - previous = SetCursor( crosshair ); + previous = SetCursor( crosshair ); while ( gin->pX < 0 ) { @@ -1064,7 +1064,7 @@ void plD_esc_wingcc( PLStream *pls, PLINT op, void *ptr ) { - wingcc_Dev *dev = (wingcc_Dev *) pls->dev; + wingcc_Dev *dev = (wingcc_Dev *) pls->dev; PLGraphicsIn *gin = &( dev->gin ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |