ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

nativefont.c
Go to the documentation of this file.
00001 /*
00002  * Native Font control
00003  *
00004  * Copyright 1998, 1999 Eric Kohl
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  *
00020  * NOTES
00021  *   This is just a dummy control. An author is needed! Any volunteers?
00022  *   I will only improve this control once in a while.
00023  *     Eric <ekohl@abo.rhein-zeitung.de>
00024  *
00025  * TODO:
00026  *   - All messages.
00027  *   - All notifications.
00028  */
00029 
00030 #include <stdarg.h>
00031 
00032 #include "windef.h"
00033 #include "winbase.h"
00034 #include "wingdi.h"
00035 #include "winuser.h"
00036 #include "commctrl.h"
00037 #include "comctl32.h"
00038 #include "wine/debug.h"
00039 
00040 WINE_DEFAULT_DEBUG_CHANNEL(nativefont);
00041 
00042 typedef struct
00043 {
00044     HWND     hwndSelf;        /* my own handle */
00045 } NATIVEFONT_INFO;
00046 
00047 #define NATIVEFONT_GetInfoPtr(hwnd) ((NATIVEFONT_INFO *)GetWindowLongPtrW (hwnd, 0))
00048 
00049 static LRESULT
00050 NATIVEFONT_Create (HWND hwnd)
00051 {
00052     NATIVEFONT_INFO *infoPtr;
00053 
00054     /* allocate memory for info structure */
00055     infoPtr = Alloc (sizeof(NATIVEFONT_INFO));
00056     SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
00057 
00058     /* initialize info structure */
00059     infoPtr->hwndSelf = hwnd;
00060 
00061     return 0;
00062 }
00063 
00064 static LRESULT
00065 NATIVEFONT_Destroy (NATIVEFONT_INFO *infoPtr)
00066 {
00067     /* free control info data */
00068     SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 );
00069     Free (infoPtr);
00070 
00071     return 0;
00072 }
00073 
00074 static LRESULT WINAPI
00075 NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00076 {
00077     NATIVEFONT_INFO *infoPtr = NATIVEFONT_GetInfoPtr(hwnd);
00078 
00079     TRACE("hwnd=%p msg=%04x wparam=%08lx lparam=%08lx\n",
00080       hwnd, uMsg, wParam, lParam);
00081 
00082     if (!infoPtr && (uMsg != WM_CREATE))
00083     return DefWindowProcW( hwnd, uMsg, wParam, lParam );
00084 
00085     switch (uMsg)
00086     {
00087     case WM_CREATE:
00088         return NATIVEFONT_Create (hwnd);
00089 
00090     case WM_DESTROY:
00091         return NATIVEFONT_Destroy (infoPtr);
00092 
00093         case WM_MOVE:
00094         case WM_SIZE:
00095         case WM_SHOWWINDOW:
00096         case WM_WINDOWPOSCHANGING:
00097         case WM_WINDOWPOSCHANGED:
00098         case WM_SETFONT:
00099         case WM_GETDLGCODE:
00100         /* FIXME("message %04x seen but stubbed\n", uMsg); */
00101         return DefWindowProcW (hwnd, uMsg, wParam, lParam);
00102 
00103     default:
00104         if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
00105         ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
00106              uMsg, wParam, lParam);
00107         return DefWindowProcW (hwnd, uMsg, wParam, lParam);
00108     }
00109 }
00110 
00111 
00112 VOID
00113 NATIVEFONT_Register (void)
00114 {
00115     WNDCLASSW wndClass;
00116 
00117     ZeroMemory (&wndClass, sizeof(WNDCLASSW));
00118     wndClass.style         = CS_GLOBALCLASS;
00119     wndClass.lpfnWndProc   = NATIVEFONT_WindowProc;
00120     wndClass.cbClsExtra    = 0;
00121     wndClass.cbWndExtra    = sizeof(NATIVEFONT_INFO *);
00122     wndClass.hCursor       = LoadCursorW (0, (LPWSTR)IDC_ARROW);
00123     wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
00124     wndClass.lpszClassName = WC_NATIVEFONTCTLW;
00125 
00126     RegisterClassW (&wndClass);
00127 }
00128 
00129 
00130 VOID
00131 NATIVEFONT_Unregister (void)
00132 {
00133     UnregisterClassW (WC_NATIVEFONTCTLW, NULL);
00134 }

Generated on Fri May 25 2012 04:20:58 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.