• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revision87378ca7c3a3340707be2b3923cf0d914218d160 (tree)
Time2006-02-12 18:08:54
AuthorHans Breuer <hans@breu...>
CommiterHans Breuer

Log Message

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/*

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -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+
112 2006-02-11 Hans Breuer <hans@breuer.org>
213
314 * makefile.msc : nmake -f makefile.msc just compiles now
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -835,11 +835,6 @@ app_init (int argc, char **argv)
835835
836836 if (!dia_is_interactive)
837837 log_to_stderr = TRUE;
838- else {
839-#ifdef G_OS_WIN32
840- dia_redirect_console ();
841-#endif
842- }
843838
844839 if (log_to_stderr)
845840 set_message_func(stderr_message_internal);
@@ -1308,3 +1303,8 @@ parse_size(gchar *size, long *width, long *height)
13081303 *height = 0;
13091304 }
13101305 }
1306+
1307+int app_is_embedded(void)
1308+{
1309+ return 0;
1310+}
--- a/app/dia.def
+++ b/app/dia.def
@@ -36,3 +36,11 @@ EXPORTS
3636 diagram_update_extents
3737 diagram_update_connections_object
3838 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+
--- a/app/main.c
+++ b/app/main.c
@@ -26,11 +26,6 @@
2626 #include "load_save.h"
2727 #include "interface.h"
2828
29-int app_is_embedded(void)
30-{
31- return 0;
32-}
33-
3429 int main(int argc, char *argv[])
3530 {
3631 app_init(argc, argv);
--- a/app/makefile.msc
+++ b/app/makefile.msc
@@ -61,7 +61,6 @@ OBJECTS = \
6161 linewidth_area.obj \
6262 load_save.obj \
6363 magnify.obj \
64- main.obj \
6564 menus.obj \
6665 modify_tool.obj \
6766 navigation.obj \
@@ -85,8 +84,7 @@ OBJECTS = \
8584 textedit.obj \
8685 tool.obj \
8786 undo.obj \
88- win32print.obj \
89- winmain.obj
87+ win32print.obj
9088
9189 ICON_PNG_PAIRS = \
9290 dia_connectable_icon pixmaps\connectable.png \
@@ -117,9 +115,8 @@ dia-app-icons.h : makefile.msc pixmaps\*.png
117115 CC = cl -G5 -GF $(OPTIMIZE) $(CRUNTIME) -W3 -nologo
118116
119117 # 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
123120 INSTALL = copy
124121
125122 CFLAGS = -I. -I$(PRJ_TOP) -DHAVE_CONFIG_H
@@ -128,7 +125,9 @@ CFLAGS = -I. -I$(PRJ_TOP) -DHAVE_CONFIG_H
128125 all : \
129126 $(PRJ_TOP)\config.h \
130127 dia-app-icons.h \
131- $(PACKAGE).exe
128+ $(PACKAGE)-app.dll \
129+ $(PACKAGE).exe \
130+ $(PACKAGE)w.exe
132131
133132 $(PACKAGE).res : $(PACKAGE).rc $(PACKAGE).ico
134133 rc -r -fo $(PACKAGE).res $(PACKAGE).rc
@@ -138,13 +137,18 @@ RESOURCE = $(PACKAGE).res
138137 $(PACKAGE).lib : $(OBJECTS)
139138 lib /out:$(PACKAGE).lib $(OBJECTS)
140139
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) \
146142 gdi32.lib comdlg32.lib user32.lib advapi32.lib shell32.lib wsock32.lib winspool.lib $(LDFLAGS) /def:$(PACKAGE).def
147143
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+
148152 $(PRJ_TOP)/config.h: $(PRJ_TOP)/config.h.win32
149153 copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h
150154
--- a/app/winmain.c
+++ b/app/winmain.c
@@ -5,10 +5,13 @@
55 #include <gtk/gtk.h> /* just for version */
66
77 #ifdef G_OS_WIN32
8+#define Rectangle Win32Rectangle
89 #define WIN32_LEAN_AND_MEAN
910 #include <windows.h> /* native file api */
11+#undef Rectangle
1012
11-extern int main (int argc, char **argv);
13+#include "app_procs.h"
14+#include "interface.h"
1215
1316 /* In case we build this as a windowed application */
1417
@@ -24,7 +27,20 @@ WinMain (struct HINSTANCE__ *hInstance,
2427 char *lpszCmdLine,
2528 int nCmdShow)
2629 {
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;
2844 }
2945
3046 void
--- a/objects/makefile.msc
+++ b/objects/makefile.msc
@@ -253,7 +253,7 @@ OBJECTS = \
253253 arch_state.obj \
254254 mapping.obj
255255 # 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
257257 !ENDIF
258258
259259 !IFDEF OBJ_sybase
--- a/plug-ins/python/makefile.msc
+++ b/plug-ins/python/makefile.msc
@@ -32,7 +32,7 @@ CFLAGS = -FImsvc_recommended_pragmas.h \
3232 $(LIBXML2_CFLAGS)
3333
3434 EXTRALIBS = $(EXTRALIBS) $(LIBXML2_LIBS) $(INTL_LIBS) $(PANGO_LIBS) \
35- ..\..\lib\libdia.lib ..\..\app\dia.lib
35+ ..\..\lib\libdia.lib ..\..\app\dia-app.lib
3636
3737 OBJECTS = \
3838 diamodule.obj \