renaming XUL Box layout methods

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

renaming XUL Box layout methods

L. David Baron
There are a number of XUL Box layout methods that were moved to
nsIFrame.  In a previous discussion about names, we came to the
conclusion that renaming these to have "XUL" in the name would
reduce confusion, especially in cases where there is an analogous
non-XUL method also on nsIFrame.

So I propose renaming the following methods:

  bool IsBoxFrame() const
  bool IsBoxWrapped() const
  nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState)
  nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
  nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState)
  nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState)
  uint32_t GetOrdinal()
  nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState)
  nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState)
  bool IsCollapsed()
  void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                 bool aRemoveOverflowAreas = false)
  nsresult Layout(nsBoxLayoutState& aBoxLayoutState)
  nsIFrame* GetChildBox() const
  nsIFrame* GetNextBox() const
  nsIFrame* GetParentBox() const
  nsresult GetBorderAndPadding(nsMargin& aBorderAndPadding)
  nsresult GetBorder(nsMargin& aBorder)
  nsresult GetPadding(nsMargin& aBorderAndPadding)
  nsresult GetMargin(nsMargin& aMargin)
  void SetLayoutManager(nsBoxLayout* aLayout)
  nsBoxLayout* GetLayoutManager()
  void SetLayoutManager(nsBoxLayout* aLayout)
  nsBoxLayout* GetLayoutManager()
  nsresult GetClientRect(nsRect& aContentRect)
  Valignment GetVAlign() const
  Halignment GetHAlign() const
  bool IsHorizontal() const
  bool IsNormalDirection() const
  nsresult Redraw(nsBoxLayoutState& aState)
  nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)
  bool GetMouseThrough() const
#ifdef DEBUG_LAYOUT
  nsresult SetDebug(nsBoxLayoutState& aState, bool aDebug)
  nsresult GetDebug(bool& aDebug)
  nsresult DumpBox(FILE* out)
#endif

by inserting the word XUL in the following ways:

  IsXULBoxFrame
  IsXULBoxWrapped
  GetXULMinSize
  GetXULPrefSize
  GetXULMaxSize
  GetXULMinSizeForScrollArea
  GetXULOrdinal
  GetXULFlex
  GetXULBoxAscent
  XULIsCollapsed
  XULSetBounds
  XULLayout
  GetChildXULBox
  GetNextXULBox
  GetParentXULBox
  GetXULBorderAndPadding
  GetXULBorder
  GetXULPadding
  GetXULMargin
  SetXULLayoutManager
  GetXULLayoutManager
  SetXULLayoutManager
  GetXULLayoutManager
  GetXULClientRect
  GetXULVAlign
  GetXULHAlign
  IsXULHorizontal
  IsXULNormalDirection
  XULRedraw
  XULRelayoutChildAtOrdinal
  GetXULMouseThrough
#ifdef DEBUG_LAYOUT
  SetXULDebug
  GetXULDebug
  XULDumpBox
#endif

Does this seem reasonable?

-David

--
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: renaming XUL Box layout methods

Cameron McCormack-4
L. David Baron wrote:
> There are a number of XUL Box layout methods that were moved to
> nsIFrame.  In a previous discussion about names, we came to the
> conclusion that renaming these to have "XUL" in the name would
> reduce confusion, especially in cases where there is an analogous
> non-XUL method also on nsIFrame.
>
> So I propose renaming the following methods:

Making it obvious they're XUL layout things makes sense to me.  Although
why XULIsCollapsed but IsXULHorizontal?

Also is it possible to push any of these methods down to nsBox/nsBoxFrame?
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: renaming XUL Box layout methods

L. David Baron
On Wednesday 2014-02-05 09:32 +1100, Cameron McCormack wrote:

> L. David Baron wrote:
> >There are a number of XUL Box layout methods that were moved to
> >nsIFrame.  In a previous discussion about names, we came to the
> >conclusion that renaming these to have "XUL" in the name would
> >reduce confusion, especially in cases where there is an analogous
> >non-XUL method also on nsIFrame.
> >
> >So I propose renaming the following methods:
>
> Making it obvious they're XUL layout things makes sense to me.
> Although why XULIsCollapsed but IsXULHorizontal?
Yeah, should probably be IsXULCollapsed.

> Also is it possible to push any of these methods down to nsBox/nsBoxFrame?

Maybe, but I suspect not easily (at least for many of them).  It's
certainly a lot easier to rename them.

-David

--
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: renaming XUL Box layout methods

Robert O'Callahan-3
In reply to this post by L. David Baron
Yes!

Rob
--
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: renaming XUL Box layout methods

Boris Zbarsky
In reply to this post by L. David Baron
On 2/4/14 4:57 PM, L. David Baron wrote:
> Does this seem reasonable?

Absolutely.

-Boris

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout