- Fixed a bug with empty frame titles (Alexey Voinov <voins@voins.program.ru>)
[wmaker-crm.git] / WINGs / NEWS
blob5f1488fa9bfb6242a96af98a0884a69de1f968f0
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 are 2 new functions to create a font that will render
133 using antialiasing and transparency: WMCreateAntialiasedFont() and
134 WMCreateAntialiasedFontSet(). Later is for multibyte languages.
135 Passing such a font to WMDrawString() or WMDrawImageString() will result
136 in antialiased text displayed on screen. Modifying the alpha value for the
137 WMColor passed to WMDrawString() or WMDrawImageString() will result in text
138 being displayed with the appropriate transparency.
140 To control antialiased font behavior, there are 3 new options that go into
141 WMGLOBAL. Two of them are to set the system font used when an antialiased
142 font is required. They operate in a similar way as SystemFont and
143 BoldSystemFont, just they are used when antialiased fonts are requested.
144 They are named AntialiasedSystemFont respectively AntialiasedBoldSystemFont.
145 They are kept separate from SystemFont and BoldSystemFont because the same
146 fonts don't render well as both normal and antialiased if they are not
147 TrueType fonts. Even though you can specify any font in the XLFD format for
148 these new options, it is recomended to use TrueType fonts for the antialiased
149 case since other fonts (standard X fonts)  don't render well and give ugly
150 results.
152 The third option is an option that globally controls if WINGs uses or not
153 antialiased fonts. It is named AntialiasedText and it has a boolean Yes/No
154 value. If set to Yes, WINGs will try to use antialiased fonts (if support
155 was compiled in, and antialiased fonts can be found) then revert to normal
156 fonts if not possible. Note that this applies if WMCreateFont(),
157 WMSystemFont(), WMSystemFontOfSize(), WMBoldSystemFont() or
158 WMBoldSystemFontOFize() are used. If any of the direct creation functions
159 are used, such as WMCreateAntialiasedFont() or WMCreateNormalFont(), then
160 that kind of font is returned independently of the value of AntialiasedText.
161 (However note that an antialiased font cannot be created if Xft support was
162 no compiled into WINGs, even if you call WMCreateAntialiasedFont() directly.
163 In this case WMCreateAntialiasedFont() will always return NULL)
165 These 3 options from WMGLOBAL (which apply to all WINGs applications) can be
166 overwritten on a per application basis by putting them in the application's 
167 specific domain file (usually ~/GNUstep/Defaults/application_name).
169 There is also another new font creation function available.
170 WMCreateFontWithFlags(screen, fontName, flags)
172 flags will specify what kind of font to create. They are defined in WINGs.h
173 as an enum: WMFontFlags
175 If WFDefaultFont is passed then the function will work exactly like 
176 WMCreateFont() by creating a font according to the options from the
177 configuration.
178 However if some specific flag is passed than that option will be altered. All
179 the other options will keep their default values.
181 There are 2 font options available (at this time):
182 1. Font type (if a normal font or a font set)
183 2. Font antialiasing (if it's an antialiased font or not)
185 If flags specifies a value for each of the available options then a specific
186 font which only takes into account those flag values will be created and all
187 the font options specified in the configuration (like MultiByte or Antialiasing)
188 will be ignored.
189 However if only some of the options are specified, then for the missing options
190 the default values from the configuration will be used.
192 For example if antialiasing is enabled in the configuration and you pass
193 WFNotAntialiased as the flag, then a font with all the properties defined in
194 the configuration (except antialiasing) will be created. This means that if 
195 MultiByte is defined a fontset will be created, else a normal font will be 
196 created and you don't have to worry about the rest of the flags you didn't
197 specify.
201 *** Mon Sep 09 06:58:30 EEST 2002 - Dan
203 New delegate for the WMConnection class
204 ---------------------------------------
206 ConnectionDelegate structure has a new member: canResumeSending.
207 The purpose of this callback is to notify you that you can resume sending
208 data over a WMConnection.
209 It works in the following manner:
211 WMSendConnectionData() can return 3 values: -1, 0, 1
213 -1 - means that the connection has died. you should stop sending data and
214      close the connection ASAP.
215  1 - means that the data was succesfully sent
216  0 - means that the data (or part of it) was not sent. however, it was saved
217      in a queue and the library will try to send it later when possible.
219 if the return value is 1, you can continue to send the next message, and so
220 on, until the return value of such a send call will be 0.
221 After it returns 0 you can continue sending, however, the data will not be
222 sent over the connection because the operating system cannot accept any more
223 data for the moment. Instead it will be queued inside the library, making your
224 program's memory footprint increase. If the ammount of data you need to
225 send is limited and not too big, this shouldn't be a problem, because your
226 data will be queued and sent when the operating system will notify the
227 library that sending is possible again.
228 If this is the case you can just ignore the output of WMSendConnectionData()
229 and not set a callback for canResumeSending.
231 However, if the ammount of data you have to send is undetermined and you
232 also want to keep a small memory footprint for your program (so that it
233 won't grow until it uses all your available memory ;) ), you will have to
234 stop sending data over the connection as soon as WMSendConnectionData()
235 returns with 0. Then you should somehow mark this situation in your program
236 to avoid it trying to send anymore data until notified that it can resume.
237 (You should have also set a canResumeSending callback when you initialized
238 your WMConnection object because else you cannot be notified when to resume.)
240 Now, when you receive such a 0 from the send operation, your last sent data
241 is put in a queue inside the library. At a later time when the operating
242 system notifies the library that sending is possible again, the library will
243 resume to send the data that is saved in the queue. After it will be able to
244 send all the data in the queue, the canResumeSending callback will be
245 called, letting you know that not only you can resume sending because the
246 operating system is again able to send data, but also that the queue was
247 completely flushed.
249 From the canResumeSending callback, you should again update the status of
250 your program marking that it can send again, and then resume sending the
251 data from where you were left.
254 *** Thu Oct 04 06:00:09 EEST 2001 -Dan
256 Property lists handling code
257 ----------------------------
259 Code to handle property lists was added to WINGs. It is more robust
260 than the libPropList code, mostly because some conflicting concepts 
261 borrowed from UserDefaults (which libPropList use) are no longer used in
262 the WINGs property lists code. These borrowed concepts conflicted with the
263 retain/release mechanism of property lists and could lead in certain cases
264 to segmentation faults when executing libPropList based code. But the worse
265 part was that these libPropList problems were practically unsolvable without
266 removing one of those conflicting concepts and without a complete redesign. 
267 The new WINGs property lists code is also better integrated with the other
268 data types from WINGs and is actively maintained.
270 Practically the things that were removed from the WINGs property list
271 implementation compared to the old libPropList implementation, are exactly
272 the UserDefaults borrowed concepts that conflict with the retain/release
273 mechanism:
274 - The container of a proplist object and the associated functions are gone.
275 - The filename associated with a proplist object and the corresponding
276   functions are gone. Now the saving function needs the filename as a
277   parameter.
278 - The synchronization functions are no longer supported. They are part of
279   the UserDefaults and are implemented there.
280 - No functions related to domains/registering were implemented in the WINGs
281   property lists code, because they are also not part of property lists.
282   They are more in connection with UserDefaults and a central point of access
283   for domains.
285 The above 2 concepts: container and filename were added to libPropList just
286 to let it support synchronization which was borrowed from UserDefaults.
287 Property lists as defined in the openstep specification are just complex
288 data structures composed of strings, data, arrays, dictionaries and a mix of
289 them and are not associated with any file in particular. UserDefaults on the
290 other hand are property lists read from a specific file and they associate
291 that property list with that file and allow them to be synchronized.
293 Old libPropList based code can still be used by linking against the WINGs
294 library containing the new proplist code with minimal changes which are
295 described in detail in the comments at the top of the WINGs/proplist-compat.h
296 header file (the same file carries the #defines for mapping old libPropList
297 functions to the new WINGs proplist functions).
298 Our recommendation is to move to the new functions WINGs provide because
299 they better integrate with other function naming conventions in WINGs.
300 The proplist-compat.h header file is just a way to have old code up and
301 running with minimal changes so that we can remove the old and unmaintained
302 libPropList from systems while keeping to use old libPropList based code
303 without rewriting it and it should not be used for other purposes.
306 *** Sat Apr 21 09:12:09 EEST 2001 -Dan
308 API change
309 ----------
311 To allow a correct display of icon images with alpha blending in panels and
312 other places where a WINGs based application may use them the following
313 changes took place:
315 1. The following functions were renamed:
316    - WMSetApplicationIconImage()  --> WMSetApplicationIconPixmap()
317    - WMGetApplicationIconImage()  --> WMGetApplicationIconPixmap()
318    - WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
319 2. The following functions were added:
320    - WMSetApplicationIconImage(WMScreen *scr, RImage *image)
321    - RImage* WMGetApplicationIconImage(WMScreen *scr)
322    - WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *col)
324 As you can see the old functions that operated on WMPixmap images (which are
325 basically X Pixmaps that lack alpha information) were renamed to ...Pixmap()
326 to make them more suggestive about what they do and to make room for the
327 new functions that operate on RImages (that hold alpha information).
329 Since the corresponding WMGet... functions only retrieve the stored
330 image/pixmap from the application, I'll outline how the WMSet...
331 functions operate:
333 All WM...IconPixmap() functions operate on WMPixmaps
334 All WM...IconImage() functions operate on RImages
337 - WMSetApplicationIconImage() will set the RImage to be used in panels
338     and will also convert the RImage to a WMPixmap with a threshold of 128
339     and will use that pixmap for the appicon image. If that doesn't satisfy
340     you, you can make a call to WMSetApplicationIconPixmap() on your own to
341     set whatever WMPixmap you see fit for the appicon. 
343 - WMSetApplicationIconPixmap() will set the WMPixmap to be used for the
344     appicon and for the panels 
347 If you use only one of the above functions, the corresponding image/pixmap
348 will be used everywhere where needed (panels and appicon), but the pixmap
349 version will not be able to handle alpha blending correctly.
351 If you use both WMSetApplicationIconImage() and WMSetApplicationIconPixmap()
352 then the RImage will have priority in panels, and the WMPixmap will only be
353 used for the appicon. This allows you to better control what icon is
354 displayed in the appicon, in case the default conversion of the RImage to a
355 pixmap with a threshold of 128 is not good enough, or in case you want a
356 different icon to be shown in the appicon than in panels.
359 Also this new function was added:
361 - WMCreateApplicationIconBlendedPixmap() will use the RImage set with
362     WMSetApplicationIconImage() if available and will blend it with the color
363     you passed. This will make the image show well on a background of that
364     color. If the RImage was not set it will return NULL. You need to call
365     WMReleasePixmap() on it after you finish with it. Passing a NULL pointer
366     instead of a color will make the RImage be blended with the default color
367     of the WINGs widgets: '#aeaaae' making it suitable to be assigned to any
368     WINGs widget.
371 To make your existing code work as before all you need to do is to rename
372 the following functions:
374    - WMSetApplicationIconImage()  --> WMSetApplicationIconPixmap()
375    - WMGetApplicationIconImage()  --> WMGetApplicationIconPixmap()
376    - WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
378 But if you want to take advantage of the new abilities to show alpha
379 blended images you need to start using the new functions.