freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master be476a0: [graph/win32] Failed experiments.


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master be476a0: [graph/win32] Failed experiments.
Date: Sun, 10 Jan 2021 14:15:57 -0500 (EST)

branch: master
commit be476a0f5ddddf563b59d89e5995a59bcb23c305
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [graph/win32] Failed experiments.
---
 graph/win32/grwin32.c | 48 +++++++++++++++++++++++++++++++++++-------------
 1 file changed, 35 insertions(+), 13 deletions(-)

diff --git a/graph/win32/grwin32.c b/graph/win32/grwin32.c
index 0fc8052..2c0035d 100644
--- a/graph/win32/grwin32.c
+++ b/graph/win32/grwin32.c
@@ -23,30 +23,25 @@
 #include <stdlib.h>
 #include <string.h>
 
-/* define to activate OLPC swizzle */
-#define xxSWIZZLE
-
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #include "grobjs.h"
 #include "grdevice.h"
+
+/* define to activate OLPC swizzle */
+#define xxSWIZZLE
+
 #ifdef SWIZZLE
 #include "grswizzle.h"
 #endif
 
 /* logging facility */
-#include <stdarg.h>
+#define  xxDEBUG
 
-#define  DEBUGxxx
-
-#ifdef DEBUG
-#define LOG(x)  LogMessage##x
-#else
-#define LOG(x)  /* rien */
-#endif
+#ifndef DEBUG
+#include <stdarg.h>
 
-#ifdef DEBUG
   static void  LogMessage( const char*  fmt, ... )
   {
     va_list  ap;
@@ -55,8 +50,11 @@
     vfprintf( stderr, fmt, ap );
     va_end( ap );
   }
+
+#define LOG(x)  LogMessage##x
+#else
+#define LOG(x)  /* rien */
 #endif
-/*-------------------*/
 
 /*  Custom messages. */
 #define WM_RESIZE  WM_USER+517
@@ -634,6 +632,30 @@ LRESULT CALLBACK Message_Process( HWND handle, UINT mess,
         PostMessage( handle, WM_RESIZE, wParam, lParam );
       break;
 
+#ifdef DEBUG
+    case WM_SIZING:
+      {
+        PRECT  r = (PRECT)lParam;
+        RECT   WndRect;
+        int    x, y;
+
+        GetClientRect( handle, &WndRect );
+
+        y = wParam >= 6 ? wParam -= 6, 'B' :
+            wParam >= 3 ? wParam -= 3, 'T' : ' ';
+        x = wParam == 2 ? 'R' :
+            wParam == 1 ? 'L' : ' ';
+
+        LOG(( "WM_SIZING %c%c : ( %d %d %d %d )   "
+              "ClientArea : ( %d %d )\n",
+              y, x, r->left, r->top, r->right, r->bottom,
+              WndRect.right, WndRect.bottom ));
+
+        /* XXX: We cannot simply interrupt here and resize the image. */
+      }
+      break;
+#endif
+
     case WM_EXITSIZEMOVE:
       {
         RECT  WndRect;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]