GtkMenu* XYWnd::m_mnuDrop = 0;
-// this is disabled, and broken
-// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394
-#if 0
-void WXY_Print(){
- long width, height;
- width = g_pParentWnd->ActiveXY()->Width();
- height = g_pParentWnd->ActiveXY()->Height();
- unsigned char* img;
- const char* filename;
-
- filename = file_dialog( GTK_WIDGET( MainFrame_getWindow() ), FALSE, "Save Image", 0, FILTER_BMP );
- if ( !filename ) {
- return;
- }
-
- g_pParentWnd->ActiveXY()->MakeCurrent();
- img = (unsigned char*)malloc( width * height * 3 );
- glReadPixels( 0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,img );
-
- FILE *fp;
- fp = fopen( filename, "wb" );
- if ( fp ) {
- unsigned short bits;
- unsigned long cmap, bfSize;
-
- bits = 24;
- cmap = 0;
- bfSize = 54 + width * height * 3;
-
- long byteswritten = 0;
- long pixoff = 54 + cmap * 4;
- short res = 0;
- char m1 = 'B', m2 = 'M';
- fwrite( &m1, 1, 1, fp ); byteswritten++; // B
- fwrite( &m2, 1, 1, fp ); byteswritten++; // M
- fwrite( &bfSize, 4, 1, fp ); byteswritten += 4; // bfSize
- fwrite( &res, 2, 1, fp ); byteswritten += 2; // bfReserved1
- fwrite( &res, 2, 1, fp ); byteswritten += 2; // bfReserved2
- fwrite( &pixoff, 4, 1, fp ); byteswritten += 4; // bfOffBits
-
- unsigned long biSize = 40, compress = 0, size = 0;
- long pixels = 0;
- unsigned short planes = 1;
- fwrite( &biSize, 4, 1, fp ); byteswritten += 4; // biSize
- fwrite( &width, 4, 1, fp ); byteswritten += 4; // biWidth
- fwrite( &height, 4, 1, fp ); byteswritten += 4; // biHeight
- fwrite( &planes, 2, 1, fp ); byteswritten += 2; // biPlanes
- fwrite( &bits, 2, 1, fp ); byteswritten += 2; // biBitCount
- fwrite( &compress, 4, 1, fp ); byteswritten += 4; // biCompression
- fwrite( &size, 4, 1, fp ); byteswritten += 4; // biSizeImage
- fwrite( &pixels, 4, 1, fp ); byteswritten += 4; // biXPelsPerMeter
- fwrite( &pixels, 4, 1, fp ); byteswritten += 4; // biYPelsPerMeter
- fwrite( &cmap, 4, 1, fp ); byteswritten += 4; // biClrUsed
- fwrite( &cmap, 4, 1, fp ); byteswritten += 4; // biClrImportant
-
- unsigned long widthDW = ( ( ( width * 24 ) + 31 ) / 32 * 4 );
- long row, row_size = width * 3;
- for ( row = 0; row < height; row++ )
- {
- unsigned char* buf = img + row * row_size;
-
- // write a row
- int col;
- for ( col = 0; col < row_size; col += 3 )
- {
- putc( buf[col + 2], fp );
- putc( buf[col + 1], fp );
- putc( buf[col], fp );
- }
- byteswritten += row_size;
-
- unsigned long count;
- for ( count = row_size; count < widthDW; count++ )
- {
- putc( 0, fp ); // dummy
- byteswritten++;
- }
- }
-
- fclose( fp );
- }
-
- free( img );
-}
-#endif
-
#include "timer.h"