[root] / trunk / gui / gui / src / TGFont.cxx Repository:
ViewVC logotype

Log of /trunk/gui/gui/src/TGFont.cxx

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 44507 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by axel
File length: 85541 byte(s)
Diff to previous 44151
Remove
  using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.

Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.

Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.

Revision 44151 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 7 10:05:38 2012 UTC (2 years, 8 months ago) by tpochep
File length: 85516 byte(s)
Diff to previous 43085
Funny enough: GUI can give me '*' as a font's foundry, but if I RETURN '*' as a foundry,
it crashes - parses this XLFD, sets foundry to 0 and later use strcasecmp on this pointer.
1. 'Fix' TGFontPool not to use 0 pointers,
2. return fake foundry.

Revision 43085 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 22 13:41:13 2012 UTC (2 years, 11 months ago) by rdm
File length: 85499 byte(s)
Diff to previous 42641
another strlcpy warning fix.

Revision 42641 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 16 09:06:00 2012 UTC (3 years ago) by bellenot
File length: 85480 byte(s)
Diff to previous 42612
Try to silent coverity reports about dereference null return (stat)

Revision 42612 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 13 13:24:18 2012 UTC (3 years ago) by bellenot
File length: 85419 byte(s)
Diff to previous 38465
Fix coverity #35991 (dereference null return value)

Revision 38465 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 17 09:11:17 2011 UTC (3 years, 10 months ago) by bellenot
File length: 85336 byte(s)
Diff to previous 38458
Add comments to explain why we ignore the mixed enums coverity reports

Revision 38458 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 14:39:48 2011 UTC (3 years, 10 months ago) by bellenot
File length: 85191 byte(s)
Diff to previous 38437
Ignore several secure coding reports (coverity) until proper solution is found

Revision 38437 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 10:24:42 2011 UTC (3 years, 10 months ago) by bellenot
File length: 85149 byte(s)
Diff to previous 35622
Ignore coverity report about mixing enums

Revision 35622 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 23 08:29:15 2010 UTC (4 years, 4 months ago) by bellenot
File length: 85085 byte(s)
Diff to previous 35518
Replace sprintf and strcpy by snprintf and strlcpy (coverity)

Revision 35518 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 21 09:54:10 2010 UTC (4 years, 4 months ago) by bellenot
File length: 85080 byte(s)
Diff to previous 34286
Replace several strncpy and strncat by strlcpy and strlcat

Revision 34286 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 1 20:38:57 2010 UTC (4 years, 6 months ago) by rdm
File length: 85090 byte(s)
Diff to previous 33967
fix format errors related to TString::Form(), TString::Format(), Form()
and Printf().

Revision 33967 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 17 14:04:54 2010 UTC (4 years, 7 months ago) by bellenot
File length: 85095 byte(s)
Diff to previous 33963
Properly set the last character to 0

Revision 33963 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 17 13:02:58 2010 UTC (4 years, 7 months ago) by bellenot
File length: 85067 byte(s)
Diff to previous 33880
- Remove a debug printf() statement
- Replace several Form() by TString::Format()

Revision 33880 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 14 13:47:40 2010 UTC (4 years, 7 months ago) by bellenot
File length: 85017 byte(s)
Diff to previous 31994
Use snprintf and strncpy to avoid potential buffer overflows (coverity)

Revision 31994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 12 15:57:47 2010 UTC (5 years ago) by bellenot
File length: 85000 byte(s)
Diff to previous 31663
Skip some characters causing problems with newer versions of libfreetype. These are extended ASCII characters and not used in the GUI anyway.
This should solve the bug #58945: Fatal crash when enabling Xft (font smoothing) on some newer distributions

Revision 31663 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 8 14:51:42 2009 UTC (5 years, 1 month ago) by bellenot
File length: 84962 byte(s)
Diff to previous 27475
- Add members initialization (coverity)
- Fix potential memory leaks (coverity)
- Add protections against possible NULL pointers (coverity)

Revision 27475 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 18 10:04:21 2009 UTC (5 years, 11 months ago) by bellenot
File length: 84954 byte(s)
Diff to previous 23115
Replace Form() by TString::Format()

Revision 23115 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 10 13:35:37 2008 UTC (6 years, 9 months ago) by rdm
File length: 84943 byte(s)
Copied from: trunk/gui/src/TGFont.cxx revision 23114
Diff to previous 22419
moved to directory "gui" the following directories:

fitpanel, ged, gui, guibuilder, guihtml, qtgsi, qtroot, sessionviewer

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/TGFont.cxx
File length: 84943 byte(s)
Diff to previous 21105
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 21105 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 29 10:30:07 2007 UTC (7 years, 1 month ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 84903 byte(s)
Diff to previous 20882
From Bertrand:
This patch solve the problem reported at:
https://savannah.cern.ch/bugs/?31673

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 85249 byte(s)
Diff to previous 20765
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 20765 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 12 13:44:33 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 85249 byte(s)
Diff to previous 19826
From Ilka:
remove warnings converning conversion from const char* to char*.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 85183 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 85231 byte(s)
Diff to previous 19699
remove :$ from tag line

Revision 19699 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 27 14:47:42 2007 UTC (7 years, 4 months ago) by antcheva
Original Path: trunk/gui/src/TGFont.cxx
File length: 85241 byte(s)
Diff to previous 19263
From Valeriy Onuchin:
Added comment. Cosmetics.

Revision 19263 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 5 13:29:55 2007 UTC (7 years, 6 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 84993 byte(s)
Diff to previous 18678
From Ilka:
Fixed warnings reported at URL: <http://savannah.cern.ch/bugs/?27651>.

Revision 18678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun May 6 08:04:39 2007 UTC (7 years, 8 months ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 85149 byte(s)
Diff to previous 18670
Fix coding conventions

Revision 18670 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 4 20:41:03 2007 UTC (7 years, 8 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 85116 byte(s)
Diff to previous 18661
remove tons of tabs and fix indentation.

Revision 18661 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 4 15:46:33 2007 UTC (7 years, 8 months ago) by antcheva
Original Path: trunk/gui/src/TGFont.cxx
File length: 84676 byte(s)
Diff to previous 18660
Changed name of getToken to GetToken

Revision 18660 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 4 15:39:12 2007 UTC (7 years, 8 months ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 84680 byte(s)
Diff to previous 18657
Fix a compiler Warning (could be an error) in TGFont::ComputeTextLayout.
The variable y was not always initialized.

Revision 18657 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 4 15:18:08 2007 UTC (7 years, 8 months ago) by antcheva
Original Path: trunk/gui/src/TGFont.cxx
File length: 84674 byte(s)
Diff to previous 15672
From Valeriy Onuchin:
Changes in font handling connected with html widget development and allows to find  the best matching font specified by family, point size, weight, slant. They include:

- new structure describing font  attributes
struct FontAttributes_t {

   const char *fFamily; // Font family. The most important field.
   Int_t fPointsize;    // Pointsize of font, 0 for default size,
                        // or negative number meaning pixel size.
   Int_t fWeight;       // Weight flag
   Int_t fSlant;        // Slant flag
   Int_t fUnderline;    // Non-zero for underline font.
   Int_t fOverstrike;   // Non-zero for overstrike font.
};

- new class TGTextLayout is used to keep track of  string
measurement information.

- new TGFont methods (see descriptions in the source):
Int_t  TextWidth(const char *string, Int_t numChars = -1) const;
Int_t  XTextWidth(const char *string, Int_t numChars = -1) const;
Int_t  TextHeight() const { return fFM.fLinespace; }
void   UnderlineChars(Drawable_t dst, GContext_t gc,
                      const char *string, Int_t x, Int_t y,
                      Int_t firstChar, Int_t lastChar) const;
TGTextLayout *ComputeTextLayout(const char *string, Int_t numChars,
                                Int_t wrapLength, Int_t justify,
                                Int_t flags, UInt_t *width,
                                UInt_t *height) const;
Int_t  MeasureChars(const char *source, Int_t numChars, Int_t maxLength,
                    Int_t flags, Int_t *length) const;
void   DrawCharsExp(Drawable_t dst, GContext_t gc, const char *source,
                    Int_t numChars, Int_t x, Int_t y) const;
void   DrawChars(Drawable_t dst, GContext_t gc, const char *source,
                 Int_t numChars, Int_t x, Int_t y) const;

Revision 15672 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 3 16:10:46 2006 UTC (8 years, 6 months ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 7261 byte(s)
Diff to previous 15191
from Axel:
Change the signature of SavePrimitive from

  void SavePrimitive(ofstream &out, Option_t *option);
to
  void SavePrimitive(ostream &out, Option_t *option = "");

With this change one can do, eg
   myhist.SavePrimitive(std::cout);

WARNING: do rm -f tree/src/*.o

Revision 15191 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun May 28 20:08:00 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 7252 byte(s)
Diff to previous 13278
From valeriy Onuchine:

- TImage, TASImage
 o Change return type of Vectorize method  from "void" to "Double_t*".
 o Implement FromWindow method under X11. This method allows to
   create "snapshot image" from any ROOT window or frame.

- config/Makefile.depend
 Add dependency of libGuiBld lib on libGraf.
 GuiBuilder uses internally TImage/TASImage class.

- GX11Gui.cxx

 X11 error handler was slightly modified.
 Many X11 errors lead to freezing X11 server and
 did not allow debugging.
 To prevent freezing, a "forced seg.violation" was added
 to the error handler.

 The usage of the new "feature" is the following:
 0. run "gdb root.exe"
 1. set "gDebug = (int)gVirtualX" - that activates the new error handling.
 2. run application which has X11 errors.

On X11 error the application was stopped by the "forced seg.violation".

 3. "gdb>bt" - backtrace the problem.



!!! A big list of changes in libGui initiated by gui builder development !!!

- TGButton.h, TGButton.cxx
  TGButton class:
   o SetDown methods removed from context menu.
   o SetEnabled method of context menu changed to TOGGLE.
     Setting fWidgetFlags was added.

- TGTextButton class
   o GetNormGC(), GetFontStruct() methods are introduced.
   o SetFont removed from context menu.
   o ChangeText(const char *title) was introduced and added to context menu.
   o fixed an error in SetFont method which set font globally instead of
     locally.
   o SavePrimitive - save text justification

- TGPictureButton
   o added getter method GetDisabledPicture()

- TGCanvas
   o added to GuiBuilder widgets palette.

- TGColorDialog
   o new methods:
     - TGColorPalette *GetPalette(),
     - TGColorPalette *GetCustomPalette(),
     - void SetCurrentColor(Pixel_t col)
   o new signal:
      - void ColorSelected(Pixel_t)
   o new parameter added to contructor "Bool_t wait".
     If "wait" is kTRUE, "gClient->WaitForUnmap" is called internally
     (normal/old usage). If "wait" is kFALSE - "gClient->WaitForUnmap"
     should be called by user.
   o few "usefull" colors added to "custom" palette.

- TGColorSelect
   o added to GuiBuilder widgets palette.

- TGComboBox
   o new methods:
     - SortByName - allows to sort combobox entries by names.
     - SetEnabled, IsEnabled.

- TGFontDialog was rewritten.
   o Previous version worked under win32 only,
      now it works on X11 also.
      It allows to select any font available on the system.

  o new parameter added to contructor "Bool_t wait".
     If "wait" is kTRUE, "gClient->WaitForUnmap" is called internally
     (normal/old usage). If "wait" is kFALSE - "gClient->WaitForUnmap"
     should be called by user.

  o new methods:
      void SetFont(TGFont *font);
      void SetColor(Pixel_t color);
      void SetAlign(Int_t align);
      void EnableAlign(Bool_t on = kTRUE);
      void UpdateStyleSize(const char *family);

 o new signals:
   - FontSelected(char *font)
   - AlignSelected(Int_t a)
   - ColorSelected(Pixel_t c)

- TGFrame
   o unused static member fgContextMenu removed.

- TGCompositeFrame
   o TGCompositeFrame::SetEditDisabled modified. It is used for setting
     fEditDisableXX attribute during gui buildind.

   o ChangeSubframesBackground helper method was introduced.

- TGGroupFrame
   o SetTextFont, SetTextColor methods were corrected for
     "local" changing of the font.

- TGWindow
   o kEditDisableKeyEnable added to EEditMode enum.
     If this flag is set - window can handle keyboard events during gui
     building.

- TGLabel
   o new methods:
    - GetNormGC, GetFontStruct
   o fixed bugs in setting label's "local" text font.
   o SavePrimitive - saving text justification added.

- TGListBox
  o new methods:
     - SortByName - allow to sort listbox entries by names.
     - new auxilary/internal class TGLBFrameElement created.
        It's used for ascending/descending sort of list box entries.

  o reimplemented methods:
   ChangeBackground, Layout, GetDefaultWidth

  o disable changing layout manager in SetLayoutManager method.
    Layout manager is not used for layout of list box.

- TGIcon
   o SetImagePath method was corrected.

- TGScrollBarElement
   o new methods:
     - SetEnabled, IsEnabled. These methods are used in enabling/disabling
       TGNumberEntry objects.

- TGScrollBar
   o new getter methods:
      - GetHead, GetTail, GetSlider
   o new signals:
      - PositionChanged, RangeChanged, PageSizeChanged
   o ChangeBackground was reimplemented.

- TGShutter
   o new methods:
      - AddPage, RemovePage, RenamePage
   o new signal Selected.
   o disable changing layout manager in SetLayoutManager method.
     Layout manager is not used for layout.

- TGView
   o disable changing layout manager by SetLayoutManager method.
     Layout manager is not used for layout.
   o ChangeBackground(Pixel_t col) method added which changes background
     color only of the canvas frame.

- TGNumberEntry
   o more options added to context menu.

- TGProgressBar
   o new getter/setter methods:
    - GetBarColor, GetNormGC, GetFontStruct, SetForegroundColor.

- TGTab
   o disable SetEditDisabled method to avoid changing "edit disable
     attribute".

- TGTextEdit, TGTextView, TGView
   o fixed bug - "character replace" mode didn't work
   o setting insert mode added to context menu.
   o setting "read only" mode added to context menu.
   o new method which enable/disable "popup menu for edit actions" added.
   o few corrections to SavePrimitive method.

- TGTextEntry
   o guibuilder specific code was removed.

-  TGuiBuilder.h, TGuiBldAction
   o possibility to set picture for context menu entry added.

- treeviewer/inc/TSessionViewer.h
  o forward declaration of TContextMenu class added.

Revision 13278 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 17 19:09:28 2005 UTC (9 years, 2 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 7252 byte(s)
Diff to previous 9932
From Ilka:
code style fixes (comments, descriptions and identation).

Revision 9932 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 7 08:13:56 2004 UTC (10 years, 4 months ago) by brun
Original Path: trunk/gui/src/TGFont.cxx
File length: 7252 byte(s)
Diff to previous 8546
From Valeriy Onuchin:
- new  method TGFont *TGFontPool::GetFont(FontStruct_t fs)  added

Revision 8546 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 6 21:12:24 2004 UTC (10 years, 9 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 6517 byte(s)
Diff to previous 7520
added extra argument to GetFont() and GetFontByName() to not load the
"fixed" font by default if the requested font cannot be loaded.

Revision 7520 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 5 13:08:26 2003 UTC (11 years, 2 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 6352 byte(s)
Diff to previous 6663
From Ilka:
Any ROOT GUI can now be saved as a macro. Executing this macro brings back
the current GUI (minus the action handling). This very important development
allows to get easily the source for any GUI, which can then be inspected or
used to create other GUI's. Also this will allow a GUI builder to save and
restore GUI's.

To save the source of a GUI use the methods TGMainFrame::SaveSource() or
TGTransientFrame::SaveSource(), where the latter saves the source for dialogs.

To trigger the saving of any GUI just use ctrl-s.

Revision 6663 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed May 28 11:55:32 2003 UTC (11 years, 8 months ago) by rdm
Original Path: trunk/gui/src/TGFont.cxx
File length: 5691 byte(s)
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

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.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9