Skip to content

Commit 354e5fe

Browse files
committed
FIX: cleanup of stdio traces related to view
1 parent 68bdaa7 commit 354e5fe

File tree

3 files changed

+17
-44
lines changed

3 files changed

+17
-44
lines changed

src/os/win32/host-compositor.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ static REBXYF Zero_Pair = {0, 0};
111111
***********************************************************************/
112112
{
113113
//do cleanup
114-
puts("OS_Destroy_Compositor");
115114
ReleaseDC(GOB_HWIN(ctx->wind_gob), ctx->wind_DC);
116115
DeleteDC(ctx->back_DC);
117116
DeleteObject(ctx->back_buffer);
@@ -363,7 +362,7 @@ static REBXYF Zero_Pair = {0, 0};
363362
REBGOB* parent_gob = gob;
364363
RECT gob_clip;
365364

366-
//RL_Print("COMPOSE %d %d\n", GetDeviceCaps(ctx->back_DC, SHADEBLENDCAPS), GetDeviceCaps(ctx->wind_DC, SHADEBLENDCAPS));
365+
//RL_Print("OS_Compose_Gob only: %d\n", only);
367366

368367
abs_x = 0;
369368
abs_y = 0;
@@ -411,7 +410,7 @@ static REBXYF Zero_Pair = {0, 0};
411410
intersection_result = ExtSelectClipRgn(ctx->back_DC, ctx->win_clip, RGN_AND);
412411

413412
GetClipBox(ctx->back_DC, &gob_clip);
414-
RL_Print("old+new clip: %dx%d %dx%d\n", gob_clip.left, gob_clip.top, gob_clip.right, gob_clip.bottom);
413+
//RL_Print("old+new clip: %dx%d %dx%d\n", gob_clip.left, gob_clip.top, gob_clip.right, gob_clip.bottom);
415414

416415
if (intersection_result != NULLREGION)
417416
//redraw gobs
@@ -495,7 +494,7 @@ static REBXYF Zero_Pair = {0, 0};
495494
rect.right = clip_siz.x + clip_oft.x;
496495
rect.bottom = clip_siz.y + clip_oft.y;
497496

498-
//RL_Print("rect: %dx%d %dx%d", rect.left, rect.top, rect.right, rect.bottom);
497+
//RL_Print("OS_Blit_Gob_Color: %dx%d %dx%d\n", rect.left, rect.top, rect.right, rect.bottom);
499498

500499
FillRect(ctx->back_DC, &rect, CreateSolidBrush(rgb));
501500
}

src/os/win32/host-event.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,11 @@ static REBINT Check_Modifiers(REBINT flags)
467467
break;
468468

469469
case WM_GETMINMAXINFO:
470-
printf("WM_GETMINMAXINFO\n");
470+
//printf("WM_GETMINMAXINFO\n");
471471
break;
472472

473473
case WM_SETFOCUS:
474-
puts("WM_SETFOCUS");
474+
//puts("WM_SETFOCUS");
475475
Focused_Window = hwnd;
476476
break;
477477

@@ -485,7 +485,8 @@ static REBINT Check_Modifiers(REBINT flags)
485485
PostQuitMessage(0);
486486
return 0;
487487
case WM_NCDESTROY:
488-
puts("WM_NCDESTROY");
488+
//TODO: notify native widgets?
489+
//puts("WM_NCDESTROY");
489490
break;
490491

491492
}

src/os/win32/host-window.c

+10-37
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include <vssym32.h> // --//--
5959
#include <math.h>
6060

61-
#include <stdio.h> // used for debuging traces
61+
//#include <stdio.h> // used for debuging traces
6262

6363
#undef IS_ERROR // Windows is using this macro name too, we don't need their version
6464

@@ -282,7 +282,7 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
282282
ZeroMemory(&wcex, sizeof(wcex));
283283

284284
if(!GetClassInfoEx(hInstance, old_class, &wcex)) {
285-
puts("Failed to get old class info!");
285+
RL_Print("Failed to get old class info!\n");
286286
}
287287
wcex.cbSize = sizeof(WNDCLASSEX);
288288
wcex.lpszClassName = new_class;
@@ -302,7 +302,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
302302
**
303303
***********************************************************************/
304304
{
305-
puts("Register_Window");
306305
WNDCLASSEX wc;
307306

308307
wc.cbSize = sizeof(wc);
@@ -327,10 +326,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
327326
LR_DEFAULTCOLOR
328327
);
329328

330-
// If not already registered:
331-
//if (!GetClassInfo(App_Instance, Class_Name_Window, &wclass))
332-
// RegisterClass(&wclass);
333-
334329
if (!RegisterClassEx(&wc)) Host_Crash("Cannot register window");
335330

336331
Make_Subclass(Class_Name_Button, TEXT("BUTTON"), NULL, TRUE);
@@ -456,7 +451,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
456451
NULL, App_Instance, NULL
457452
);
458453
if (!window) {
459-
printf("error: %d %d %d %d %d\n",x,y,w,h, GetLastError());
460454
Host_Crash("CreateWindow failed");
461455
}
462456

@@ -481,7 +475,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
481475
}
482476
if ( res >= 0 ) {
483477
Default_Font = CreateFontIndirect(&font);
484-
printf("font: '%ls' %08Xh\n", font.lfFaceName, Default_Font);
485478
}
486479

487480
if (hTheme) CloseThemeData(hTheme);
@@ -512,27 +505,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
512505
return window;
513506
}
514507

515-
/* Removed from above code -- is any of this really needed? -CS
516-
517-
// Set rectangle coordinates:
518-
rect.left = GOB_X(gob);
519-
rect.right = rect.left + GOB_W(gob);
520-
rect.top = GOB_Y(gob);
521-
rect.bottom = rect.top + GOB_H(gob);
522-
AdjustWindowRect(&rect, options, FALSE);
523-
524-
// Create window (use parent if specified):
525-
GOB_WIN(gob) = CreateWindow(Class_Name_Window, title, options,
526-
rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
527-
(wparent ? GOB_WIN(wparent) : NULL), NULL, App_Instance, NULL);
528-
529-
// Drain startup messages:
530-
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
531-
TranslateMessage(&msg);
532-
DispatchMessage(&msg);
533-
}
534-
*/
535-
536508

537509
/***********************************************************************
538510
**
@@ -655,13 +627,15 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
655627
wingob = GOB_PARENT(wingob);
656628

657629
//check if it is really open
658-
if (!IS_WINDOW(wingob) || !GET_GOB_STATE(wingob, GOBS_OPEN)) return;
630+
if (!IS_WINDOW(wingob) || !GET_GOB_STATE(wingob, GOBS_OPEN)) {
631+
return;
632+
}
659633
}
660-
661-
//Reb_Print("draw: %d %8x", nnn++, gob);
634+
662635
//render and blit the GOB
663636
compositor = GOB_COMPOSITOR(wingob);
664637
OS_Compose_Gob(compositor, wingob, gob, FALSE);
638+
OS_Blit_Window(compositor);
665639
}
666640

667641

@@ -762,7 +736,6 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
762736
**
763737
***********************************************************************/
764738
{
765-
puts("OS_Init_Gob_Widget");
766739
HWND hWnd;
767740
REBCHR *class;
768741
REBCHR *text = NULL;
@@ -847,7 +820,7 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
847820
style |= BS_GROUPBOX;
848821
break;
849822
default:
850-
puts("unknown widget name");
823+
//RL_Print("unknown widget name");
851824
return NULL;
852825
}
853826

@@ -866,7 +839,7 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
866839
SendMessage(hWnd, WM_SETFONT, (WPARAM)Default_Font, 0);
867840
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)gob);
868841

869-
printf("======== NEW widget: %08Xh for gob: %08Xh\n", hWnd, gob);
842+
//printf("======== NEW widget: %08Xh for gob: %08Xh\n", hWnd, gob);
870843

871844
switch (VAL_INT64(type)) {
872845
case W_WINDOW_BUTTON:
@@ -1377,7 +1350,7 @@ static REBCNT Get_Widget_Text(HWND widget, REBVAL *text);
13771350
| ICC_BAR_CLASSES
13781351
| ICC_DATE_CLASSES;
13791352
if (!InitCommonControlsEx(&InitCtrlEx)) {
1380-
printf("Could not initialize common controls! (%u)\n", GetLastError());
1353+
RL_Print("Could not initialize common controls! (%u)\n", GetLastError());
13811354
}
13821355
}
13831356

0 commit comments

Comments
 (0)