306_uppsrc.diff
uppsrc/Core/core.upt 2012-07-01 08:55:57 +0400 | ||
---|---|---|
16 | 16 |
|
17 | 17 |
#endif |
18 | 18 |
@@<:PACKAGE:>.cpp |
19 |
#include <:?header:>"<:PACKAGE:>.h"<:/:><Core/Core.h><:.:>
|
|
19 |
#include <:?header:>"<:PACKAGE:>.h"<:/:><Core/Core.h> |
|
20 | 20 |
|
21 |
<:?!header:>using namespace Upp;<:.:>
|
|
21 |
using namespace Upp;<:.:> |
|
22 | 22 |
|
23 | 23 |
CONSOLE_APP_MAIN |
24 |
{ |
|
25 |
<:?cmdline:>const Vector<String>& cmdline = CommandLine();
|
|
24 |
{<:?cmdline:>
|
|
25 |
const Vector<String>& cmdline = CommandLine(); |
|
26 | 26 |
for(int i = 0; i < cmdline.GetCount(); i++) { |
27 | 27 |
}<:.:> |
28 | 28 |
} |
29 | 29 |
@@<:PACKAGE:>.upp |
30 | 30 |
uses Core; |
31 | 31 |
|
32 |
file <:?header:>"<:PACKAGE:>.h",<:.:> |
|
33 |
"<:PACKAGE:>.cpp"; |
|
32 |
file<:?header:> |
|
33 |
<:PACKAGE:>.h,<:.:> |
|
34 |
<:PACKAGE:>.cpp; |
|
34 | 35 |
|
35 | 36 |
mainconfig |
36 | 37 |
"" = "<:?mt:>MT<:.:><:?mt && sse2:> <:.:><:?sse2:>SSE2<:.:>"; |
uppsrc/Core/sub.upt 2012-07-01 09:29:29 +0400 | ||
---|---|---|
6 | 6 |
|
7 | 7 |
#endif |
8 | 8 |
@@<:PACKAGE:>.upp |
9 |
file "<:PACKAGE:>.h"; |
|
9 |
file |
|
10 |
<:PACKAGE:>.h; |
uppsrc/CtrlLib/Complex.upt 2012-07-01 08:56:16 +0400 | ||
---|---|---|
13 | 13 |
|
14 | 14 |
#include <CtrlLib/CtrlLib.h> |
15 | 15 |
|
16 |
using namespace Upp; |
|
16 |
using namespace Upp;<:?lay:>
|
|
17 | 17 |
|
18 |
<:?lay:>#define LAYOUTFILE <<:PACKAGE:>/<:PACKAGE:>.lay>
|
|
19 |
#include <CtrlCore/lay.h><:.:> |
|
18 |
#define LAYOUTFILE <<:PACKAGE:>/<:PACKAGE:>.lay> |
|
19 |
#include <CtrlCore/lay.h><:.:><:?iml:>
|
|
20 | 20 |
|
21 |
<:?iml:>#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml>
|
|
21 |
#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml> |
|
22 | 22 |
#include <Draw/iml_header.h><:.:> |
23 | 23 |
|
24 | 24 |
class <:classname:> : public <:lay > 1 ? "With" + classname + "Layout<TopWindow>" : "TopWindow":> { |
... | ... | |
29 | 29 |
|
30 | 30 |
#endif |
31 | 31 |
@@main.cpp |
32 |
#include "<:PACKAGE:>.h" |
|
32 |
#include "<:PACKAGE:>.h"<:?iml:>
|
|
33 | 33 |
|
34 |
<:?iml:>#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml>
|
|
34 |
#define IMAGEFILE <<:PACKAGE:>/<:PACKAGE:>.iml> |
|
35 | 35 |
#include <Draw/iml_source.h><:.:> |
36 | 36 |
|
37 | 37 |
<:classname:>::<:classname:>() |
38 |
{ |
|
39 |
<:?lay > 1:>CtrlLayout<:(lay == 3 ? "OKCancel" : ""):>(*this, "Window title");<:.:>
|
|
38 |
{<:?lay > 1:>
|
|
39 |
CtrlLayout<:(lay == 3 ? "OKCancel" : ""):>(*this, "Window title");<:.:> |
|
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
GUI_APP_MAIN |
... | ... | |
46 | 46 |
@@<:PACKAGE:>.lay |
47 | 47 |
??lay |
48 | 48 |
|
49 |
LAYOUT(<:classname:>Layout, 200, 100) |
|
50 |
<:?lay == 3:>ITEM(Button, ok, SetLabel("OK").RightPosZ(90, 80).BottomPosZ(4, 22))
|
|
49 |
LAYOUT(<:classname:>Layout, 200, 100)<:?lay == 3:>
|
|
50 |
ITEM(Button, ok, SetLabel("OK").RightPosZ(90, 80).BottomPosZ(4, 22)) |
|
51 | 51 |
ITEM(Button, cancel, SetLabel("Cancel").RightPosZ(4, 80).BottomPosZ(4, 22))<:.:> |
52 | 52 |
END_LAYOUT |
53 | 53 |
@@<:PACKAGE:>.iml |
... | ... | |
58 | 58 |
CtrlLib; |
59 | 59 |
|
60 | 60 |
file |
61 |
"<:PACKAGE:>.h" |
|
62 |
, main.cpp |
|
63 |
<:?lay:>, "<:PACKAGE:>.lay"<:.:> |
|
64 |
<:?iml:>, "<:PACKAGE:>.iml"<:.:> |
|
65 |
; |
|
61 |
<:PACKAGE:>.h, |
|
62 |
main.cpp<:?lay:>, |
|
63 |
<:PACKAGE:>.lay<:.:><:?iml:>, |
|
64 |
<:PACKAGE:>.iml<:.:>; |
|
66 | 65 |
|
67 | 66 |
mainconfig |
68 | 67 |
"" = "GUI<:?mt:> MT<:.:><:?sse2:> SSE2<:.:>"; |
uppsrc/CtrlLib/Normal.upt 2012-07-01 08:56:50 +0400 | ||
---|---|---|
15 | 15 |
|
16 | 16 |
#endif |
17 | 17 |
@@main.cpp |
18 |
#include <:?header:>"<:PACKAGE:>.h"<:/:><CtrlLib/CtrlLib.h><:.:> |
|
18 |
#include <:?header:>"<:PACKAGE:>.h"<:/:><CtrlLib/CtrlLib.h> |
|
19 |
|
|
20 |
using namespace Upp;<:.:> |
|
19 | 21 |
|
20 | 22 |
GUI_APP_MAIN |
21 | 23 |
{ |
... | ... | |
24 | 26 |
uses |
25 | 27 |
CtrlLib; |
26 | 28 |
|
27 |
file |
|
28 |
<:?header:>"<:PACKAGE:>.h",<:.:>
|
|
29 |
"main.cpp";
|
|
29 |
file<:?header:>
|
|
30 |
<:PACKAGE:>.h,<:.:>
|
|
31 |
main.cpp;
|
|
30 | 32 |
|
31 | 33 |
mainconfig |
32 | 34 |
"" = "GUI<:?mt:> MT<:.:><:?sse2:> SSE2<:.:>"; |
uppsrc/upt/SDLCore.upt 2012-07-01 09:04:37 +0400 | ||
---|---|---|
21 | 21 |
@@<:PACKAGE:>.cpp |
22 | 22 |
<:?header:>#include "<:PACKAGE:>.h" |
23 | 23 |
<:/:>#include <Core/Core.h> |
24 |
#include <plugin/SDL/SDL.h><:.:> |
|
25 |
<:?video:> |
|
24 |
#include <plugin/SDL/SDL.h> |
|
25 |
|
|
26 |
using namespace Upp; |
|
27 |
<:.:><:?video:> |
|
26 | 28 |
SDL_Surface * OpenScreen(const int width, const int height, const int bpp, const int flags) |
27 | 29 |
{ |
28 | 30 |
SDL_Surface * screen = SDL_SetVideoMode(width, height, bpp, flags); |
... | ... | |
89 | 91 |
uses |
90 | 92 |
Core; |
91 | 93 |
|
92 |
file <:?header:>"<:PACKAGE:>.h",<:.:> |
|
93 |
"<:PACKAGE:>.cpp"; |
|
94 |
|
|
95 | 94 |
library(MSC) "SDL SDLmain"; |
96 | 95 |
library(GCC WIN32) "SDL.dll SDLmain"; |
97 | 96 |
|
97 |
file<:?header:> |
|
98 |
<:PACKAGE:>.h,<:.:> |
|
99 |
<:PACKAGE:>.cpp; |
|
100 |
|
|
98 | 101 |
mainconfig |
99 | 102 |
"" = "<:?sse2:>SSE2<:.:>"; |
uppsrc/upt/SDLPure.upt 2012-07-01 09:04:55 +0400 | ||
---|---|---|
82 | 82 |
return 0; |
83 | 83 |
} |
84 | 84 |
@@<:PACKAGE:>.upp |
85 |
file <:?header:>"<:PACKAGE:>.h",<:.:> |
|
86 |
"<:PACKAGE:>.cpp"; |
|
87 |
|
|
88 | 85 |
library(MSC) "SDL SDLmain"; |
89 | 86 |
library(GCC WIN32) "SDL.dll SDLmain"; |
90 | 87 |
|
88 |
file<:?header:> |
|
89 |
<:PACKAGE:>.h,<:.:> |
|
90 |
<:PACKAGE:>.cpp; |
|
91 |
|
|
91 | 92 |
mainconfig |
92 | 93 |
"" = "<:?sse2:>SSE2<:.:>"; |
uppsrc/upt/Win32.upt 2012-07-01 09:00:42 +0400 | ||
---|---|---|
5 | 5 |
option "Hello World" hello; |
6 | 6 |
option "Use SSE2" sse2 = 1; |
7 | 7 |
|
8 |
@@resource.h |
|
9 |
<:?icon:>#define IDI_BIG 100
|
|
10 |
#define IDI_SMALL 101 |
|
11 |
<:.:> |
|
12 |
<:?menu:>#define IDD_ABOUT 102
|
|
8 |
@@resource.h<:?icon:>
|
|
9 |
#define IDI_BIG 100 |
|
10 |
#define IDI_SMALL 101<:.:><:?menu:>
|
|
11 |
|
|
12 |
#define IDD_ABOUT 102 |
|
13 | 13 |
#define IDM_ABOUT 103 |
14 | 14 |
#define IDM_EXIT 104 |
15 | 15 |
#define IDC_WIN32APP 105 |
... | ... | |
17 | 17 |
#define IDC_STATIC -1<:.:> |
18 | 18 |
@@<:PACKAGE:>.rc |
19 | 19 |
#include "resource.h" |
20 |
#include <windows.h> |
|
20 |
#include <windows.h><:?icon:>
|
|
21 | 21 |
|
22 |
<:?icon:> |
|
23 | 22 |
// Put your program icon into the package directory |
24 | 23 |
IDI_SMALL ICON DISCARDABLE "icon.ico" |
25 |
IDI_BIG ICON DISCARDABLE "icon.ico" |
|
26 |
<:.:> |
|
27 |
<:?menu:> |
|
24 |
IDI_BIG ICON DISCARDABLE "icon.ico"<:.:><:?menu:> |
|
25 |
|
|
28 | 26 |
IDC_WIN32APP MENU DISCARDABLE |
29 | 27 |
BEGIN |
30 | 28 |
POPUP "&File" |
... | ... | |
65 | 63 |
return TRUE; |
66 | 64 |
|
67 | 65 |
case WM_COMMAND: |
68 |
if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
|
66 |
if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) |
|
69 | 67 |
{ |
70 | 68 |
EndDialog(hDlg, LOWORD(wParam)); |
71 | 69 |
return TRUE; |
... | ... | |
79 | 77 |
{<:?menu:> |
80 | 78 |
int wmId, wmEvent;<:.:> |
81 | 79 |
PAINTSTRUCT ps; |
82 |
HDC hdc; |
|
83 |
<:?hello:> |
|
80 |
HDC hdc;<:?hello:>
|
|
81 |
|
|
84 | 82 |
const TCHAR szHello[] = "Hello World!";<:.:> |
85 | 83 |
|
86 |
switch (message)
|
|
84 |
switch (message) |
|
87 | 85 |
{<:?menu:> |
88 | 86 |
case WM_COMMAND: |
89 |
|
|
90 |
wmId = LOWORD(wParam); |
|
91 |
wmEvent = HIWORD(wParam); |
|
87 |
wmId = LOWORD(wParam); |
|
88 |
wmEvent = HIWORD(wParam); |
|
92 | 89 |
|
93 | 90 |
switch(wmId) |
94 | 91 |
{ |
95 | 92 |
case IDM_ABOUT: |
96 | 93 |
DialogBox(hInst, (LPCTSTR) IDD_ABOUT, hWnd, (DLGPROC) About); |
97 | 94 |
break; |
98 |
|
|
95 |
|
|
99 | 96 |
case IDM_EXIT: |
100 | 97 |
DestroyWindow(hWnd); |
101 | 98 |
break; |
102 |
|
|
99 |
|
|
103 | 100 |
default: |
104 | 101 |
return DefWindowProc(hWnd, message, wParam, lParam); |
105 | 102 |
} |
106 | 103 |
break; |
107 |
<:.:>
|
|
104 |
<:.:> |
|
108 | 105 |
case WM_PAINT: |
109 | 106 |
hdc = BeginPaint(hWnd, &ps); |
110 |
|
|
107 |
|
|
111 | 108 |
/* Put your drawing code here */ |
112 |
<:?hello:> |
|
113 |
RECT rt; |
|
109 |
<:?hello:>RECT rt; |
|
114 | 110 |
GetClientRect(hWnd, &rt); |
115 |
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER | DT_VCENTER | DT_SINGLELINE);<:.:> |
|
111 |
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER | DT_VCENTER | DT_SINGLELINE); |
|
112 |
<:.:> |
|
116 | 113 |
EndPaint(hWnd, &ps); |
117 | 114 |
break; |
118 |
|
|
115 |
|
|
119 | 116 |
case WM_DESTROY: |
120 | 117 |
PostQuitMessage(0); |
121 | 118 |
break; |
122 |
|
|
119 |
|
|
123 | 120 |
default: |
124 | 121 |
return DefWindowProc(hWnd, message, wParam, lParam); |
125 | 122 |
} |
... | ... | |
131 | 128 |
LPSTR lpCmdLine, |
132 | 129 |
int nCmdShow) |
133 | 130 |
{ |
134 |
|
|
135 | 131 |
WNDCLASSEX wcex; |
136 | 132 |
|
137 | 133 |
wcex.cbSize = sizeof(WNDCLASSEX); |
... | ... | |
150 | 146 |
wcex.lpszClassName = "UPPW32APP"; |
151 | 147 |
|
152 | 148 |
if(RegisterClassEx(&wcex) == 0) |
153 |
return FALSE; |
|
154 |
<:?menu:> |
|
155 |
hInst = hInstance; |
|
156 |
<:.:> |
|
149 |
return FALSE;<:?menu:>
|
|
150 |
|
|
151 |
hInst = hInstance;<:.:>
|
|
152 |
|
|
157 | 153 |
HWND hWnd = CreateWindow(wcex.lpszClassName, "Ultimate application", WS_OVERLAPPEDWINDOW, |
158 | 154 |
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, |
159 | 155 |
NULL, NULL, hInstance, NULL); |
160 | 156 |
if(!hWnd) |
161 | 157 |
return FALSE; |
162 |
|
|
158 |
|
|
163 | 159 |
ShowWindow(hWnd, nCmdShow); |
164 |
UpdateWindow(hWnd); |
|
165 |
<:?menu:> |
|
160 |
UpdateWindow(hWnd);<:?menu:>
|
|
161 |
|
|
166 | 162 |
HACCEL hAccelTable = LoadAccelerators(hInstance, (LPCTSTR) IDC_WIN32APP); |
167 | 163 |
<:.:> |
168 | 164 |
MSG msg; |
169 | 165 |
while(GetMessage(&msg, NULL, 0, 0)) |
170 | 166 |
{<:?menu:> |
171 |
if(!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
|
167 |
if(!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) |
|
172 | 168 |
{ |
173 | 169 |
TranslateMessage(&msg); |
174 | 170 |
DispatchMessage(&msg); |
... | ... | |
183 | 179 |
@@<:PACKAGE:>.upp |
184 | 180 |
library(WIN32) "kernel32 user32 advapi32 shell32 winmm"; |
185 | 181 |
|
186 |
file resource.h, |
|
187 |
<:PACKAGE:>.rc, |
|
188 |
<:PACKAGE:>.cpp; |
|
182 |
file |
|
183 |
resource.h, |
|
184 |
<:PACKAGE:>.rc, |
|
185 |
<:PACKAGE:>.cpp; |
|
189 | 186 |
|
190 | 187 |
mainconfig |
191 | 188 |
"" = "GUI<:?sse2:> SSE2<:.:>"; |