作図ソフト dia の改良版
リビジョン | 87378ca7c3a3340707be2b3923cf0d914218d160 (tree) |
---|---|
日時 | 2006-02-12 18:08:54 |
作者 | Hans Breuer <hans@breu...> |
コミッター | Hans Breuer |
build three components dia.exe (console application), diaw.exe (windows
2006-02-12 Hans Breuer <hans@breuer.org>
* app/makefile.msc : build three components dia.exe (console
application), diaw.exe (windows application) and dia-app.dll
containing almost all of Dia's application shared between
the two executables
* app/main.c app/winmain.c app/app_procs.c app/dia.def : some
refactoring to accomplish the new dependency layout
* objects/makefile.msc plug-ins/python/makefile.msc : need to
link dia-app.lib now - if at all depending on app/*
@@ -1,3 +1,14 @@ | ||
1 | +2006-02-12 Hans Breuer <hans@breuer.org> | |
2 | + | |
3 | + * app/makefile.msc : build three components dia.exe (console | |
4 | + application), diaw.exe (windows application) and dia-app.dll | |
5 | + containing almost all of Dia's application shared between | |
6 | + the two executables | |
7 | + * app/main.c app/winmain.c app/app_procs.c app/dia.def : some | |
8 | + refactoring to accomplish the new dependency layout | |
9 | + * objects/makefile.msc plug-ins/python/makefile.msc : need to | |
10 | + link dia-app.lib now - if at all depending on app/* | |
11 | + | |
1 | 12 | 2006-02-11 Hans Breuer <hans@breuer.org> |
2 | 13 | |
3 | 14 | * makefile.msc : nmake -f makefile.msc just compiles now |
@@ -835,11 +835,6 @@ app_init (int argc, char **argv) | ||
835 | 835 | |
836 | 836 | if (!dia_is_interactive) |
837 | 837 | log_to_stderr = TRUE; |
838 | - else { | |
839 | -#ifdef G_OS_WIN32 | |
840 | - dia_redirect_console (); | |
841 | -#endif | |
842 | - } | |
843 | 838 | |
844 | 839 | if (log_to_stderr) |
845 | 840 | set_message_func(stderr_message_internal); |
@@ -1308,3 +1303,8 @@ parse_size(gchar *size, long *width, long *height) | ||
1308 | 1303 | *height = 0; |
1309 | 1304 | } |
1310 | 1305 | } |
1306 | + | |
1307 | +int app_is_embedded(void) | |
1308 | +{ | |
1309 | + return 0; | |
1310 | +} |
@@ -36,3 +36,11 @@ EXPORTS | ||
36 | 36 | diagram_update_extents |
37 | 37 | diagram_update_connections_object |
38 | 38 | dia_open_diagrams |
39 | + | |
40 | + ; just for the applications | |
41 | + app_is_embedded | |
42 | + app_init | |
43 | + app_is_interactive | |
44 | + app_splash_done | |
45 | + toolbox_show | |
46 | + |
@@ -26,11 +26,6 @@ | ||
26 | 26 | #include "load_save.h" |
27 | 27 | #include "interface.h" |
28 | 28 | |
29 | -int app_is_embedded(void) | |
30 | -{ | |
31 | - return 0; | |
32 | -} | |
33 | - | |
34 | 29 | int main(int argc, char *argv[]) |
35 | 30 | { |
36 | 31 | app_init(argc, argv); |
@@ -61,7 +61,6 @@ OBJECTS = \ | ||
61 | 61 | linewidth_area.obj \ |
62 | 62 | load_save.obj \ |
63 | 63 | magnify.obj \ |
64 | - main.obj \ | |
65 | 64 | menus.obj \ |
66 | 65 | modify_tool.obj \ |
67 | 66 | navigation.obj \ |
@@ -85,8 +84,7 @@ OBJECTS = \ | ||
85 | 84 | textedit.obj \ |
86 | 85 | tool.obj \ |
87 | 86 | undo.obj \ |
88 | - win32print.obj \ | |
89 | - winmain.obj | |
87 | + win32print.obj | |
90 | 88 | |
91 | 89 | ICON_PNG_PAIRS = \ |
92 | 90 | dia_connectable_icon pixmaps\connectable.png \ |
@@ -117,9 +115,8 @@ dia-app-icons.h : makefile.msc pixmaps\*.png | ||
117 | 115 | CC = cl -G5 -GF $(OPTIMIZE) $(CRUNTIME) -W3 -nologo |
118 | 116 | |
119 | 117 | # No general LDFLAGS needed |
120 | -# Use /subsystem:console to enable console output | |
121 | -#LDFLAGS = /link $(LINKDEBUG) /subsystem:console /machine:ix86 | |
122 | -LDFLAGS = /link $(LINKDEBUG) /subsystem:windows /machine:ix86 | |
118 | +# /subsystem:console and /subsystem:windows have their own exe | |
119 | +LDFLAGS = /link $(LINKDEBUG) /machine:ix86 | |
123 | 120 | INSTALL = copy |
124 | 121 | |
125 | 122 | CFLAGS = -I. -I$(PRJ_TOP) -DHAVE_CONFIG_H |
@@ -128,7 +125,9 @@ CFLAGS = -I. -I$(PRJ_TOP) -DHAVE_CONFIG_H | ||
128 | 125 | all : \ |
129 | 126 | $(PRJ_TOP)\config.h \ |
130 | 127 | dia-app-icons.h \ |
131 | - $(PACKAGE).exe | |
128 | + $(PACKAGE)-app.dll \ | |
129 | + $(PACKAGE).exe \ | |
130 | + $(PACKAGE)w.exe | |
132 | 131 | |
133 | 132 | $(PACKAGE).res : $(PACKAGE).rc $(PACKAGE).ico |
134 | 133 | rc -r -fo $(PACKAGE).res $(PACKAGE).rc |
@@ -138,13 +137,18 @@ RESOURCE = $(PACKAGE).res | ||
138 | 137 | $(PACKAGE).lib : $(OBJECTS) |
139 | 138 | lib /out:$(PACKAGE).lib $(OBJECTS) |
140 | 139 | |
141 | -$(PACKAGE).dll : $(OBJECTS) $(PACKAGE).def | |
142 | - $(CC) $(CFLAGS) -LD -Fe$(PACKAGE).dll $(OBJECTS) $(PKG_LINK) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:$(PACKAGE).def | |
143 | - | |
144 | -$(PACKAGE).exe : $(OBJECTS) $(PACKAGE).def $(PACKAGE).res | |
145 | - $(CC) $(CFLAGS) -Fe$(PACKAGE).exe $(PACKAGE).res $(OBJECTS) $(PKG_LINK) \ | |
140 | +$(PACKAGE)-app.dll : $(OBJECTS) $(PACKAGE).def | |
141 | + $(CC) $(CFLAGS) -LD -Fe$(PACKAGE)-app.dll $(OBJECTS) $(PKG_LINK) \ | |
146 | 142 | gdi32.lib comdlg32.lib user32.lib advapi32.lib shell32.lib wsock32.lib winspool.lib $(LDFLAGS) /def:$(PACKAGE).def |
147 | 143 | |
144 | +$(PACKAGE).exe : $(OBJECTS) $(PACKAGE).def $(PACKAGE).res main.obj $(PACKAGE)-app.dll | |
145 | + $(CC) $(CFLAGS) -Fe$(PACKAGE).exe $(PACKAGE).res main.obj dia-app.lib $(PKG_LINK) \ | |
146 | + user32.lib advapi32.lib $(LDFLAGS) /subsystem:console | |
147 | + | |
148 | +$(PACKAGE)w.exe : $(OBJECTS) $(PACKAGE).def $(PACKAGE).res winmain.obj $(PACKAGE)-app.dll | |
149 | + $(CC) $(CFLAGS) -Fe$(PACKAGE)w.exe $(PACKAGE).res winmain.obj dia-app.lib $(PKG_LINK) \ | |
150 | + gdi32.lib comdlg32.lib user32.lib advapi32.lib $(LDFLAGS) /subsystem:windows | |
151 | + | |
148 | 152 | $(PRJ_TOP)/config.h: $(PRJ_TOP)/config.h.win32 |
149 | 153 | copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h |
150 | 154 |
@@ -5,10 +5,13 @@ | ||
5 | 5 | #include <gtk/gtk.h> /* just for version */ |
6 | 6 | |
7 | 7 | #ifdef G_OS_WIN32 |
8 | +#define Rectangle Win32Rectangle | |
8 | 9 | #define WIN32_LEAN_AND_MEAN |
9 | 10 | #include <windows.h> /* native file api */ |
11 | +#undef Rectangle | |
10 | 12 | |
11 | -extern int main (int argc, char **argv); | |
13 | +#include "app_procs.h" | |
14 | +#include "interface.h" | |
12 | 15 | |
13 | 16 | /* In case we build this as a windowed application */ |
14 | 17 |
@@ -24,7 +27,20 @@ WinMain (struct HINSTANCE__ *hInstance, | ||
24 | 27 | char *lpszCmdLine, |
25 | 28 | int nCmdShow) |
26 | 29 | { |
27 | - return main (__argc, __argv); | |
30 | + dia_redirect_console (); | |
31 | + | |
32 | + app_init (__argc, __argv); | |
33 | + | |
34 | + if (!app_is_interactive()) | |
35 | + return 0; | |
36 | + | |
37 | + toolbox_show(); | |
38 | + | |
39 | + app_splash_done(); | |
40 | + | |
41 | + gtk_main (); | |
42 | + | |
43 | + return 0; | |
28 | 44 | } |
29 | 45 | |
30 | 46 | void |
@@ -253,7 +253,7 @@ OBJECTS = \ | ||
253 | 253 | arch_state.obj \ |
254 | 254 | mapping.obj |
255 | 255 | # this plug-in imports diagram_load_and_display () from dia.exe |
256 | -PKG_LINK = $(PKG_LINK) ..\..\app\dia.lib | |
256 | +PKG_LINK = $(PKG_LINK) ..\..\app\dia-app.lib | |
257 | 257 | !ENDIF |
258 | 258 | |
259 | 259 | !IFDEF OBJ_sybase |
@@ -32,7 +32,7 @@ CFLAGS = -FImsvc_recommended_pragmas.h \ | ||
32 | 32 | $(LIBXML2_CFLAGS) |
33 | 33 | |
34 | 34 | EXTRALIBS = $(EXTRALIBS) $(LIBXML2_LIBS) $(INTL_LIBS) $(PANGO_LIBS) \ |
35 | - ..\..\lib\libdia.lib ..\..\app\dia.lib | |
35 | + ..\..\lib\libdia.lib ..\..\app\dia-app.lib | |
36 | 36 | |
37 | 37 | OBJECTS = \ |
38 | 38 | diamodule.obj \ |