The Great XCB Renaming
authorJosh Triplett <josh@freedesktop.org>
Sat, 23 Sep 2006 19:22:22 +0000 (12:22 -0700)
committerJosh Triplett <josh@freedesktop.org>
Sat, 23 Sep 2006 19:22:22 +0000 (12:22 -0700)
Rename API to follow a new naming convention:
* XCB_CONSTANTS_UPPERCASE_WITH_UNDERSCORES
* xcb_functions_lowercase_with_underscores
* xcb_types_lowercase_with_underscores_and_suffix_t
* expand all abbreviations like "req", "rep", and "iter"

Word boundaries for the names in the protocol descriptions fall:
* Wherever the protocol descriptions already have an underscore
* Between a lowercase letter and a subsequent uppercase letter
* Before the last uppercase letter in a string of uppercase letters followed
  by a lowercase letter (such as in LSBFirst between LSB and First)
* Before and after a string of digits (with exceptions for sized types like
  xcb_char2b_t and xcb_glx_float32_t to match the stdint.h convention)

Also fix up some particular naming issues:
* Rename shape_op and shape_kind to drop the "shape_" prefix, since otherwise
  these types end up as xcb_shape_shape_{op,kind}_t.
* Remove leading underscores from enums in the GLX protocol description,
  previously needed to ensure a word separator, but now redundant.

This renaming breaks code written for the previous API naming convention.  The
scripts in XCB's tools directory will convert code written for the old API to
use the new API; they work well enough that we used them to convert the
non-program-generated code in XCB, and when run on the old program-generated
code, they almost exactly reproduce the new program-generated code (modulo
whitespace and bugs in the old code generator).

Authors: Vincent Torri, Thomas Hunger, Josh Triplett

src/extensions/glx.xml
src/extensions/shape.xml
src/extensions/xfixes.xml

index 2e22c77..ba5c253 100644 (file)
@@ -198,27 +198,27 @@ The patch that fixed this server bug in X.org CVS is here:
 
        <!-- Enum for CopyContext: mask -->
        <enum name="GC">
-               <item name="_GL_CURRENT_BIT"><value>0x00000001</value></item>
-               <item name="_GL_POINT_BIT"><value>0x00000002</value></item>
-               <item name="_GL_LINE_BIT"><value>0x00000004</value></item>
-               <item name="_GL_POLYGON_BIT"><value>0x00000008</value></item>
-               <item name="_GL_POLYGON_STIPPLE_BIT"><value>0x00000010</value></item>
-               <item name="_GL_PIXEL_MODE_BIT"><value>0x00000020</value></item>
-               <item name="_GL_LIGHTING_BIT"><value>0x00000040</value></item>
-               <item name="_GL_FOG_BIT"><value>0x00000080</value></item>
-               <item name="_GL_DEPTH_BUFFER_BIT"><value>0x00000100</value></item>
-               <item name="_GL_ACCUM_BUFFER_BIT"><value>0x00000200</value></item>
-               <item name="_GL_STENCIL_BUFFER_BIT"><value>0x00000400</value></item>
-               <item name="_GL_VIEWPORT_BIT"><value>0x00000800</value></item>
-               <item name="_GL_TRANSFORM_BIT"><value>0x00001000</value></item>
-               <item name="_GL_ENABLE_BIT"><value>0x00002000</value></item>
-               <item name="_GL_COLOR_BUFFER_BIT"><value>0x00004000</value></item>
-               <item name="_GL_HINT_BIT"><value>0x00008000</value></item>
-               <item name="_GL_EVAL_BIT"><value>0x00010000</value></item>
-               <item name="_GL_LIST_BIT"><value>0x00020000</value></item>
-               <item name="_GL_TEXTURE_BIT"><value>0x00040000</value></item>
-               <item name="_GL_SCISSOR_BIT"><value>0x00080000</value></item>
-               <item name="_GL_ALL_ATTRIB_BITS"><value>0x000ffffff</value></item>
+               <item name="GL_CURRENT_BIT"><value>0x00000001</value></item>
+               <item name="GL_POINT_BIT"><value>0x00000002</value></item>
+               <item name="GL_LINE_BIT"><value>0x00000004</value></item>
+               <item name="GL_POLYGON_BIT"><value>0x00000008</value></item>
+               <item name="GL_POLYGON_STIPPLE_BIT"><value>0x00000010</value></item>
+               <item name="GL_PIXEL_MODE_BIT"><value>0x00000020</value></item>
+               <item name="GL_LIGHTING_BIT"><value>0x00000040</value></item>
+               <item name="GL_FOG_BIT"><value>0x00000080</value></item>
+               <item name="GL_DEPTH_BUFFER_BIT"><value>0x00000100</value></item>
+               <item name="GL_ACCUM_BUFFER_BIT"><value>0x00000200</value></item>
+               <item name="GL_STENCIL_BUFFER_BIT"><value>0x00000400</value></item>
+               <item name="GL_VIEWPORT_BIT"><value>0x00000800</value></item>
+               <item name="GL_TRANSFORM_BIT"><value>0x00001000</value></item>
+               <item name="GL_ENABLE_BIT"><value>0x00002000</value></item>
+               <item name="GL_COLOR_BUFFER_BIT"><value>0x00004000</value></item>
+               <item name="GL_HINT_BIT"><value>0x00008000</value></item>
+               <item name="GL_EVAL_BIT"><value>0x00010000</value></item>
+               <item name="GL_LIST_BIT"><value>0x00020000</value></item>
+               <item name="GL_TEXTURE_BIT"><value>0x00040000</value></item>
+               <item name="GL_SCISSOR_BIT"><value>0x00080000</value></item>
+               <item name="GL_ALL_ATTRIB_BITS"><value>0x000ffffff</value></item>
        </enum>
 
        <request name="SwapBuffers" opcode="11">
@@ -491,9 +491,9 @@ The patch that fixed this server bug in X.org CVS is here:
        </request>
 
        <enum name="RM">
-               <item name="_GL_RENDER"><value>0x1C00</value></item>
-               <item name="_GL_FEEDBACK"><value>0x1C01</value></item>
-               <item name="_GL_SELECT"><value>0x1C02</value></item>
+               <item name="GL_RENDER"><value>0x1C00</value></item>
+               <item name="GL_FEEDBACK"><value>0x1C01</value></item>
+               <item name="GL_SELECT"><value>0x1C02</value></item>
        </enum>
 
        <request name="Finish" opcode="108">
index 36fb84b..8afbff7 100644 (file)
@@ -27,10 +27,10 @@ authorization from the authors.
 -->
 <!-- This file describes version 1.1 of the Shape extension. -->
 <xcb header="shape" extension-xname="SHAPE" extension-name="Shape">
-  <typedef oldname="CARD8" newname="SHAPE_OP" />
-  <typedef oldname="CARD8" newname="SHAPE_KIND" />
+  <typedef oldname="CARD8" newname="OP" />
+  <typedef oldname="CARD8" newname="KIND" />
 
-  <!-- Shape attributes of type SHAPE_OP. -->
+  <!-- Shape attributes of type OP. -->
   <enum name="SO">
     <item name="Set" />
     <item name="Union" />
@@ -39,7 +39,7 @@ authorization from the authors.
     <item name="Invert" />
   </enum>
 
-  <!-- Shape attributes of type SHAPE_KIND. -->
+  <!-- Shape attributes of type KIND. -->
   <enum name="SK">
     <item name="Bounding" />
     <item name="Clip" />
@@ -47,7 +47,7 @@ authorization from the authors.
   </enum>
 
   <event name="Notify" number="0">
-    <field type="SHAPE_KIND" name="shape_kind" />
+    <field type="KIND" name="shape_kind" />
     <field type="WINDOW" name="affected_window" />
     <field type="INT16" name="extents_x" />
     <field type="INT16" name="extents_y" />
@@ -66,8 +66,8 @@ authorization from the authors.
   </request>
 
   <request name="Rectangles" opcode="1">
-    <field type="SHAPE_OP" name="operation" />
-    <field type="SHAPE_KIND" name="destination_kind" />
+    <field type="OP" name="operation" />
+    <field type="KIND" name="destination_kind" />
     <field type="BYTE" name="ordering" />
     <pad bytes="1" />
     <field type="WINDOW" name="destination_window" />
@@ -77,8 +77,8 @@ authorization from the authors.
   </request>
 
   <request name="Mask" opcode="2">
-    <field type="SHAPE_OP" name="operation" />
-    <field type="SHAPE_KIND" name="destination_kind" />
+    <field type="OP" name="operation" />
+    <field type="KIND" name="destination_kind" />
     <pad bytes="2" />
     <field type="WINDOW" name="destination_window" />
     <field type="INT16" name="x_offset" />
@@ -87,9 +87,9 @@ authorization from the authors.
   </request>
 
   <request name="Combine" opcode="3">
-    <field type="SHAPE_OP" name="operation" />
-    <field type="SHAPE_KIND" name="destination_kind" />
-    <field type="SHAPE_KIND" name="source_kind" />
+    <field type="OP" name="operation" />
+    <field type="KIND" name="destination_kind" />
+    <field type="KIND" name="source_kind" />
     <pad bytes="1" />
     <field type="WINDOW" name="destination_window" />
     <field type="INT16" name="x_offset" />
@@ -98,7 +98,7 @@ authorization from the authors.
   </request>
 
   <request name="Offset" opcode="4">
-    <field type="SHAPE_KIND" name="destination_kind" />
+    <field type="KIND" name="destination_kind" />
     <pad bytes="3" />
     <field type="WINDOW" name="destination_window" />
     <field type="INT16" name="x_offset" />
@@ -137,7 +137,7 @@ authorization from the authors.
 
   <request name="GetRectangles" opcode="8">
     <field type="WINDOW" name="window" />
-    <field type="SHAPE_KIND" name="source_kind" />
+    <field type="KIND" name="source_kind" />
     <reply>
       <field type="BYTE" name="ordering" />
       <field type="CARD32" name="rectangles_len" />
index b82c63b..9bd14e3 100644 (file)
@@ -153,7 +153,7 @@ authorization from the authors.
   <request name="CreateRegionFromWindow" opcode="7">
     <field type="REGION"     name="region" />
     <field type="WINDOW"     name="window" />
-    <field type="SHAPE_KIND" name="kind" />
+    <field type="shape:KIND" name="kind" />
     <pad bytes="3" />
   </request>
 
@@ -235,7 +235,7 @@ authorization from the authors.
 
   <request name="SetWindowShapeRegion" opcode="21">
     <field type="WINDOW"     name="dest" />
-    <field type="SHAPE_KIND" name="dest_kind" />
+    <field type="shape:KIND" name="dest_kind" />
     <pad bytes="3" />
     <field type="INT16"      name="x_offset" />
     <field type="INT16"      name="y_offset" />