[haiku-bugs] Re: [Haiku] #5525: Implement archiving in layouting classes

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sat, 17 Jul 2010 00:09:57 -0000

#5525: Implement archiving in layouting classes
-------------------------------------+--------------------------------------
  Reporter:  mmadia                  |         Owner:  bonefish      
      Type:  enhancement             |        Status:  in-progress   
  Priority:  normal                  |     Milestone:                
 Component:  Kits/Interface Kit      |       Version:  R1/Development
Resolution:                          |      Keywords:                
Blocked By:  6256, 6257, 6302, 6314  |   Has a Patch:  1             
  Platform:  All                     |      Blocking:  5524          
-------------------------------------+--------------------------------------

Comment (by bonefish):

 BGridLayout patch applied in r37542. A comment:

 {{{
 @@ -21,11 +23,25 @@
         MAX_COLUMN_ROW_COUNT    = 1024,
  };

 -// a placeholder we put in our grid array to make a cell occupied
 -static BLayoutItem* const OCCUPIED_GRID_CELL = (BLayoutItem*)0x1;
 +namespace {
 +       // a placeholder we put in our grid array to make a cell occupied
 +       BLayoutItem* const OCCUPIED_GRID_CELL = (BLayoutItem*)0x1;

 +       const char* kRowCountField = "gridlayout:rowcount";
 +       const char* kRowMinSizeField = "gridlayout:rowminsize";
 +       const char* kRowMaxSizeField = "gridlayout:rowmaxsize";
 +       const char* kRowWeightField = "gridlayout:rowweight";
 +       const char* kColumnCountField = "gridlayout:columncount";
 +       const char* kColumnMinSizeField = "gridlayout:columnminsize";
 +       const char* kColumnMaxSizeField = "gridlayout:columnmaxsize";
 +       const char* kColumnWeightField = "gridlayout:columnweight";
 +       const char* kItemHeight = "gridlayout:item:height";
 +       const char* kItemWidth = "gridlayout:item:width";
 +       const char* kItemX = "gridlayout:item:x";
 +       const char* kItemY = "gridlayout:item:y";
 +}
 }}}

 For the last four constants you break the naming scheme, omitting the
 "Field" suffix. And BTW, for those to actually be constants their type
 would need to be `const char* const` -- not that this isn't a common
 mistake (... I'm sure I have often made in the past, too).

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5525#comment:14>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: