- Updated WINGs/NEWS with info about hw the API changed how how things
[wmaker-crm.git] / WINGs / NEWS
blob6ac1290eeabcf900ba7416ce05b6c4f52a69b634
1 *** Mon Oct 14 19:42:42 EEST 2002 - Dan
3 Double buffering
4 ----------------
6 To avoid flickering caused by redrawing the widgets on Expose events, a
7 double buffering tehnique was implemented for most of the widgets.
8 This flickering effect has gotten more vizible with the introduction
9 of antialiased text. If with normal text one can redraw the text over the
10 old one over and over again without any degradation of the text (new pixels
11 simply overwrite old pixels), with antialiased text the situation is
12 different.
13 The pixels that constitute the antialias around the text are partially
14 transparent pixels, which let part of the background be visible through them.
15 If antialiased text is drawn over and over again, whithout first erasing the
16 old one, the partially transparent pixels of the antialias will no longer
17 see the background through them, but some of them will see the old pixels of
18 the antialias around the old text that was there before. This for example
19 will make a black antialiased text over a white background get thicker as
20 the pixels of the antialias around it, combine with semitransparent black
21 pixels of the old antialias instead of combining with the white background.
22 The result is that the antialias will get darker (in this case) and the text
23 will be altered.
25 Because of this the area where text is drawn needs to be cleared before
26 antialiased text can be drawn again. But between the moment whent he area is
27 cleared and the moment when the text is drawn again there is a small time
28 gap that results in flickering. This doesn't happen with normal text where
29 one doesn't need to clear the area before drawing the text, but instead can
30 simply draw over and over again.
32 To avoid this situation, a double buffering tehnique was used. Instead of
33 drawing directly in the wisget's window (which is mapped and will flicker as
34 described above), we draw in a pixmap (unmapped) and after all is done we
35 XCopyArea() from that pixmap to the real window.
36 Since all this takes place off-screen, no flickering will be observed in
37 this case.
39 This is a change that that will be automatically available for your
40 applications and will require no change from you.
41 However there is an exception from this in case of WMList if you delegate
42 the drawing of items to userspace (read below for the compelte details).
45 *** Mon Oct 14 22:07:42 EEST 2002 - Dan
47 WMList change
48 -------------
50 In case of WMList there is the posibility to delegate the drawing of the
51 list items to the application that is linked with WINGs, and this code will
52 not be inside the WINGs library, but in userland. Since we use the double
53 buffering tehnique in this case too (to allow all widgets based on WMList
54 and the ones that draw their list items by themselves to benefit from the
55 double buffering advantage automatically), we no longer pass the window to
56 the user code doing item drawing, but instead pass this pixmap in which we
57 draw before copying to the real window.
59 Since one cannot use XClearWindow() or XClearArea() on pixmaps, but only on
60 windows, if your list item drawing code used to contain these to clear the
61 item area before drawing it needs to change, else the application will die
62 when it tires to XClearArea() on a pixmap.
64 This means that in your application if you ever used WMSetListUserDrawProc()
65 so set a userspace routine which draws WMList items in a particular fashion,
66 you need to make sure your function will not call XClearArea() or
67 XClearWindow() on the drawable that was passed to draw in.
69 Instead you should use XFillRectangle().
71 This change also means that you no longer need to do double buffering in
72 your code, if you ever used to do. It is not done by WINGs and you benefit
73 from it automatically.
76 *** Mon Oct 14 19:28:35 EEST 2002 - Dan
78 API change
79 ----------
81 WMDrawString() and WMDrawImageString() no longer take a GC as argument.
82 Instead WMDrawString() takes a WMColor* as the color for the string to be
83 drawn, while WMDrawImageString() takes 2 WMColor* arguments in place of the
84 old GC: first for text color and second for background color.
86 This change is required to support extending WMFont to allow it to handle
87 antialiased fonts through the XFree86 Xft extension.
89 This also has the advantage of hiding low level X11 details and use WINGs
90 internat objects instead.
92 To fix your old code to work with the new WINGs API you need to replace the
93 GC passed to WMDraw***String() in your code with a WMColor*.
94 Most of the old code used to be like this:
96 WMDrawString(screen, window, WMColorGC(color), font, x, y, txt, len);
98 for the new API it should be replaced by:
100 WMDrawString(screen, window, color, font, x, y, txt, len);
102 However if you used a particular GC created by yourself to suit your special
103 needs, you need to pass a color which is the same as the foreground color of
104 that gc.
106 For WMDrawImageString(), from:
108 WMDrawImageString(screen, window, gc, font, x, y, txt, len);
110 becomes
112 WMDrawImageString(screen, window, textColor, backColor, font, x, y, txt, len);
114 where textColor and backColor are declared like:
116 WMColor *textColor, *backColor;
118 and have the color of the foreground respective the background of the old gc.
122 *** Wed Oct  9 07:10:04 EEST 2002 - Dan
124 Xft support in WINGs
125 --------------------
127 If Xft is detected when configure it is run, support for drawing antialiased
128 fonts with transparency will be compiled into WINGs.
129 You need at least Xfree86 version 4.0.x for this but at least 4.1.x is
130 recommended.
132 For Xft support there is a new function to create a font that will render
133 using antialiasing and transparency: WMCreateAAFont().
134 Passing such a font to WMDrawString() or WMDrawImageString() will result
135 in antialiased text displayed on screen. Modifying the alpha value for the
136 WMColor passed to WMDrawString() or WMDrawImageString() will result in text
137 being displayed with the appropriate transparency.
139 To control antialiased font behavior, there are 3 new options that go into
140 WMGLOBAL. Two of them are to set the system font used when an antialiased
141 font is required. They operate in a similar way as SystemFont and
142 BoldSystemFont, just they are used when antialiased fonts are requested.
143 They are named AASystemFont respectively AABoldSystemFont. They are kept
144 separate from SystemFont and BoldSystemFont because the same fonts don't
145 render well as both normal and antialiased if they are not TrueType fonts.
146 Even though you can specify any font in the XLFD format for these new
147 options, it is recomended to use TrueType fonts for the antialiased case
148 since other fonts (standard X fonts)  don't render well and give ugly
149 results.
151 The third option is an option that globally controls if WINGs uses or not
152 antialiased fonts. It is named AntialiasedText and it has a boolean Yes/No
153 value. If set to Yes, WINGs will try to use antialiased fonts (if support
154 was compiled in, and antialiased fonts can be found) then revert to normal
155 fonts if not possible. Note that this applies if WMCreateFont(),
156 WMSystemFont(), WMSystemFontOfSize(), WMBoldSystemFont() or
157 WMBoldSystemFontOFize() are used. If any of the direct creation functions
158 are used, such as WMCreateAAFont() or WMCreateNormalFont(), then that kind
159 of font is returned independently of the value of AntialiasedText.
160 (However note that an antialiased font cannot be created if Xft support was
161 no compiled into WINGs, even if you call WMCreateAAFont() directly. In this
162 case WMCreateAAFont() will always return NULL)
166 *** Mon Sep 09 06:58:30 EEST 2002 - Dan
168 New delegate for the WMConnection class
169 ---------------------------------------
171 ConnectionDelegate structure has a new member: canResumeSending.
172 The purpose of this callback is to notify you that you can resume sending
173 data over a WMConnection.
174 It works in the following manner:
176 WMSendConnectionData() can return 3 values: -1, 0, 1
178 -1 - means that the connection has died. you should stop sending data and
179      close the connection ASAP.
180  1 - means that the data was succesfully sent
181  0 - means that the data (or part of it) was not sent. however, it was saved
182      in a queue and the library will try to send it later when possible.
184 if the return value is 1, you can continue to send the next message, and so
185 on, until the return value of such a send call will be 0.
186 In this case you can continue sending, however, the data will not be sent
187 over the connection because the operating system cannot accept any more data
188 for the moment. Instead it will be queued inside the library, making your
189 program's memory footprint increase. If the ammount of data you need to
190 send is limited and not too big, this shouldn't be a problem, because your
191 data will be queued and sent when the operating system will notify the
192 library that sending is possible again.
193 If this is the case you can just ignore the output of WMSendConnectionData()
194 and not set a callback for canResumeSending.
196 However, if the ammount of data you have to send is undetermined and you
197 also want to keep a small memory footprint for your program (so that it
198 won't grow until it uses all your available memory ;) ), you will have to
199 stop sending data over the connection as soon as WMSendConnectionData()
200 returns with 0. Then you should somehow mark this situation in your program
201 to avoid it trying to send anymore data until notified that it can resume.
202 (You should have also set a canResumeSending callback when you initialized
203 your WMConnection object because else you cannot be notified when to resume.)
205 Now, when you receive such a 0 from the send operation, your last sent data
206 is put in a queue inside the library. At a later time when the operating
207 system notifies the library that sending is possible again, the library will
208 resume to send the data that is saved in the queue. After it will be able to
209 send all the data in the queue, the canResumeSending callback will be
210 called, letting you know that not only you can resume sending because the
211 operating system is again able to send data, but also that the queue was
212 completely flushed.
214 From the canResumeSending callback, you should again update the status of
215 your program marking that it can send again, and then resume sending the
216 data from where you were left.
219 *** Thu Oct 04 06:00:09 EEST 2001 -Dan
221 Property lists handling code
222 ----------------------------
224 Code to handle property lists was added to WINGs. It is more robust
225 than the libPropList code, mostly because some conflicting concepts 
226 borrowed from UserDefaults (which libPropList use) are no longer used in
227 the WINGs property lists code. These borrowed concepts conflicted with the
228 retain/release mechanism of property lists and could lead in certain cases
229 to segmentation faults when executing libPropList based code. But the worse
230 part was that these libPropList problems were practically unsolvable without
231 removing one of those conflicting concepts and without a complete redesign. 
232 The new WINGs property lists code is also better integrated with the other
233 data types from WINGs and is actively maintained.
235 Practically the things that were removed from the WINGs property list
236 implementation compared to the old libPropList implementation, are exactly
237 the UserDefaults borrowed concepts that conflict with the retain/release
238 mechanism:
239 - The container of a proplist object and the associated functions are gone.
240 - The filename associated with a proplist object and the corresponding
241   functions are gone. Now the saving function needs the filename as a
242   parameter.
243 - The synchronization functions are no longer supported. They are part of
244   the UserDefaults and are implemented there.
245 - No functions related to domains/registering were implemented in the WINGs
246   property lists code, because they are also not part of property lists.
247   They are more in connection with UserDefaults and a central point of access
248   for domains.
250 The above 2 concepts: container and filename were added to libPropList just
251 to let it support synchronization which was borrowed from UserDefaults.
252 Property lists as defined in the openstep specification are just complex
253 data structures composed of strings, data, arrays, dictionaries and a mix of
254 them and are not associated with any file in particular. UserDefaults on the
255 other hand are property lists read from a specific file and they associate
256 that property list with that file and allow them to be synchronized.
258 Old libPropList based code can still be used by linking against the WINGs
259 library containing the new proplist code with minimal changes which are
260 described in detail in the comments at the top of the WINGs/proplist-compat.h
261 header file (the same file carries the #defines for mapping old libPropList
262 functions to the new WINGs proplist functions).
263 Our recommendation is to move to the new functions WINGs provide because
264 they better integrate with other function naming conventions in WINGs.
265 The proplist-compat.h header file is just a way to have old code up and
266 running with minimal changes so that we can remove the old and unmaintained
267 libPropList from systems while keeping to use old libPropList based code
268 without rewriting it and it should not be used for other purposes.
271 *** Sat Apr 21 09:12:09 EEST 2001 -Dan
273 API change
274 ----------
276 To allow a correct display of icon images with alpha blending in panels and
277 other places where a WINGs based application may use them the following
278 changes took place:
280 1. The following functions were renamed:
281    - WMSetApplicationIconImage()  --> WMSetApplicationIconPixmap()
282    - WMGetApplicationIconImage()  --> WMGetApplicationIconPixmap()
283    - WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
284 2. The following functions were added:
285    - WMSetApplicationIconImage(WMScreen *scr, RImage *image)
286    - RImage* WMGetApplicationIconImage(WMScreen *scr)
287    - WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *col)
289 As you can see the old functions that operated on WMPixmap images (which are
290 basically X Pixmaps that lack alpha information) were renamed to ...Pixmap()
291 to make them more suggestive about what they do and to make room for the
292 new functions that operate on RImages (that hold alpha information).
294 Since the corresponding WMGet... functions only retrieve the stored
295 image/pixmap from the application, I'll outline how the WMSet...
296 functions operate:
298 All WM...IconPixmap() functions operate on WMPixmaps
299 All WM...IconImage() functions operate on RImages
302 - WMSetApplicationIconImage() will set the RImage to be used in panels
303     and will also convert the RImage to a WMPixmap with a threshold of 128
304     and will use that pixmap for the appicon image. If that doesn't satisfy
305     you, you can make a call to WMSetApplicationIconPixmap() on your own to
306     set whatever WMPixmap you see fit for the appicon. 
308 - WMSetApplicationIconPixmap() will set the WMPixmap to be used for the
309     appicon and for the panels 
312 If you use only one of the above functions, the corresponding image/pixmap
313 will be used everywhere where needed (panels and appicon), but the pixmap
314 version will not be able to handle alpha blending correctly.
316 If you use both WMSetApplicationIconImage() and WMSetApplicationIconPixmap()
317 then the RImage will have priority in panels, and the WMPixmap will only be
318 used for the appicon. This allows you to better control what icon is
319 displayed in the appicon, in case the default conversion of the RImage to a
320 pixmap with a threshold of 128 is not good enough, or in case you want a
321 different icon to be shown in the appicon than in panels.
324 Also this new function was added:
326 - WMCreateApplicationIconBlendedPixmap() will use the RImage set with
327     WMSetApplicationIconImage() if available and will blend it with the color
328     you passed. This will make the image show well on a background of that
329     color. If the RImage was not set it will return NULL. You need to call
330     WMReleasePixmap() on it after you finish with it. Passing a NULL pointer
331     instead of a color will make the RImage be blended with the default color
332     of the WINGs widgets: '#aeaaae' making it suitable to be assigned to any
333     WINGs widget.
336 To make your existing code work as before all you need to do is to rename
337 the following functions:
339    - WMSetApplicationIconImage()  --> WMSetApplicationIconPixmap()
340    - WMGetApplicationIconImage()  --> WMGetApplicationIconPixmap()
341    - WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
343 But if you want to take advantage of the new abilities to show alpha
344 blended images you need to start using the new functions.