Log of /trunk/gui/gui/src/TGPicture.cxx
Parent Directory
Revision
22419 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 3 00:25:01 2008 UTC (6 years, 10 months ago) by
rdm
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 13638 byte(s)
Diff to
previous 20882
From Andrew Savchenko:
ROOT can not be compiled with gcc-4.3.
Some ROOT source files doesn't contain required #include directives,
for example, they use strlen(), but #include <string.h> is missed or
malloc() is used and #include <stdlib.h> is missed.
Earlier versions of gcc allowed some headers to be included implicitly,
but issued a warning (-Wimplicit-function-declaration). Newer one,
gcc-4.3 denies such silly behaviour: all required headers must be explicitly
included.
Attached patch fixes this. Also it fixes another issue, which disallows
ROOT to compile under gcc-4.3: C functions don't belong to namespace std,
so expressions like std::memcpy() are no longer valid and plain memcpy()
should be used instead.
Revision
15134 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 23 04:47:42 2006 UTC (8 years, 8 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 13617 byte(s)
Diff to
previous 13278
From Federico Carminati:
"I have implemented all copy and equal operators needed to silence all
warnings in AliRoot, as requested. I have implemented shallow copies as
would do the default operators synthetized by the compiler.
Most operators are protected. If users complain, you just have to move
them into the public area, but class derivation is of course supported.
It has been a terrible job, I have modified 278 files, but the changes
are backward compabile, and this goes a long way to permitting user to
use the effc++ flag with root headers."
Revision
12179 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 24 12:27:30 2005 UTC (9 years, 7 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 12973 byte(s)
Diff to
previous 12101
From Ilka, Valeri & Valeriy
TCanvas.cxx:
- Minory mods which allow to solve QtRoot Canvas activation problems (move "
Set Pad parameters" to the beginning).
TPad.cxx:
- The current Pad is saved using TVirtualX::WritePixmap method to allow ROOT to
save pixmap under Qt even no TImage class implementation is provided.
TGPicture.cxx:
- Removed QtRoot specific code.
TGQt.h:
- Add as a "friend class" TQtClientGuard and a new IsRegistered method for
extra protection.
TGQt.cxx:
- Restore the initial state of 4.04. and a new guard method IsRegisitered
added.
- the following GUI related methods moved to GQtGUI.cxx source code:
unsigned char *GetColorBits(Drawable_t wid, Int_t x = 0, Int_t y = 0, UInt_t w =
0, UInt_t h = 0);
Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t
height);
Window_t GetCurrentWindow() const;
- Fixed later assignment of canvas for TQtWidget object. That allows to fix
initialization problems for TRootEmbeddedCanavs under QtRoot.
TVirtualX.interface.h:
- Add the three new methods listed above
GQTGui.cxx:
- Compilation warning removed
- 3 methods listed above moved from TGQt.cxx (by Onuchine to back ASImage)
- GetWidbiwID - restored the original version and lift a protection against
the Windows_t misuse. That is errore prone correction - to be
revised
TQtClientGuard.cxx:
- An extra protection to check whether the widget is registered
Revision
12101 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 21 17:09:26 2005 UTC (9 years, 7 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 14166 byte(s)
Diff to
previous 11911
From Valeriy and Ilka:
The last patch of Valeriy with some additional comments by Ilka:
- TVirtualX/TGWin32/TGWin32VirtualXProxy, TGQt new methods added
o unsigned char *GetColorBits(Drawable_t wid, Int_t x, Int_t y, UInt_t w, U
Int_t h)rns an array of pixels created from a part of drawable (defined by x, y,
w, h)n format: b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ..
Pixels are numbered from left to right and from top to bottom.
By default all pixels from the whole drawable are returned.
Note that return array is 32-bit aligned
o Pixmap_t CreatePixmapFromData(unsigned char * bits, UInt_t width, UInt_t h
eight)create pixmap from RGB data. RGB data is in format :
b1, g1, r1, 0, b2, g2, r2, 0 ... bn, gn, rn, 0 ..
Pixels are numbered from left to right and from top to bottom.
Note that data must be 32-bit aligned
- TGQt (*provided changes do not work; I cannot run rose_image.C tutorials under
tRoot because of SegV in:
#3 0x0114172a in TGQt::GetWindowID (this=0xa1a2ab8, id=4)
at qt/src/GQtGUI.cxx:507
#4 0x01b56914 in TASImage::Paint (this=0xaa80d68, option=0xac85d1c "xxx")
at asimage/src/TASImage.cxx:1047
#5 0x02ddc948 in TPad::PaintModified (this=0xacb85d8)
at gpad/src/TPad.cxx:2396
#6 0x02ddc834 in TPad::PaintModified (this=0xac1f108)
at gpad/src/TPad.cxx:2381
#7 0x02db7cdb in TCanvas::Update (this=0xac1f108)
at gpad/src/TCanvas.cxx:1858
*
TGQt::GetWindowID (this=0xa1a2ab8, id=4) at qt/src/GQtGUI.cxx:507
o corrected an implementation of "Window_t TGQt::GetWindowID(Int_t id)"
That allows to run rose_image.C tutorials under QtRoot
o implemented TGQt::GetCurrentWindow()
That allows to save canvas/pad in in image formats by using TASImage cl
- TImage/TASImage:
o new method added PaintImage(Drawable_t wid, Int_t x, Int_t y) which allows t
o the Draw option which allows to expand image to the pad size was renamed fro
o new Draw/Paint option added - if "z" is specified an image palette is drawn
o TAttImage: SetPaletteEnabled/IsPaletteEnabled introduced - which allows to s
o image convertion to gray is now "toggable"
o new method :PaintImage(Drawable_t wid, Int_t x, Int_t y) introduced which al
- tutorials/galaxy_image.C. Unnecessary "img->SetName("n4254"); was removed
- TPad::Print - remove QtRoot specific code
- TToggle - "sanity" check added
- TGPicture.cxx - *added QtRoot specific code by gVirtualX->InheritsFrom("TGQt")
Revision
11911 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 30 22:38:39 2005 UTC (9 years, 7 months ago) by
rdm
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 12972 byte(s)
Diff to
previous 11898
From Valeriy:
TGPicture:
- fix deallocation autogenerated disabled pictures. That allows to fix
seg. violation after running $ROOTSYS/test/stress reported by Markus Frank.
An important comment was added to constructor
TGPicture(const char *name, Pixmap_t pxmap, Pixmap_t mask)
"both pixmaps pxmap and mask must be unique (not shared)"
- new method TGPicturePool::GetPicture(const char *name, char **xpm) added
that allows to create pictures from in-memory XPM array
Example:
#include "myicon.xpm" // contains static char** myicon {..} array
const TGPicture *pic = gClient->GetPicturePool()->GetPicture("myicon",
myicon);
TGButton:
- new method SetEnablled added which allows to activate/deactivate
enabled/disabled state of button
TASImage/TImage:
- Few new vector graphics methods added:
DrawCubeBezier, DrawStraightEllips, DrawCircle, DrawEllips,DrawEllips2
ToGray method, which allows to convert RGB image to Gray image
TImageDump:
- open circle polymarkers are implemented
Revision
11898 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 27 12:24:44 2005 UTC (9 years, 8 months ago) by
rdm
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 11735 byte(s)
Diff to
previous 11885
From Valeriy:
-TASImage:
o CreateThumbnail() - add more contrastness to generated thumbnails
o GetMask() - gVirtualX->CreateBitmap requires a width of input bitmap to be
even to 8 . This mod fixes the problem of XPM images reading.
- TGListView - more corrections in adjusting page position after
changing vew mode.
- TGPicture. Prblem with reading XPM files via TImage is fixed
(TASImage::GetMask) I removed platform dependent code.
- TRootBrowser
o minory mod in dynamic thumbnal generation
o possibility to navigate through "browsing history" added.
o 3 new buttons added to ROOT browser toolbar -
"Back", "Forward", "Refresh"
- root.mimes - minory mods.
Revision
11862 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 24 20:05:10 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 14241 byte(s)
Diff to
previous 11813
From Valeriy Onuchin:
- root.mimes. Default actions changed for some image types (*.png, *.gif,
*.jpg etc.)
Drawing images in canvas is better than drawing it as TGPictureButton.
Image drawn in canvas can be processed via context menu, scaled, resized
etc.
- TPad::Print - roll-back recent changes in GIF saving. Use again
TVirtualX::WriteGIF
method for saving GIF files which produces much smaller files.
BTW, the patent on LZW compression was expired july 2004. So, making
GIF is now legal.
- TGMimeTypes - fix nasty typo-bug in GetIcon method. The effect of the
bug was appeared as
no large icons were displayed for qq.png, qq.gif etc. files types.
- TGPicture - minory mods
- TGFileContainer::GetFilePictures - optimised for speed. To test a gain
in performance -
run TBrowser on slow computer and open up $ROOTSYS/icons directory.
New data member TGFileContainer::fCachePictures was added which allows
to switch on/off this mechanism.
- TRootBrowser. Weired "refresh behavior" was fixed - when some macro was
browsed/executed and then canvas was deleted, browser's icon box was
refreshed and
currrent "page position" was changed to the most upper one.
Now page position remains on the same place.
- Refresh TBrowser on F5 pressed action added.
- TGLVEntry - SetPictures method added, whic allows to change list view
entry pictures dynamically.
- TSystemFile. SetIconName, GetIconName methods addd
Revision
11813 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 18 12:31:10 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 13993 byte(s)
Diff to
previous 11795
From Valeriy Onuchin:
this patch fixes all compilation problems for
ROOT under windows with VC6 compiler.
- The main problem is that VC6 compiler does not recognize
"long long" type in rootcint generated dictionaries,
To fix this, wherever "long long" type was writen in dictionary file it was
replaced with native win32 "long long" type_string "__int64".
Modified files are: cint/src/val2a.c, cint/src/newlink.c, cint/src/Class.cxx
Other changes:
- many classes contained "list" variables.
That produced name_clash with std::list class name.
- many classes contained
for (int i=0; ..) {..}
for (int i=0; ..) {..}
which caused "duplication of initialisation" bug.
- gl/src/CsgOps.cxx had outside declared templated parameter used inside
internal function.
- TString Atoi, Atof - std namespace was removed.
_ TASimage - custom Streamer was changed. Reading/writing class version
was added. That allows to keep "future compatibility"/"schema evolution"
Demo files galaxy.root, gallery.root were rewritten.
- I rolled back changes in TGPicture class which are related to reading
of XPM files because of problems under win32.
- TASImage::GetMask method was reimplemented.
- libAfterImage.tar.gz - fix all compilation problem under win32 (vc6)
Revision
11795 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun May 15 07:30:17 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 10329 byte(s)
Diff to
previous 11793
From Valeriy Onuchin:
- TASImage, TRootBrowser, TGMimeTypes.cxx
The size of image thumbnail was enlarged from 32x32 to 64x64 pixels.
Appearance of picture thumbnails was much improved.
- TGPicture. Fix possible buffer overflow in HashName method.
- TRootCanvas. Possibility to save canvas in XCF format added.
This format is used in the GIMP (image processing program).
In general the new method of dynamical creation of object's icon can be
extended for any kind of objects.
Revision
11793 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun May 15 05:53:45 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 10329 byte(s)
Diff to
previous 10701
From Valeriy Onuchin:
- TASImage class:
o new method GetImageBuffer is introduced. It returns in-memory buffer
compressed according to the image type.
Buffer must be deallocated after usage.
This method can be used for sending images over the network.
o new method SetImageBuffer introduced. It creates image from compressed
buffer. Supported formats:
PNG - by default
XPM - two options exist:
1. xpm as a single string (raw buffer). Such a string
is returned by GetImageBuffer method.
For example:
char *buf;
int sz;
im1->GetImageBuffer(&buf, &int, TImage::kXpm); /*raw buffer*/
TImage *im2 = TImage::Create();
im2->SetImageBuffer(&buf, TImage::kXpm);
2. xpm as an array of strigs (preparsed)
For example:
char *xpm[] = {
"64 28 58 1",
" c #0A030C",
". c #1C171B"
...
TImage *im = TImage::Create();
im->SetImageBuffer(xpm, TImage::kXpm);
o custom Streamer was implemented. That allows to save images in ROOT files.
Image's thumbnail is also saved into a file.
o galaxy_image.C tutorial is modified according to new saving schema.
o new demo file gallery.root added to tutorials. It contains thumbnailed
and browsable pictures produced by some ROOT tutorials.
o fix bug im TASImage::DrawRectangle methods. Thanks to Thomas Bretz
for reporting it.
- TKey class.
Possibility to save thumbnail/icon as XPM string along with object added.
Currently such mechanism is used for saving thumbnailed images.
- TGPicture. Platform-dependent code was removed. Now TGPictures
are created by TImage objects.
- TRootBrowser classes. Possibility to show objects with dynamically created
icons added.
- numerous bug fixes in libAfterImage library.
Revision
10701 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 7 15:34:27 2004 UTC (10 years, 1 month ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 13980 byte(s)
Diff to
previous 10337
From Valeriy Onuchin:
- massive update of TImage/TASImage class.
- update rose_image.C macro to demonstrate new features.
- new example hist2image.C added
I'll try to add more example and documentation asap.
- bug fixes in ROOT gui builder
- TGToolBar, TGShutter now "compatible" with hierarchical cleaning
- mods in TGPicture allow create masked pictures from images.
Revision
10337 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 18 12:47:28 2004 UTC (10 years, 3 months ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 13519 byte(s)
Diff to
previous 9830
From Valeriy Onuchin:
- new method GetPicture added to TImage,TASImage classes
That allows to create TGPicture not only from XPM files but
also from png, jpg, gif, tiff files.
An example, of usage:
TImage *img = TImage::Open("rose512.jpg");
const TGPicture *pic = img->GetPicture();
TGPictureButton *btn = new TGPictureButton(parent, pic)
- TGPicturePool::GetPicture(const char *name, Pixmap_t pxmap) added
That allows to create TGPicture from given pixmap. For example, that will allow,
to create TGPicture from TPad.
- TGPicturePool::GetPicture(const char *name) return picture for supported
image formats xpm, png, jpg, gif, tiff
Now it's possible to create TGPictureButton, TGImageMap from files of these formats.
- default ROOT browser actions changed for png, jpg, gif, tiff files. That allows
to browse these file with TBrowser
Revision
7755 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 15 08:54:29 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 11778 byte(s)
Diff to
previous 6663
From Valeriy Onuchin
- few improvements from my todo list:
o TGButton, TGLabel
SetTextColor, SetFont methods added.
Font, color can be changed globally (for every frame of some type),
or locally (for some particular frame) - default option
o TGNumberEntry
Accelerate the speed for changing numbers when button is
permanently pressed
o TGPicture (inspired by Ilka's recent changes)
for picture specified by file name mods added:
pname = gSystem->ExpandPathName(gSystem->UnixPathName(pname.Data()));
o TGResourcePool
add current directory to the icon_path for WIN32GDK
o cosmetic changes in WorldMap.C example
This tutorial is now working under win32gdk
o TGWin32, TGWin32ProxyBase
Anather try to fix a problem reported by Ed Oltman recently
Revision
6663 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 28 11:55:32 2003 UTC (11 years, 8 months ago) by
rdm
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 11456 byte(s)
Diff to
previous 3317
major changes in the resource management of the GUI classes. Introduced the
new class TGResourcePool which loads and keeps track of the 3 main resource
pools: fonts, picture and graphics contexts. Fonts are now handled via the
new TGFont class (and TGFontPool). In the past the loading of these resources
was done in TGClient and required all GUI classes to have TGClient as friend
to have their global statics initialized by TGClient. Adding a new widget
required TGClient.cxx to be changed too. This was obviously not good.
In addition it is now possible to find the full definition of the original
resource back based on a resource handle (GContext_t or FontStruct_t yielding
a TGGC or TGFont) which is needed for the SavePrimitive() functionality.
The resource pool can be found via TGClient (e.g. gClient->GetResourcePool()).
To see all active graphics contexts, fonts and pictures do:
gClient->GetResourcePool()->GetGCPool()->Print()
gClient->GetResourcePool()->GetFontPool()->Print()
gClient->GetResourcePool()->GetPicturePool()->Print()
For more examples see the widget source code.
These changes are largely backward compatible except maybe for some low
level 3rd party widgets that use some TGFrame internals. In these cases
the following sed command will patch the code:
sed -e "s/fgBlackGC()/GetBlackGC()()/g" \
-e "s/fgWhiteGC()/GetWhiteGC()()/g" \
-e "s/fgHilightGC()/GetHilightGC()()/g" \
-e "s/fgShadowGC()/GetShadowGC()()/g" \
-e "s/fgBckgndGC()/GetBckgndGC()()/g" \
widget.cxx > widget.cxx.new
Revision
685 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 29 08:57:05 2000 UTC (14 years, 3 months ago) by
rdm
Original Path:
trunk/gui/src/TGPicture.cxx
File length: 9990 byte(s)
Diff to
previous 3
many change connected with the introduction of the TGGC (graphics context)
class (all backward compatible). Also many of the static default GC's and
fontstructs are now available to the user. This can simplify code in many
places. See change in guitest.cxx.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.