[very basic window creation on win32
raph.levien@gmail.com**20051215075507] {
hunk ./Makefile 16
+  X3_LIBS = -lgdi32
hunk ./test.c 60
+    x3_window_show(mainwin);
hunk ./x3.h 102
-    x3carbonnone,
-    x3carbonhiview,
-    x3carbonwindow,
-    x3carbonmenu,
-    x3carbonmenuitem,
-} x3carbonvar;
+    x3winnone,
+    x3winhwnd,
+} x3winvar;
hunk ./x3.h 116
-    x3carbonvar var; // should this be in the type?
+    x3winvar var; // should this be in the type?
hunk ./x3win32.c 14
-    w->var = x3carbonnone;
+    w->var = x3winnone;
hunk ./x3win32.c 20
+LRESULT CALLBACK x3WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
+{
+    return DefWindowProc(hwnd, iMsg, wParam, lParam);
+}
+
hunk ./x3win32.c 30
+    x3widget *result = (x3widget *)malloc(sizeof(x3widget));
+    WNDCLASSEX wndclass;
+
+    wndclass.cbSize = sizeof(wndclass);
+    wndclass.style = CS_HREDRAW | CS_VREDRAW;
+    wndclass.lpfnWndProc = x3WndProc;
+    wndclass.cbClsExtra = 0;
+    wndclass.cbWndExtra = 0;
+    wndclass.hInstance = theInstance;
+    wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
+    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+    wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
+    wndclass.lpszMenuName = NULL;
+    wndclass.lpszClassName = "x3win";
+    wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
hunk ./x3win32.c 46
-    hwnd = CreateWindowEx(0, NULL, "My window",
+    RegisterClassEx(&wndclass);
+
+    hwnd = CreateWindowEx(0, "x3win", "My window",
hunk ./x3win32.c 52
-    ShowWindow(hwnd, SW_SHOW);
-    return NULL;
+    x3widget_init(result, NULL);
+    result->var = x3winhwnd;
+    result->u.hwnd = hwnd;
+    ShowWindow(hwnd, SW_SHOWNORMAL);
+    return result;
hunk ./x3win32.c 59
+
+void x3_window_show(x3widget *w)
+{
+    ShowWindow(w->u.hwnd, SW_SHOW);
+}
}
