changeset 81:e10cbfc977d2

switch default cases
author Frank Benoit <benoit@tionex.de>
date Wed, 06 Feb 2008 15:12:11 +0100
parents 1801ddeb8f32
children 43c42c637c9c
files dwt/graphics/Device.d dwt/graphics/GC.d dwt/graphics/Image.d dwt/graphics/Pattern.d dwt/graphics/TextLayout.d
diffstat 5 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/graphics/Device.d	Wed Feb 06 12:09:44 2008 +0100
+++ b/dwt/graphics/Device.d	Wed Feb 06 15:12:11 2008 +0100
@@ -612,6 +612,7 @@
         case DWT.COLOR_DARK_CYAN:           pixel = 0x00808000;  break;
         case DWT.COLOR_GRAY:                pixel = 0x00C0C0C0;  break;
         case DWT.COLOR_DARK_GRAY:           pixel = 0x00808080;  break;
+        default:
     }
     return Color.win32_new (this, pixel);
 }
--- a/dwt/graphics/GC.d	Wed Feb 06 12:09:44 2008 +0100
+++ b/dwt/graphics/GC.d	Wed Feb 06 15:12:11 2008 +0100
@@ -228,6 +228,7 @@
                             if (brush is null) DWT.error(DWT.ERROR_NO_HANDLES);
                             Gdip.TextureBrush_ScaleTransform( cast(Gdip.TextureBrush) brush, -1, 1, Gdip.MatrixOrderPrepend);
                             data.gdipFgBrush = cast(Gdip.SolidBrush)brush;
+                        default:
                     }
                 }
             } else {
@@ -251,6 +252,7 @@
             switch (data.lineStyle) {
                 case DWT.LINE_CUSTOM:
                     state |= LINE_STYLE;
+                default:
             }
         }
         if ((state & LINE_STYLE) !is 0) {
@@ -274,6 +276,7 @@
                         }
                     }
                 }
+                default:
             }
             if (dashes !is null) {
                 Gdip.Pen_SetDashPattern(pen, dashes, dashes.length);
@@ -292,6 +295,7 @@
                 case DWT.JOIN_MITER: joinStyle = Gdip.LineJoinMiter; break;
                 case DWT.JOIN_BEVEL: joinStyle = Gdip.LineJoinBevel; break;
                 case DWT.JOIN_ROUND: joinStyle = Gdip.LineJoinRound; break;
+                default:
             }
             Gdip.Pen_SetLineJoin(pen, joinStyle);
         }
@@ -301,6 +305,7 @@
                 case DWT.CAP_FLAT: capStyle = Gdip.LineCapFlat; break;
                 case DWT.CAP_ROUND: capStyle = Gdip.LineCapRound; dashCap = Gdip.DashCapRound; break;
                 case DWT.CAP_SQUARE: capStyle = Gdip.LineCapSquare; break;
+                default:
             }
             Gdip.Pen_SetLineCap(pen, capStyle, capStyle, dashCap);
         }
@@ -318,6 +323,7 @@
                             Gdip.TextureBrush_ScaleTransform( cast(Gdip.TextureBrush)brush, -1, 1, Gdip.MatrixOrderPrepend);
                             data.gdipBrush = brush;
                             data.gdipBgBrush = cast(Gdip.SolidBrush) brush;
+                        default:
                     }
                 }
             } else {
@@ -381,6 +387,7 @@
                 }
                 break;
             }
+            default:
         }
         if ((state & LINE_STYLE) !is 0) {
             OS.SetBkMode(handle, data.lineStyle is DWT.LINE_SOLID ? OS.OPAQUE : OS.TRANSPARENT);
@@ -390,12 +397,14 @@
             case DWT.JOIN_MITER: joinStyle = OS.PS_JOIN_MITER; break;
             case DWT.JOIN_ROUND: joinStyle = OS.PS_JOIN_ROUND; break;
             case DWT.JOIN_BEVEL: joinStyle = OS.PS_JOIN_BEVEL; break;
+            default:
         }
         int capStyle = 0;
         switch (data.lineCap) {
             case DWT.CAP_ROUND: capStyle = OS.PS_ENDCAP_ROUND; break;
             case DWT.CAP_FLAT: capStyle = OS.PS_ENDCAP_FLAT; break;
             case DWT.CAP_SQUARE: capStyle = OS.PS_ENDCAP_SQUARE;break;
+            default:
         }
         int style = lineStyle | joinStyle | capStyle;
         /*
@@ -619,6 +628,7 @@
         case Gdip.BrushTypeTextureFill:
             Gdip.TextureBrush_delete(cast(Gdip.TextureBrush)brush);
             break;
+        default:
     }
 }
 
@@ -1007,6 +1017,7 @@
         case DWT.ICON:
             drawIcon(srcImage, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, simple);
             break;
+        default:
     }
 }
 
@@ -1564,6 +1575,7 @@
                 transGreen = (pixel & 0xFF0000) >> 16;
                 transRed = (pixel & 0xFF00) >> 8;
                 break;
+            default:
         }
     }
 
@@ -2139,6 +2151,7 @@
                     Gdip.TextureBrush_ScaleTransform(cast(Gdip.TextureBrush)brush, -1, 1, Gdip.MatrixOrderPrepend);
                     Gdip.TextureBrush_TranslateTransform(cast(Gdip.TextureBrush)brush, - 2 * x, 0, Gdip.MatrixOrderPrepend);
                     break;
+                default:
             }
             gstate = Gdip.Graphics_Save(gdipGraphics);
             Gdip.Graphics_ScaleTransform(gdipGraphics, -1, 1, Gdip.MatrixOrderPrepend);
@@ -2155,6 +2168,7 @@
                 case Gdip.BrushTypeTextureFill:
                     Gdip.TextureBrush_ResetTransform(cast(Gdip.TextureBrush)brush);
                     break;
+                default:
             }
             Gdip.Graphics_Restore(gdipGraphics, gstate);
         }
@@ -2337,6 +2351,7 @@
                     Gdip.TextureBrush_ScaleTransform(cast(Gdip.TextureBrush)brush, -1, 1, Gdip.MatrixOrderPrepend);
                     Gdip.TextureBrush_TranslateTransform(cast(Gdip.TextureBrush)brush, - 2 * x, 0, Gdip.MatrixOrderPrepend);
                     break;
+                default:
             }
             gstate = Gdip.Graphics_Save(gdipGraphics);
             Gdip.Graphics_ScaleTransform(gdipGraphics, -1, 1, Gdip.MatrixOrderPrepend);
@@ -2353,6 +2368,7 @@
                 case Gdip.BrushTypeTextureFill:
                     Gdip.TextureBrush_ResetTransform(cast(Gdip.TextureBrush)brush);
                     break;
+                default:
             }
             Gdip.Graphics_Restore(gdipGraphics, gstate);
         }
@@ -3030,6 +3046,7 @@
         case Gdip.SmoothingModeAntiAlias:
         case Gdip.SmoothingModeAntiAlias8x8:
         case Gdip.SmoothingModeHighQuality: return DWT.ON;
+        default:
     }
     return DWT.DEFAULT;
 }
@@ -3372,6 +3389,7 @@
         case Gdip.InterpolationModeHighQualityBilinear:
         case Gdip.InterpolationModeHighQualityBicubic:
         case Gdip.InterpolationModeHighQuality: return DWT.HIGH;
+        default:
     }
     return DWT.DEFAULT;
 }
@@ -3539,6 +3557,7 @@
         case Gdip.TextRenderingHintAntiAlias:
         case Gdip.TextRenderingHintAntiAliasGridFit:
         case Gdip.TextRenderingHintClearTypeGridFit: return DWT.ON;
+        default:
     }
     return DWT.DEFAULT;
 }
--- a/dwt/graphics/Image.d	Wed Feb 06 12:09:44 2008 +0100
+++ b/dwt/graphics/Image.d	Wed Feb 06 15:12:11 2008 +0100
@@ -636,6 +636,7 @@
                         case Gdip.PixelFormat64bppPARGB:
                             this.handle = createDIB(width, height, 32);
                             break;
+                        default:
                     }
                     if (this.handle !is null) {
                         /*
@@ -680,6 +681,7 @@
                                 case Gdip.PixelFormat24bppRGB: depth = 24; break;
                                 case Gdip.PixelFormat32bppRGB:
                                 case Gdip.PixelFormat32bppARGB: depth = 32; break;
+                                default:
                             }
                             if (depth !is 0) {
                                 PaletteData paletteData = null;
@@ -712,6 +714,7 @@
                                     case Gdip.PixelFormat24bppRGB: paletteData = new PaletteData(0xFF, 0xFF00, 0xFF0000); break;
                                     case Gdip.PixelFormat32bppRGB:
                                     case Gdip.PixelFormat32bppARGB: paletteData = new PaletteData(0xFF00, 0xFF0000, 0xFF000000); break;
+                                    default:
                                 }
                                 byte[] data = (cast(byte*)data)[ 0 .. stride * height], alphaData = null;
                                 //OS.MoveMemory(data, pixels, data.length);
@@ -728,6 +731,7 @@
                                             alphaData[j] = data[i];
                                         }
                                         break;
+                                    default:
                                 }
                                 Gdip.Bitmap_UnlockBits(bitmap, lockedBitmapData);
                                 Gdip.BitmapData_delete(lockedBitmapData);
@@ -923,6 +927,7 @@
                                 green = cast(ubyte)((transparentPixel & 0xFF0000) >> 16);
                                 red = cast(ubyte)((transparentPixel & 0xFF00) >> 8);
                                 break;
+                            default:
                         }
                     }
                 }
--- a/dwt/graphics/Pattern.d	Wed Feb 06 12:09:44 2008 +0100
+++ b/dwt/graphics/Pattern.d	Wed Feb 06 15:12:11 2008 +0100
@@ -245,6 +245,7 @@
         case Gdip.BrushTypeTextureFill:
             Gdip.TextureBrush_delete(cast(Gdip.TextureBrush)handle);
             break;
+        default:
     }
     handle = null;
     if (device.tracking) device.dispose_Object(this);
--- a/dwt/graphics/TextLayout.d	Wed Feb 06 12:09:44 2008 +0100
+++ b/dwt/graphics/TextLayout.d	Wed Feb 06 15:12:11 2008 +0100
@@ -296,6 +296,7 @@
                     }
                     break;
                 }
+                default:
             }
         }
         if (wrapWidth !is -1 && lineWidth + run.width > wrapWidth && !run.tab) {
@@ -813,6 +814,7 @@
                                 case OS.PT_MOVETO: newType = Gdip.PathPointTypeStart; break;
                                 case OS.PT_LINETO: newType = Gdip.PathPointTypeLine; break;
                                 case OS.PT_BEZIERTO: newType = Gdip.PathPointTypeBezier; break;
+                                default:
                             }
                             if ((type & OS.PT_CLOSEFIGURE) !is 0) newType |= Gdip.PathPointTypeCloseSubpath;
                             types[typeIndex] = cast(byte)newType;
@@ -849,6 +851,7 @@
                             case Gdip.TextRenderingHintAntiAlias:
                             case Gdip.TextRenderingHintAntiAliasGridFit:
                             case Gdip.TextRenderingHintClearTypeGridFit: textAntialias = Gdip.SmoothingModeAntiAlias; break;
+                            default:
                         }
                         Gdip.Graphics_SetSmoothingMode(gdipGraphics, textAntialias);
                         int gstate2 = 0;
@@ -1279,6 +1282,7 @@
             switch (alignment) {
                 case DWT.CENTER: lineIndent += (wrapWidth - lineWidth) / 2; break;
                 case DWT.RIGHT: lineIndent += wrapWidth - lineWidth; break;
+                default:
             }
         }
     }
@@ -1535,6 +1539,7 @@
                         }
                         break;
                     }
+                    default:
                 }
                 offset = validadeOffset(offset, step);
             }