| 1 |
|
| 2 |
/* $Id: tixWinDraw.c,v 1.1.1.1 2000/05/17 11:08:55 idiscovery Exp $ */ |
| 3 |
|
| 4 |
/* |
| 5 |
* tixWinDraw.c -- |
| 6 |
* |
| 7 |
* Implement the Windows specific function calls for drawing. |
| 8 |
* |
| 9 |
* Copyright (c) 1996, Expert Interface Technologies |
| 10 |
* |
| 11 |
* See the file "license.terms" for information on usage and redistribution |
| 12 |
* of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 13 |
* |
| 14 |
*/ |
| 15 |
|
| 16 |
#include <tkInt.h> |
| 17 |
#ifdef __PM__ |
| 18 |
# define __PM_WIN__ |
| 19 |
# include <tkOS2Int.h> |
| 20 |
#else |
| 21 |
# include <tkWinInt.h> |
| 22 |
#endif |
| 23 |
#include "tixInt.h" |
| 24 |
#include "tixPort.h" |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
/*---------------------------------------------------------------------- |
| 29 |
* TixpDrawTmpLine -- |
| 30 |
* |
| 31 |
* Draws a "temporarily" line on the desktop window with XOR |
| 32 |
* drawing mode. This function is used by the PanedWindow and |
| 33 |
* ResizeHandler to draw the rubberband lines. Calling the |
| 34 |
* function again with the same parameters cancels the temporary |
| 35 |
* lines without affecting what was originally on the screen. |
| 36 |
*---------------------------------------------------------------------- |
| 37 |
*/ |
| 38 |
|
| 39 |
void |
| 40 |
TixpDrawTmpLine(x1, y1, x2, y2, tkwin) |
| 41 |
int x1; |
| 42 |
int y1; |
| 43 |
int x2; |
| 44 |
int y2; |
| 45 |
Tk_Window tkwin; |
| 46 |
{ |
| 47 |
#ifdef __PM__ |
| 48 |
panic("Not implemented: TixpDrawTmpLine"); |
| 49 |
#else |
| 50 |
HWND desktop; |
| 51 |
HDC hdc; |
| 52 |
HPEN hpen; |
| 53 |
HGDIOBJ old; |
| 54 |
|
| 55 |
desktop = GetDesktopWindow(); |
| 56 |
hdc = GetWindowDC(desktop); |
| 57 |
hpen = CreatePen(PS_SOLID, 0, RGB(255,255,255)); |
| 58 |
|
| 59 |
old = SelectObject(hdc, hpen); |
| 60 |
SetROP2(hdc, R2_XORPEN); |
| 61 |
|
| 62 |
MoveToEx(hdc, x1, y1, NULL); |
| 63 |
LineTo(hdc, x2, y2); |
| 64 |
|
| 65 |
SelectObject(hdc, old); |
| 66 |
DeleteObject(hpen); |
| 67 |
ReleaseDC(desktop, hdc); |
| 68 |
#endif |
| 69 |
} |
| 70 |
|
| 71 |
/*---------------------------------------------------------------------- |
| 72 |
* TixpDrawAnchorLines -- |
| 73 |
* |
| 74 |
* See comments near Tix_DrawAnchorLines. |
| 75 |
*---------------------------------------------------------------------- |
| 76 |
*/ |
| 77 |
|
| 78 |
#ifndef __PM__ |
| 79 |
void |
| 80 |
TixpDrawAnchorLines(display, drawable, gc, x, y, w, h) |
| 81 |
Display *display; |
| 82 |
Drawable drawable; |
| 83 |
GC gc; |
| 84 |
int x; |
| 85 |
int y; |
| 86 |
int w; |
| 87 |
int h; |
| 88 |
{ |
| 89 |
HDC hdc; |
| 90 |
TkWinDCState state; |
| 91 |
HPEN hpen; |
| 92 |
HGDIOBJ old; |
| 93 |
|
| 94 |
hdc = TkWinGetDrawableDC(display, drawable, &state); |
| 95 |
hpen = CreatePen(PS_DOT, 1, gc->foreground); |
| 96 |
|
| 97 |
old = SelectObject(hdc, hpen); |
| 98 |
MoveToEx(hdc, x, y, NULL); |
| 99 |
LineTo(hdc, x, y+h-1); |
| 100 |
LineTo(hdc, x+w-1, y+h-1); |
| 101 |
LineTo(hdc, x+w-1, y); |
| 102 |
LineTo(hdc, x, y); |
| 103 |
|
| 104 |
SelectObject(hdc, old); |
| 105 |
DeleteObject(hpen); |
| 106 |
|
| 107 |
TkWinReleaseDrawableDC(drawable, hdc, &state); |
| 108 |
} |
| 109 |
#endif |
| 110 |
|
| 111 |
|