ReactOS  0.4.14-dev-98-gb0d4763
floatwindow.c File Reference
#include "precomp.h"
Include dependency graph for floatwindow.c:

Go to the source code of this file.

Macros

#define ID_TIMER1   1
 
#define ID_TIMER2   2
 
#define ID_TIMER3   3
 

Functions

BOOL ShowHideWindow (HWND hwnd)
 
BOOL FloatToolbarCreateToolsGui (PMAIN_WND_INFO Info)
 
VOID FloatWindowPaintColorPicker (HWND hColorPicker)
 
VOID FloatWindowPaintHueSlider (HWND hHueSlider)
 
BOOL FloatToolbarCreateColorsGui (PMAIN_WND_INFO Info)
 
BOOL FloatToolbarCreateHistoryGui (PMAIN_WND_INFO Info)
 
static VOID DoTimer (PFLT_WND FltInfo, UINT_PTR idTimer)
 
LRESULT CALLBACK FloatToolbarWndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 
BOOL InitFloatWndClass (VOID)
 
VOID UninitFloatWndImpl (VOID)
 

Variables

static const TCHAR szFloatWndClass [] = TEXT("ImageSoftFloatWndClass")
 
TBBUTTON ToolsButtons []
 
TBBUTTON HistoryButtons []
 

Macro Definition Documentation

◆ ID_TIMER1

#define ID_TIMER1   1

Definition at line 5 of file floatwindow.c.

◆ ID_TIMER2

#define ID_TIMER2   2

Definition at line 6 of file floatwindow.c.

◆ ID_TIMER3

#define ID_TIMER3   3

Definition at line 7 of file floatwindow.c.

Function Documentation

◆ DoTimer()

static VOID DoTimer ( PFLT_WND  FltInfo,
UINT_PTR  idTimer 
)
static

Definition at line 345 of file floatwindow.c.

347 {
348  switch (idTimer)
349  {
350  /* timer to check if cursor is in toolbar coords */
351  case ID_TIMER1:
352  {
353  POINT pt;
354 
355  /* kill timer if toobar is not opaque */
356  if (FltInfo->bOpaque != TRUE)
357  {
358  KillTimer(FltInfo->hSelf,
359  ID_TIMER1);
360  break;
361  }
362 
363  if (GetCursorPos(&pt))
364  {
365  RECT rect;
366 
367  if (GetWindowRect(FltInfo->hSelf,
368  &rect))
369  {
370  if (!PtInRect(&rect,
371  pt))
372  {
373  KillTimer(FltInfo->hSelf,
374  ID_TIMER1);
375  KillTimer(FltInfo->hSelf,
376  ID_TIMER2);
377 
378  /* timer to fade out toolbar */
379  SetTimer(FltInfo->hSelf,
380  ID_TIMER3,
381  50,
382  NULL);
383  }
384  }
385  }
386  }
387  break;
388 
389  /* timer to fade in toolbar */
390  case ID_TIMER2:
391  {
392  SetLayeredWindowAttributes(FltInfo->hSelf,
393  0,
394  (255 * FltInfo->Transparancy) / 100,
395  LWA_ALPHA);
396 
397  /* increment transparancy until it is opaque (100) */
398  FltInfo->Transparancy += 5;
399 
400  if (FltInfo->Transparancy == 100)
401  {
402  SetWindowLongPtr(FltInfo->hSelf,
403  GWL_EXSTYLE,
404  GetWindowLongPtr(FltInfo->hSelf,
406 
407  FltInfo->bOpaque = TRUE;
408 
409  KillTimer(FltInfo->hSelf,
410  ID_TIMER2);
411  }
412  }
413  break;
414 
415  case ID_TIMER3:
416  {
417  LONG_PTR Style;
418 
419  Style = GetWindowLongPtr(FltInfo->hSelf,
420  GWL_EXSTYLE);
421 
422  if (Style & ~WS_EX_LAYERED)
423  {
424  SetWindowLongPtr(FltInfo->hSelf,
425  GWL_EXSTYLE,
426  Style | WS_EX_LAYERED);
427  }
428 
429  FltInfo->Transparancy -= 5;
430 
431  if (FltInfo->Transparancy >= 60)
432  {
433  /* set the tranclucency to 60% */
434  SetLayeredWindowAttributes(FltInfo->hSelf,
435  0,
436  (255 * FltInfo->Transparancy) / 100,
437  LWA_ALPHA);
438 
439  if (FltInfo->Transparancy == 60)
440  {
441  FltInfo->bOpaque = FALSE;
442 
443  KillTimer(FltInfo->hSelf,
444  ID_TIMER3);
445  }
446 
447  }
448  }
449  break;
450  }
451 }
HWND hSelf
Definition: precomp.h:46
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define ID_TIMER3
Definition: floatwindow.c:7
#define ID_TIMER1
Definition: floatwindow.c:5
#define GWL_EXSTYLE
Definition: winuser.h:845
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define SetWindowLongPtr
Definition: treelist.c:70
& rect
Definition: startmenu.cpp:1413
smooth NULL
Definition: ftsmooth.c:416
BOOL bOpaque
Definition: precomp.h:53
#define ID_TIMER2
Definition: floatwindow.c:6
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
const DWORD Style
Definition: appswitch.c:71
#define WS_EX_LAYERED
Definition: winuser.h:389
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define GetWindowLongPtr
Definition: treelist.c:73
INT Transparancy
Definition: precomp.h:52

Referenced by FloatToolbarWndProc().

◆ FloatToolbarCreateColorsGui()

BOOL FloatToolbarCreateColorsGui ( PMAIN_WND_INFO  Info)

Definition at line 170 of file floatwindow.c.

171 {
172  HWND hColorPicker;
173  HWND hHueSlider;
174  HWND hMouseButton;
175  HWND hMore;
176  RECT rect;
177  HBITMAP hMoreBitmap;
178 
179  GetClientRect(Info->fltColors->hSelf,
180  &rect);
181 
182  hColorPicker = CreateWindowEx(0,
183  WC_STATIC,
184  NULL,
186  2,
187  2,
188  (int) (rect.right * 0.65),
189  rect.bottom - 2,
190  Info->fltColors->hSelf,
191  NULL,
192  hInstance,
193  NULL);
194  if (hColorPicker == NULL)
195  return FALSE;
196 
197  hHueSlider = CreateWindowEx(0,
198  WC_STATIC,
199  NULL,
201  145,
202  35,
203  25,
204  135,
205  Info->fltColors->hSelf,
206  NULL,
207  hInstance,
208  NULL);
209  if (hHueSlider == NULL)
210  return FALSE;
211 
212  hMouseButton = CreateWindowEx(0,
213  WC_COMBOBOX,
214  NULL,
216  118, 5, 75, 25,
217  Info->fltColors->hSelf,
218  NULL,
219  hInstance,
220  NULL);
221  if (hMouseButton == NULL)
222  return FALSE;
223 
224  MakeFlatCombo(hMouseButton);
225 
226  /* temp, just testing */
227  SendMessage(hMouseButton, CB_ADDSTRING, 0, (LPARAM)_T("Primary"));
228  SendMessage(hMouseButton, CB_ADDSTRING, 0, (LPARAM)_T("Secondary"));
229  SendMessage(hMouseButton, CB_SETCURSEL, 0, 0);
230 
231 
233  WC_BUTTON,
234  NULL,
236  rect.right - 15,
237  rect.bottom - 15,
238  15, 15,
239  Info->fltColors->hSelf,
240  NULL,
241  hInstance,
242  NULL);
243  if (hMore == NULL)
244  return FALSE;
245 
246  hMoreBitmap = (HBITMAP)LoadImage(hInstance,
248  IMAGE_BITMAP,
249  12,
250  11,
252  if (hMoreBitmap != NULL)
253  {
254  SendMessage(hMore,
255  BM_SETIMAGE,
256  IMAGE_BITMAP,
257  (LPARAM)hMoreBitmap);
258  }
259 
260 
261  /* temp functions for playing about with possible layouts */
262  FloatWindowPaintHueSlider(hHueSlider);
263  FloatWindowPaintColorPicker(hColorPicker);
264 
265  if (hColorPicker != NULL)
266  {
267  HDC hDc = GetDC(hColorPicker);
268  TextOut(hDc, 8, 75, _T("Possible layout?"), 16);
269  ReleaseDC(hColorPicker, hDc);
270  }
271 
272  return TRUE;
273 
274 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define WC_BUTTON
Definition: commctrl.h:4597
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
#define WS_CHILD
Definition: pedump.c:617
#define BM_SETIMAGE
Definition: winuser.h:1904
& rect
Definition: startmenu.cpp:1413
struct TraceInfo Info
HINSTANCE hInstance
Definition: charmap.c:20
#define WC_STATIC
Definition: commctrl.h:4653
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowEx
Definition: winuser.h:5656
#define CB_ADDSTRING
Definition: winuser.h:1918
smooth NULL
Definition: ftsmooth.c:416
VOID FloatWindowPaintColorPicker(HWND hColorPicker)
Definition: floatwindow.c:115
LONG_PTR LPARAM
Definition: windef.h:208
#define WC_COMBOBOX
Definition: commctrl.h:4689
#define IDB_COLORSMORE
Definition: resource.h:181
#define _T(x)
Definition: vfdio.h:22
VOID FloatWindowPaintHueSlider(HWND hHueSlider)
Definition: floatwindow.c:142
#define LR_LOADTRANSPARENT
Definition: winuser.h:1083
#define BS_BITMAP
Definition: winuser.h:258
#define CB_SETCURSEL
Definition: winuser.h:1943
#define LR_LOADMAP3DCOLORS
Definition: winuser.h:1087
VOID MakeFlatCombo(HWND hwndCombo)
Definition: custcombo.c:199
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define CBS_DROPDOWN
Definition: winuser.h:283
#define IMAGE_BITMAP
Definition: winuser.h:211
#define SendMessage
Definition: winuser.h:5744
#define TextOut
Definition: wingdi.h:4478
#define LoadImage
Definition: winuser.h:5716
static HBITMAP
Definition: button.c:44
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_STATICEDGE
Definition: winuser.h:403

Referenced by MainWndCreateFloatWindows().

◆ FloatToolbarCreateHistoryGui()

BOOL FloatToolbarCreateHistoryGui ( PMAIN_WND_INFO  Info)

Definition at line 278 of file floatwindow.c.

279 {
280  HWND hList;
281  HWND hButtons;
282  HIMAGELIST hImageList;
283  INT NumButtons;
284 
285  hList = CreateWindowEx(0,
286  WC_LISTBOX,
287  NULL,
289  0, 0, 143, 100,
290  Info->fltHistory->hSelf,
291  NULL,
292  hInstance,
293  NULL);
294  if (hList == NULL)
295  return FALSE;
296 
297  NumButtons = sizeof(HistoryButtons) / sizeof(HistoryButtons[0]);
298  hButtons = CreateWindowEx(0,
300  NULL,
302  0, 0, 0, 0,
303  Info->fltHistory->hSelf,
304  NULL,
305  hInstance,
306  NULL);
307  if (hButtons != NULL)
308  {
309  SendMessage(hButtons,
311  sizeof(ToolsButtons[0]),
312  0);
313 
314  SendMessage(hButtons,
316  0,
317  (LPARAM)MAKELONG(10, 10));
318 
319  hImageList = InitImageList(NumButtons,
320  IDB_HISTBACK);
321 
324  0,
325  (LPARAM)hImageList));
326 
327  SendMessage(hButtons,
329  0,
330  MAKELONG(18, 16));
331 
332  SendMessage(hButtons,
334  NumButtons,
336 
337  return TRUE;
338  }
339 
340  return FALSE;
341 }
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1107
#define WC_LISTBOX
Definition: commctrl.h:4683
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define TRUE
Definition: types.h:120
#define LBS_EXTENDEDSEL
Definition: pedump.c:689
#define WS_CHILD
Definition: pedump.c:617
TBBUTTON ToolsButtons[]
Definition: floatwindow.c:9
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define CCS_NODIVIDER
Definition: commctrl.h:2220
HINSTANCE hInstance
Definition: charmap.c:20
TBBUTTON HistoryButtons[]
Definition: floatwindow.c:35
#define CreateWindowEx
Definition: winuser.h:5656
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CCS_BOTTOM
Definition: commctrl.h:2216
#define TB_SETIMAGELIST
Definition: commctrl.h:1122
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define IDB_HISTBACK
Definition: resource.h:175
HWND hList
Definition: livecd.c:10
#define SendMessage
Definition: winuser.h:5744
#define WS_VISIBLE
Definition: pedump.c:620
#define TBSTYLE_FLAT
Definition: commctrl.h:964

Referenced by MainWndCreateFloatWindows().

◆ FloatToolbarCreateToolsGui()

BOOL FloatToolbarCreateToolsGui ( PMAIN_WND_INFO  Info)

Definition at line 55 of file floatwindow.c.

56 {
57  HWND hTb;
58  HIMAGELIST hImageList;
59  INT NumButtons;
60 
61  NumButtons = sizeof(ToolsButtons) / sizeof(ToolsButtons[0]);
62 
63  hTb = CreateWindowEx(0,
65  NULL,
67  0, 0, 32, 200,
68  Info->fltTools->hSelf,
69  NULL,
70  hInstance,
71  NULL);
72  if (hTb != NULL)
73  {
74  SendMessage(hTb,
76  0,
78 
79  SendMessage(hTb,
81  sizeof(ToolsButtons[0]),
82  0);
83 
84  SendMessage(hTb,
86  0,
87  (LPARAM)MAKELONG(16, 16));
88 
89  hImageList = InitImageList(NumButtons,
91 
94  0,
95  (LPARAM)hImageList));
96 
97  SendMessage(hTb,
99  NumButtons,
101 
102  SendMessage(hTb,
103  TB_AUTOSIZE,
104  0,
105  0);
106 
107  return TRUE;
108  }
109 
110  return FALSE;
111 }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define TRUE
Definition: types.h:120
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:985
#define WS_CHILD
Definition: pedump.c:617
TBBUTTON ToolsButtons[]
Definition: floatwindow.c:9
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define CCS_NODIVIDER
Definition: commctrl.h:2220
HINSTANCE hInstance
Definition: charmap.c:20
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define CreateWindowEx
Definition: winuser.h:5656
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TB_SETIMAGELIST
Definition: commctrl.h:1122
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define IDB_TOOLSRECTSEL
Definition: resource.h:154
#define SendMessage
Definition: winuser.h:5744
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:962
#define WS_VISIBLE
Definition: pedump.c:620
#define TBSTYLE_FLAT
Definition: commctrl.h:964
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1162

Referenced by MainWndCreateFloatWindows().

◆ FloatToolbarWndProc()

LRESULT CALLBACK FloatToolbarWndProc ( HWND  hwnd,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 454 of file floatwindow.c.

458 {
459  PFLT_WND FltInfo;
460 
461  /* Get the window context */
462  FltInfo = (PFLT_WND)GetWindowLongPtr(hwnd,
463  GWLP_USERDATA);
464  if (FltInfo == NULL && Message != WM_CREATE)
465  {
466  goto HandleDefaultMessage;
467  }
468 
469  switch(Message)
470  {
471  case WM_CREATE:
472  {
473  FltInfo = (PFLT_WND)(((LPCREATESTRUCT)lParam)->lpCreateParams);
474 
475  /*FIXME: read this from registry */
476 // FltInfo->bShow = TRUE;
477 
480  (LONG_PTR)FltInfo);
481 
482  FltInfo->bOpaque = FALSE;
483 
485  GWL_EXSTYLE,
488 
489  /* set the tranclucency to 60% */
490  FltInfo->Transparancy = 60;
491  SetLayeredWindowAttributes(hwnd,
492  0,
493  (255 * FltInfo->Transparancy) / 100,
494  LWA_ALPHA);
495  }
496  break;
497 
498  case WM_TIMER:
499  {
500  DoTimer(FltInfo,
501  wParam);
502  }
503  break;
504 
505  case WM_NCMOUSEMOVE:
506  case WM_MOUSEMOVE:
507  {
508  if (FltInfo->bOpaque == FALSE)
509  {
510 
512  NULL,
513  NULL,
515 
516  FltInfo->bOpaque = TRUE;
517  //MessageBox(NULL, _T("in"), _T("Hit test"), MB_OK | MB_ICONEXCLAMATION);
518 
519  /* timer to check if cursor is in toolbar coords */
520  SetTimer(hwnd,
521  ID_TIMER1,
522  200,
523  NULL);
524 
525  /* timer to fade in the toolbars */
526  SetTimer(hwnd,
527  ID_TIMER2,
528  50,
529  NULL);
530  }
531  }
532  break;
533 
534  case WM_CLOSE:
535  ShowHideWindow(FltInfo->hSelf);
536  break;
537 
538  case WM_COMMAND:
539  {
540  if (LOWORD(wParam) == IDCANCEL)
541  ShowHideWindow(FltInfo->hSelf);
542 
543  switch(LOWORD(wParam))
544  {
545  case ID_NEW:
546  MessageBox(hwnd, _T("Kapow!"), _T("Hit test"), MB_OK | MB_ICONEXCLAMATION);
547  break;
548 
549  case ID_CLONESTAMP:
550  case ID_COLORPICKER:
551  case ID_ECLIPSE:
552  case ID_ECLIPSESEL:
553  case ID_ERASER:
554  case ID_FREEFORM:
555  case ID_LASOO:
556  case ID_LINE:
557  case ID_MAGICWAND:
558  case ID_MOVE:
559  case ID_MOVESEL:
560  case ID_PAINTBRUSH:
561  case ID_PAINTBUCKET:
562  case ID_PENCIL:
563  case ID_RECOLORING:
564  case ID_RECTANGLE:
565  case ID_ROUNDRECT:
566  case ID_TEXT:
567  case ID_ZOOM:
568  /*SendMessage(Info->hSelf,
569  LOWORD(wParam),
570  wParam,
571  lParam);*/
572  break;
573  }
574  }
575  break;
576 
577  case WM_NCACTIVATE:
578  /* FIXME: needs fully implementing */
579  return DefWindowProc(hwnd,
580  Message,
581  TRUE,
582  lParam);
583  break;
584 
585  case WM_DESTROY:
588  0);
589  break;
590 
591  default:
592 HandleDefaultMessage:
593  return DefWindowProc(hwnd,
594  Message,
595  wParam,
596  lParam);
597  }
598 
599  return 0;
600 }
#define ID_PENCIL
Definition: resource.h:73
static VOID DoTimer(PFLT_WND FltInfo, UINT_PTR idTimer)
Definition: floatwindow.c:345
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hSelf
Definition: precomp.h:46
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define TRUE
Definition: types.h:120
#define ID_MOVESEL
Definition: resource.h:70
#define ID_TIMER1
Definition: floatwindow.c:5
#define ID_TEXT
Definition: definitions.h:126
#define GWL_EXSTYLE
Definition: winuser.h:845
#define ID_ECLIPSE
Definition: resource.h:62
#define ID_MAGICWAND
Definition: resource.h:68
#define RDW_FRAME
Definition: winuser.h:1198
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define ID_CLONESTAMP
Definition: resource.h:60
#define ID_RECOLORING
Definition: resource.h:74
#define ID_LINE
Definition: definitions.h:127
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define ID_FREEFORM
Definition: resource.h:65
#define ID_PAINTBRUSH
Definition: resource.h:71
#define WM_NCACTIVATE
Definition: winuser.h:1670
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
BOOL bOpaque
Definition: precomp.h:53
#define ID_TIMER2
Definition: floatwindow.c:6
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define ID_LASOO
Definition: resource.h:66
#define _T(x)
Definition: vfdio.h:22
#define RDW_ERASE
Definition: winuser.h:1197
#define WM_TIMER
Definition: winuser.h:1724
#define WM_CLOSE
Definition: winuser.h:1603
#define WS_EX_LAYERED
Definition: winuser.h:389
#define ID_ROUNDRECT
Definition: resource.h:77
CHAR Message[80]
Definition: alive.c:5
#define ID_ZOOM
Definition: definitions.h:122
#define ID_NEW
Definition: resource.h:21
#define MessageBox
Definition: winuser.h:5723
BOOL ShowHideWindow(HWND hwnd)
Definition: floatwindow.c:45
#define WM_COMMAND
Definition: winuser.h:1722
#define ID_ECLIPSESEL
Definition: resource.h:63
#define ID_MOVE
Definition: resource.h:69
struct _FLT_WND * PFLT_WND
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define MB_OK
Definition: winuser.h:784
#define ID_ERASER
Definition: resource.h:64
#define WM_CREATE
Definition: winuser.h:1590
#define ID_PAINTBUCKET
Definition: resource.h:72
#define ID_COLORPICKER
Definition: resource.h:61
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define ID_RECTANGLE
Definition: resource.h:75
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NCMOUSEMOVE
Definition: winuser.h:1673
INT Transparancy
Definition: precomp.h:52
#define RDW_INVALIDATE
Definition: winuser.h:1200

Referenced by InitFloatWndClass().

◆ FloatWindowPaintColorPicker()

VOID FloatWindowPaintColorPicker ( HWND  hColorPicker)

Definition at line 115 of file floatwindow.c.

116 {
117  HDC hdc;
118  RECT rect;
119 
120  InvalidateRect(hColorPicker,
121  NULL,
122  TRUE);
123  UpdateWindow(hColorPicker);
124 
125  hdc = GetDC(hColorPicker);
126 
127  GetClientRect(hColorPicker,
128  &rect);
129 
130  Ellipse(hdc,
131  rect.left,
132  rect.top,
133  rect.right,
134  rect.bottom);
135 
136  ReleaseDC(hColorPicker,
137  hdc);
138 
139 }
#define TRUE
Definition: types.h:120
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
BOOL WINAPI UpdateWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by FloatToolbarCreateColorsGui().

◆ FloatWindowPaintHueSlider()

VOID FloatWindowPaintHueSlider ( HWND  hHueSlider)

Definition at line 142 of file floatwindow.c.

143 {
144  HDC hdc;
145  RECT rect;
146 
147  InvalidateRect(hHueSlider,
148  NULL,
149  TRUE);
150  UpdateWindow(hHueSlider);
151 
152  hdc = GetDC(hHueSlider);
153 
154  GetClientRect(hHueSlider,
155  &rect);
156 
157  Rectangle(hdc,
158  rect.left,
159  rect.top,
160  rect.right,
161  rect.bottom);
162 
163  ReleaseDC(hHueSlider,
164  hdc);
165 
166 }
#define TRUE
Definition: types.h:120
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
BOOL WINAPI UpdateWindow(_In_ HWND)
& rect
Definition: startmenu.cpp:1413
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by FloatToolbarCreateColorsGui().

◆ InitFloatWndClass()

BOOL InitFloatWndClass ( VOID  )

Definition at line 604 of file floatwindow.c.

605 {
606  WNDCLASSEX wc = {0};
607 
608  wc.cbSize = sizeof(WNDCLASSEX);
609  wc.style = CS_HREDRAW | CS_VREDRAW;
611  wc.hInstance = hInstance;
612  wc.hIcon = NULL;
613  wc.hCursor = LoadCursor(NULL,
614  IDC_ARROW);
615  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
617  wc.hIconSm = NULL;
618 
619  return RegisterClassEx(&wc) != (ATOM)0;
620 }
UINT style
Definition: winuser.h:3176
#define RegisterClassEx
Definition: winuser.h:5738
HCURSOR hCursor
Definition: winuser.h:3182
WNDPROC lpfnWndProc
Definition: winuser.h:3177
LPCSTR lpszClassName
Definition: winuser.h:3185
WORD ATOM
Definition: dimm.idl:113
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIconSm
Definition: winuser.h:3186
HINSTANCE hInstance
Definition: charmap.c:20
HINSTANCE hInstance
Definition: winuser.h:3180
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3175
HBRUSH hbrBackground
Definition: winuser.h:3183
#define CS_VREDRAW
Definition: winuser.h:653
LRESULT CALLBACK FloatToolbarWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: floatwindow.c:454
static const TCHAR szFloatWndClass[]
Definition: floatwindow.c:3
HICON hIcon
Definition: winuser.h:3181
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5713
#define IDC_ARROW
Definition: winuser.h:682
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5620

Referenced by _tWinMain().

◆ ShowHideWindow()

BOOL ShowHideWindow ( HWND  hwnd)

Definition at line 45 of file floatwindow.c.

46 {
47  if (IsWindowVisible(hwnd))
48  return ShowWindow(hwnd, SW_HIDE);
49  else
50  return ShowWindow(hwnd, SW_SHOW);
51 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:769
BOOL WINAPI IsWindowVisible(_In_ HWND)

Referenced by FloatToolbarWndProc(), MainWndCommand(), and MainWndCreateFloatWindows().

◆ UninitFloatWndImpl()

VOID UninitFloatWndImpl ( VOID  )

Definition at line 623 of file floatwindow.c.

624 {
626  hInstance);
627 }
HINSTANCE hInstance
Definition: charmap.c:20
static const TCHAR szFloatWndClass[]
Definition: floatwindow.c:3
#define UnregisterClass
Definition: winuser.h:5762

Referenced by _tWinMain().

Variable Documentation

◆ HistoryButtons

TBBUTTON HistoryButtons[]
Initial value:
= {
}
#define TBICON_DELETESM
Definition: resource.h:230
#define TBICON_BACKSM
Definition: resource.h:226
#define ID_UNDO
Definition: resource.h:34
#define BTNS_BUTTON
Definition: commctrl.h:970
#define ID_DELETE
Definition: resource.h:27
#define ID_FORWARD
Definition: resource.h:46
#define ID_BACK
Definition: resource.h:45
#define TBICON_UNDOSM
Definition: resource.h:227
#define ID_REDO
Definition: resource.h:35
#define TBICON_REDOSM
Definition: resource.h:228
#define TBICON_FORWARDSM
Definition: resource.h:229
#define TBSTATE_ENABLED
Definition: commctrl.h:946

Definition at line 35 of file floatwindow.c.

Referenced by FloatToolbarCreateHistoryGui().

◆ szFloatWndClass

const TCHAR szFloatWndClass[] = TEXT("ImageSoftFloatWndClass")
static

Definition at line 3 of file floatwindow.c.

Referenced by InitFloatWndClass(), and UninitFloatWndImpl().

◆ ToolsButtons

TBBUTTON ToolsButtons[]
Initial value:
= {
{10, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
}
#define TBICON_ERASER
Definition: resource.h:214
#define ID_PENCIL
Definition: resource.h:73
#define TBICON_PENCIL
Definition: resource.h:215
#define TBICON_MOVE
Definition: resource.h:208
#define ID_MOVESEL
Definition: resource.h:70
#define TBICON_PAINTBRUSH
Definition: resource.h:213
#define TBICON_ECLIPSE
Definition: resource.h:223
#define TBICON_RECTANGLE
Definition: resource.h:221
#define ID_TEXT
Definition: definitions.h:126
#define ID_ECLIPSE
Definition: resource.h:62
#define ID_MAGICWAND
Definition: resource.h:68
#define ID_CLONESTAMP
Definition: resource.h:60
#define ID_RECOLORING
Definition: resource.h:74
#define ID_LINE
Definition: definitions.h:127
#define TBICON_PAINTBUCKET
Definition: resource.h:219
#define BTNS_BUTTON
Definition: commctrl.h:970
#define ID_FREEFORM
Definition: resource.h:65
#define ID_PAINTBRUSH
Definition: resource.h:71
#define TBICON_FREEFORM
Definition: resource.h:224
#define TBICON_ECLIPSESEL
Definition: resource.h:209
#define TBICON_LINE
Definition: resource.h:220
#define TBICON_LASOO
Definition: resource.h:207
#define ID_LASOO
Definition: resource.h:66
#define TBICON_MOVESEL
Definition: resource.h:206
#define BTNS_SEP
Definition: commctrl.h:971
#define TBICON_ROUNDRECT
Definition: resource.h:222
#define ID_RECTSEL
Definition: definitions.h:118
#define TBICON_RECOLORING
Definition: resource.h:218
#define ID_ROUNDRECT
Definition: resource.h:77
#define TBICON_RECTSEL
Definition: resource.h:205
#define TBICON_TEXT
Definition: resource.h:212
#define TBICON_ZOOM
Definition: resource.h:210
#define ID_ZOOM
Definition: definitions.h:122
#define TBICON_MAGICWAND
Definition: resource.h:211
#define ID_ECLIPSESEL
Definition: resource.h:63
#define ID_MOVE
Definition: resource.h:69
#define TBICON_CLONESTAMP
Definition: resource.h:217
#define TBICON_COLORPICKER
Definition: resource.h:216
#define TBSTYLE_GROUP
Definition: commctrl.h:956
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define ID_ERASER
Definition: resource.h:64
#define ID_PAINTBUCKET
Definition: resource.h:72
#define TBSTYLE_CHECK
Definition: commctrl.h:955
#define ID_COLORPICKER
Definition: resource.h:61
#define ID_RECTANGLE
Definition: resource.h:75

Definition at line 9 of file floatwindow.c.

Referenced by FloatToolbarCreateHistoryGui(), and FloatToolbarCreateToolsGui().