summaryrefslogtreecommitdiffstats
path: root/PC/example_nt/readme.txt
blob: 2487ae5ea2861af9ab4b0b4006095b1ee4bd7e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Example Python extension for Windows NT
=======================================

This directory contains everything you need to build a Python
extension module using Microsoft VC++ ("Developer Studio") version 4.x
or 5.x, except for the Python distribution.  It has been tested with
VC++ 4.2 on Python 1.5a3, and with VC++ 5.0 on Python 1.5b2.

The "example_nt" subdirectory should be an immediate subdirectory of
the Python source directory -- a direct sibling of Include and PC, in
particular, which are referenced as "..\Include" and "..\PC".  In
other words, it should *not* be used "as is".  Copy or move it up one
level or you will regret it!  (This is done to keep all the PC
specific files inside the PC subdirectory of the distribution, where
they belong.)

When using the VC++ 4.x project (makefile), it is assumed that the
build results of Python are in the directory ..\vc40.  In particular,
the python15.lib file is referred to as "..\vc40\python15.lib".  If
you have problems with this file, the best thing to do is to delete it
from the project and add it again.

When using the VC++ 5.x project (workspace), the build results of
Python are assumed to be in ..\PCbuild.  Since the provided VC++ 5.x
project and workspace files have a different structure (to support
separate "release" and "debug" builds), the example project and
workspace match this structure.

In order to use the example project from VC++ 4.x, use the "File->Open
Workspace..." dialog (*not* the "File->Open..." dialog!).  Change the
pattern to "*.mak" and select the file "example.mak".  Now choose
"File->Save All" and the othe project files will be created.

From VC+ 5.x, do the same except don't change the pattern, and select
the example.dsw workspace file.

In order to check that everything is set up right, try building:
choose "Build->Build example.dll".  This creates all intermediate and
result files in a subdirectory which is called either Debug or Release
depending on which configuration you have chosen.

Once the build has succeeded, test the resulting DLL.  In a DOS
command window, chdir to that directory.  You should now be able to
repeat the following session "(C>" is the DOS prompt, ">>>" is the
Python prompt):

	C> ..\..\vc40\python.exe
	>>> import example
	>>> example.foo()
	Hello, world
	>>>

When using VC++ 5.x, issue these commands:

	C> ..\..\PCbuild\Release\python.exe
	>>> import example
	>>> example.foo()
	Hello, world
	>>>


Creating the project
--------------------

There are two ways to use this example to create a project for your
own module.  First, choose a name ("spam" is always a winner :-) and
create a directory for it.  Copy your C sources into it.  Note that
the module source file name does not necessarily have to match the
module name, but the "init" function name should match the module name
-- i.e. you can only import a module "spam" if its init function is
called "initspam()", and it should call Py_InitModule with the string
"spam" as its first argument.  By convention, it lives in a file
called "spam.c" or "spammodule.c".  The output file should be called
"spam.dll" or "spam.pyd" (the latter is supported to avoid confusion
with a system library "spam.dll" to which your module could be a
Python interface).

Now your options are:

1) Clone example.mak.  Start by copying example_nt\example.mak to
spam\spam.mak.  Do a global edit on spam.mak, replacing all
occurrences of the string "example" by "spam", and all occurrences of
"DEP_CPP_EXAMP" by something like "DEP_CPP_SPAM".  You can now use
this makefile to create a project file by opening it as a workspace
(you have to change the pattern to *.mak first).  (When using VC++
5.x, you can clone example.dsp and example.dsw in a similar way.)

2) Create a brand new project; instructions are below.

In both cases, copy example_nt\example.def to spam\spam.def, and edit
spam\spam.def so its second line contains the string "initspam".  If
you created a new project yourself, add the file spam.def to the
project now.  (This is an annoying little file with only two lines.
An alternative approach is to forget about the .def file, and add the
option "/export:initspam" somewhere to the Link settings, by manually
editing the "Project Options" box).

You are now all set to build your extension, unless it requires other
external libraries, include files, etc.  See Python's Extending and
Embedding manual for instructions on how to write an extension.


Creating a brand new project
----------------------------

If you don't feel comfortable with editing Makefiles or project and
workspace files, you can create a brand new project from scratch
easily.

Use the "File->New..." dialog to create a new Project Workspace.
Select Dynamic-Link Library, enter the name ("spam"), and make sure
the "Location" is set to the spam directory you have created (which
should be a direct subdirectory of the Python build tree).  Select
Win32 as the platform (in my version, this is the only choice).  Click
"Create".

Now open the "Build->Settings..." dialog.  (Impressive, isn't it?  :-)
You only need to change a few settings.  Make sure you have both the
Debug and the Release configuration selected when you make the first
change.  Select the "C/C++" tab.  Choose the "Preprocessor" category
in the popup menu at the top.  Type the following text in the entry
box labeled "Addditional include directories:"

	..\Include,..\PC

Next, for both configurations, select the "Link" tab, choose the
"General" category, and add "python15.lib" to the end of the
"Object/library modules" box.

Then, separately for the Release and Debug configurations, choose the
"Input" category in the Link tab, and enter "..\PCbuild\Release" or
"..\PCbuild\Debug", respectively, in the "Additional library path"
box.

Finally, you must change the run-time library.  This must also be done
separately for the Release and Debug configurations.  Choose the "Code
Generation" category in the C/C++ tab.  In the box labeled "Use
run-time library", choose "Multithreaded DLL" for the Release
configuration, and "Debug Multithreaded DLL" for the Debug
configuration.  That's all.

You should now first create the file spam.def as instructed in the
previous section.

Now chose the "Insert->Files into Project..." dialog.  Set the pattern
to *.* and select both spam.c and spam.def and click OK.  (Inserting
them one by one is fine too.)

='column4'>| | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Enable surface transparency support on Symbian^4. Improve the behavior of expose events on Symbian. | | | * Enable surface transparency support on Symbian^4.Jason Barron2010-01-142-0/+12 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Symbian^4 systems where the window supports surface transparency, we use this for the Qt::WA_TranslucentBackground flag instead of the previous method. Task-number: QT-2026 Reviewed-by: Iain | | | * Improve the behavior of expose events on Symbian.Jason Barron2010-01-144-5/+16 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when an expose was received from WSERV, we simply called BitBlt (for raster) or called flush on the window surface (for anything else). This behavior differs from other platforms which call syncBackingStore(). This difference means that we flush the backing store without actually updating the content first. This works for most cases because if there actually was new content, it would be updated when the widget's UpdateRequest event was handled. The problem arises when the backing store does not have the correct content. This can happen if the backing store was deleted, but only partially restored (see Task below). Another problem is with the OpenVG graphics system which assumes that beginPaint() is called before endPaint() is order to initialize the context and the surface size. The fix is to call syncBackingStore() like the other platforms, but introduce a bit field to prevent infinite recursion in the painting pipeline. Task-number: QTBUG-4921 Reviewed-by: axis Reviewed-by: Gareth Stockwell * | | | Clarify the docs slightly for QPainter::beginNativePainting().Trond Kjernåsen2010-01-151-6/+11 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some complain that we don't reset every GL state in the GL engine in endNativePainting(). We simply can't do that as it would be a performance bump. The user is responsible for setting states they themselves change in a begin/endNativePainting() block, back to their default state. * | | | Fixed the encoding of the Tile and Creator tags in the PDF engine.Trond Kjernåsen2010-01-151-8/+18 |/ / / | | | | | | | | | | | | Task-number: QTBUG-7249 Reviewed-by: Kim * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-01-142-7/+16 |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QListView in icon view mode, drop enabled items wouldn't receive anything Fixes wrong stroke clipping with the raster engine. | * | | QListView in icon view mode, drop enabled items wouldn't receive anythingGabriel de Dietrich2010-01-141-0/+7 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QIconModeViewBase::filterDropEvent() was only moving the items around in the view without ever checking whether the cursor was over a drop enabled item. Now it does and returns false if it's the case. As a consequence, QAbstractItemView::dropEvent() gets called. No auto-test since it's a drag & drop related task. Reviewed-by: janarve Task-number: QTBUG-6848 | * | | Fixes wrong stroke clipping with the raster engine.Yoann Lopes2010-01-141-7/+9 | |/ / | | | | | | | | | | | | | | | | | | | | | The problem was that the clip rect was only updated when the QPen had changed. Task-number: QTBUG-7253 Reviewed-by: gunnar * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-145-8/+27 |\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QFile::remove: don't fail for unrelated errors Fix tst_qmlgraphicstext::letterSpacing tst_qmlgraphicstext::wordSpacing Sent for review into 4.6. Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 8f6992f4e8f027818429d428393b08068eca9ffa ) network internals: fix uploading of data File dialog mode is not correctly updated in Mac (Cocoa). add tests for QFlags behavior in QtScript | * | QFile::remove: don't fail for unrelated errorsJoão Abecasis2010-01-141-0/+1 | | | | | | | | | | | | | | | | | | | | | | | | remove was checking for errors from close, but without clearing the error state beforehand it ended picking unrelated errors. Task-number: QTBUG-7285 Reviewed-by: qCaro | * | Fix tst_qmlgraphicstext::letterSpacing tst_qmlgraphicstext::wordSpacing Sent ↵Warwick Allison2010-01-141-1/+9 | | | | | | | | | | | | | | | | | | | | | | | | for review into 4.6. Task-number: QTBUG-7326 Signed-off-by: Simon Hausmann <simon.hausmann@nokia.com> | * | Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ↵Simon Hausmann2010-01-144-1/+18 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ( 8f6992f4e8f027818429d428393b08068eca9ffa ) Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Kenneth Rohde Christiansen. [Qt] Update Symbian .def symbol export files after private API additions. * symbian/bwins/QtWebKitu.def: * symbian/eabi/QtWebKitu.def: | * | network internals: fix uploading of dataPeter Hartmann2010-01-141-1/+1 | | | | | | | | | | | | Reviewed-by: Markus Goetz | * | File dialog mode is not correctly updated in Mac (Cocoa).Prasanth Ullattil2010-01-142-6/+16 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileDialog shows a customized version of the native file dialog on Mac. When user changes the fileMode, the corresponding options needs to be updated in the native dialog as well. Some options like mode, filters, button text, dialog title etc needs to be updated for this. This patch also address the changing of 'acceptMode'. When user changes this, for e.g. the native dialog needs to switch from an open panel to save panel. It is easier to recreate the internal QNSOpenSavePanelDelegate than changing options individually. Task-number: QTBUG-7086 Reviewed-by: Richard Moe Gustavsen * | | Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ↵Simon Hausmann2010-01-144-1/+18 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ( 8f6992f4e8f027818429d428393b08068eca9ffa ) Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Kenneth Rohde Christiansen. [Qt] Update Symbian .def symbol export files after private API additions. * symbian/bwins/QtWebKitu.def: * symbian/eabi/QtWebKitu.def: * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Alan Alpert2010-01-143376-4814/+6597 |\ \ \ | * | | Fix QGLWidget::renderPixmap() on Windows.Trond Kjernaasen2010-01-141-6/+6 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using renderPixmap() with scenes that contained textures might not work due to the wrong texture format being used under certain circumstances. Task-number: QTBUG-7213 Reviewed-by: Gunnar | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-01-1422-448/+530 | |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix rules for recreating the Makefile in a subdir Disable some tests that require high floating point precision. Replace the truncate function with fuzzierCompare(). Rework how Qt handles GL extensions. More changelog additions for QtWebKit Make compile on symbian/Linux Removed pointless image comparison in raster colorize filter. Improved performance of translating device coordinate graphics effects. | | * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2010-01-1412-27/+62 | | |\ \ | | | |/ | | | | | | | | | | | | Conflicts: dist/changes-4.6.1 | | * | Rework how Qt handles GL extensions.Trond Kjernåsen2010-01-1315-428/+469 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt used to store the GL extensions a particular implementation supported in a global cache, which was initialized once and never updated. This could cause problems because different types of context might support different kinds of extensions (e.g. the difference between sw and hw contexts). With this patch, the GL extensions are cached and updated within each QGLContext. It also makes the extension initialization lazy, which saves application initialization costs for embedded platforms. The patch introduces a internal cross platform QGLTemporaryContext class that is used to create a light-weight GL context without going via QGLWidget and friends (QWS and WinCE still have QGLWidget fallbacks for now). Reviewed-by: Kim Reviewed-by: Samuel | | * | Make compile on symbian/LinuxThomas Zander2010-01-131-1/+1 | | | | | | | | | | | | | | | | symbian headers on Linux are lowercase and this should work on Windows too. | | * | Removed pointless image comparison in raster colorize filter.Samuel Rødal2010-01-131-1/+1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is meant to check whether the grayscale operation is done in-place or not. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen | | * | Improved performance of translating device coordinate graphics effects.Samuel Rødal2010-01-135-18/+59 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't invalidate the cache if we're only translating and the effect rect is fully contained within the device rect of the painter. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team into ↵Qt Continuous Integration System2010-01-1416-130/+68 | |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-team: Revert "Frequency to SampleRate and channels to channelCount." missed Revert "Frequency to SampleRate and channels to channelCount." Revert "Added setChannelCount() to QAudioFormat." | | * | Revert "Frequency to SampleRate and channels to channelCount."Kurt Korbatits2010-01-1412-96/+49 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 80d4a4945d3273a4b2ce91e34597533f661af320. Conflicts: examples/multimedia/audioinput/audioinput.cpp examples/multimedia/audiooutput/audiooutput.cpp src/multimedia/audio/qaudio_mac.cpp src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp src/multimedia/audio/qaudioformat.h src/multimedia/audio/qaudioinput.cpp src/multimedia/audio/qaudiooutput.cpp tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp tests/auto/qaudioformat/tst_qaudioformat.cpp tests/auto/qaudioinput/tst_qaudioinput.cpp tests/auto/qaudiooutput/tst_qaudiooutput.cpp | | * | Revert "Added setChannelCount() to QAudioFormat."Kurt Korbatits2010-01-148-34/+19 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f124538ef4840c3d24b4c7e9e7221adb52bdee2c. Conflicts: examples/multimedia/audioinput/audioinput.cpp examples/multimedia/audiooutput/audiooutput.cpp src/multimedia/audio/qaudio_mac.cpp src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp src/multimedia/audio/qaudioformat.h src/multimedia/audio/qaudioinput.cpp src/multimedia/audio/qaudiooutput.cpp tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp tests/auto/qaudioformat/tst_qaudioformat.cpp tests/auto/qaudioinput/tst_qaudioinput.cpp tests/auto/qaudiooutput/tst_qaudiooutput.cpp | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-131-2/+5 | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Doc: Describe QStackedWidget::removeWidget() more thoroughly. Doc: Resized the window and added a title. Doc: Added a missing example to the list of Graphics View examples. Doc: Clarified why a path matches in the example given. | | * \ \ Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6David Boddie2010-01-1383-690/+2098 | | |\ \ \ | | * | | | Doc: Describe QStackedWidget::removeWidget() more thoroughly.David Boddie2010-01-131-2/+5 | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Pierre Rossi | * | | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into ↵Qt Continuous Integration System2010-01-131-10/+11 | |\ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1: Use a QTextBrowser instead of a read only QTextEdit | | * | | | Use a QTextBrowser instead of a read only QTextEditHarald Fernengel2010-01-131-10/+11 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to display the extra text content. This works well on Maemo and on S60, and has the added benefit that external URLs (like in aboutQt) are opened correctly. Reviewed-By: Jason Barron | * | | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2010-01-1322-334/+419 | |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-4.6.1 | | * | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into ↵Qt Continuous Integration System2010-01-134-8/+18 | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1: (22 commits) really, *really* fix the test :} QFile cannot deal with crlf-translated stdio, so use binary mode remove trimming of (expected) output really fix the autotest support regexp-like quantifiers of expected output lines remove superfluous \r filtering print actual rather than expected output for matching text Do not set the font size unnecessarily in the simulated s60 style. Doc typos fixed Translations: Update German for 4.6.1 fix test under windows don't complain about unresolved base when the reference is absolute make the lupdate tests more verbose in case of failure don't use qmake for test setup move equivalent of output_ts test to good/ look for the .result file in the dir where the output is expected to go fix sametext and number heuristics fix number heuristics, part 1 no point in specifying -ts when a .pro file is specified clean up the lupdatecmd files ... | | | * \ \ \ Merge remote branch 'mainline/4.6' into 4.6Oswald Buddenhagen2010-01-13