/* * InitializeCursors - initialize the cursors * - should be cleaned up with CleanupCursors */ void InitializeCursors( void ) { hCursor[PENCIL_CUR] = _wpi_loadcursor( Instance, PENCILCURSOR ); hCursor[CROSS_CUR] = _wpi_loadcursor( Instance, CROSSHAIRSCUR ); hCursor[FILL_CUR] = _wpi_loadcursor( Instance, FILLCURSOR ); hCursor[BRUSH_CUR] = _wpi_loadcursor( Instance, PAINTBRUSHCUR ); hCursor[HOTSPOT_CUR] = _wpi_loadcursor( Instance, HOTSPOTCUR ); } /* InitializeCursors */
/* * PlaceAndPaste - find out where the image is to be placed and then paste it there */ void PlaceAndPaste( void ) { HBITMAP hbitmap; WPI_POINT pointsize; img_node *node; WPI_POINT pt; unsigned long format; int bm_width; int bm_height; format = 0; node = GetCurrentNode(); if( node == NULL ) { return; } if( !_wpi_isclipboardformatavailable( Instance, CF_BITMAP, &format ) ) { PrintHintTextByID( WIE_NOBITMAPINCLIPBOARD, NULL ); return; } pointsize = GetPointSize( node->hwnd ); if( fEnableCutCopy ) { RedrawPrevClip( node->hwnd ); PasteImage( NULL, pointsize, node->hwnd ); fEnableCutCopy = FALSE; return; } prevToolType = SetToolType( IMGED_PASTE ); pointCursor = _wpi_loadcursor( Instance, POINT_CUR ); prevCursor = _wpi_setcursor( pointCursor ); _wpi_openclipboard( Instance, HMainWindow ); hbitmap = _wpi_getclipboarddata( Instance, CF_BITMAP ); _wpi_getbitmapdim( hbitmap, &bm_width, &bm_height ); _wpi_closeclipboard( Instance ); dragWidth = (short)(bm_width * pointsize.x); dragHeight = (short)(bm_height * pointsize.y); WriteSetSizeText( WIE_CLIPBOARDBITMAPSIZE, bm_width, bm_height); _wpi_getcursorpos( &pt ); _wpi_screentoclient( node->hwnd, &pt ); pt.x = pt.x / pointsize.x; pt.y = pt.y / pointsize.y; _wpi_setcapture( node->hwnd ); firstTime = true; DragClipBitmap( node->hwnd, &pt, pointsize ); } /* PlaceAndPaste */