include/SDL_render.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 11 Feb 2011 22:37:15 -0800
changeset 5262 b530ef003506
parent 5224 2178ffe17222
child 5297 1800dc39b74c
permissions -rw-r--r--
Happy 2011! :)
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2011 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /**
    24  *  \file SDL_render.h
    25  *  
    26  *  Header file for SDL 2D rendering functions.
    27  *
    28  *  This API supports the following features:
    29  *      * single pixel points
    30  *      * single pixel lines
    31  *      * filled rectangles
    32  *      * texture images
    33  *
    34  *  The primitives may be drawn in opaque, blended, or additive modes.
    35  *
    36  *  The texture images may be drawn in opaque, blended, or additive modes.
    37  *  They can have an additional color tint or alpha modulation applied to
    38  *  them, and may also be stretched with linear interpolation.
    39  *
    40  *  This API is designed to accelerate simple 2D operations. You may
    41  *  want more functionality such as rotation and particle effects and
    42  *  in that case you should use SDL's OpenGL/Direct3D support or one
    43  *  of the many good 3D engines.
    44  */
    45 
    46 #ifndef _SDL_render_h
    47 #define _SDL_render_h
    48 
    49 #include "SDL_stdinc.h"
    50 #include "SDL_rect.h"
    51 #include "SDL_video.h"
    52 
    53 #include "begin_code.h"
    54 /* Set up for C function definitions, even when using C++ */
    55 #ifdef __cplusplus
    56 /* *INDENT-OFF* */
    57 extern "C" {
    58 /* *INDENT-ON* */
    59 #endif
    60 
    61 /**
    62  *  \brief Flags used when creating a rendering context
    63  */
    64 typedef enum
    65 {
    66     SDL_RENDERER_ACCELERATED = 0x00000001,      /**< The renderer uses hardware 
    67                                                      acceleration */
    68     SDL_RENDERER_PRESENTVSYNC = 0x00000002      /**< Present is synchronized 
    69                                                      with the refresh rate */
    70 } SDL_RendererFlags;
    71 
    72 /**
    73  *  \brief Information on the capabilities of a render driver or context.
    74  */
    75 typedef struct SDL_RendererInfo
    76 {
    77     const char *name;           /**< The name of the renderer */
    78     Uint32 flags;               /**< Supported ::SDL_RendererFlags */
    79     Uint32 num_texture_formats; /**< The number of available texture formats */
    80     Uint32 texture_formats[16]; /**< The available texture formats */
    81     int max_texture_width;      /**< The maximimum texture width */
    82     int max_texture_height;     /**< The maximimum texture height */
    83 } SDL_RendererInfo;
    84 
    85 /**
    86  *  \brief The access pattern allowed for a texture.
    87  */
    88 typedef enum
    89 {
    90     SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
    91     SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
    92 } SDL_TextureAccess;
    93 
    94 /**
    95  *  \brief The texture channel modulation used in SDL_RenderCopy().
    96  */
    97 typedef enum
    98 {
    99     SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
   100     SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
   101     SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
   102 } SDL_TextureModulate;
   103 
   104 /**
   105  *  \brief A structure representing rendering state
   106  */
   107 struct SDL_Renderer;
   108 typedef struct SDL_Renderer SDL_Renderer;
   109 
   110 /**
   111  *  \brief An efficient driver-specific representation of pixel data
   112  */
   113 struct SDL_Texture;
   114 typedef struct SDL_Texture SDL_Texture;
   115 
   116 
   117 /* Function prototypes */
   118 
   119 /**
   120  *  \brief Get the number of 2D rendering drivers available for the current 
   121  *         display.
   122  *  
   123  *  A render driver is a set of code that handles rendering and texture
   124  *  management on a particular display.  Normally there is only one, but
   125  *  some drivers may have several available with different capabilities.
   126  *  
   127  *  \sa SDL_GetRenderDriverInfo()
   128  *  \sa SDL_CreateRenderer()
   129  */
   130 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
   131 
   132 /**
   133  *  \brief Get information about a specific 2D rendering driver for the current 
   134  *         display.
   135  *  
   136  *  \param index The index of the driver to query information about.
   137  *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
   138  *               information on the rendering driver.
   139  *  
   140  *  \return 0 on success, -1 if the index was out of range.
   141  *  
   142  *  \sa SDL_CreateRenderer()
   143  */
   144 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
   145                                                     SDL_RendererInfo * info);
   146 
   147 /**
   148  *  \brief Create a 2D rendering context for a window.
   149  *  
   150  *  \param window The window where rendering is displayed.
   151  *  \param index    The index of the rendering driver to initialize, or -1 to 
   152  *                  initialize the first one supporting the requested flags.
   153  *  \param flags    ::SDL_RendererFlags.
   154  *  
   155  *  \return A valid rendering context or NULL if there was an error.
   156  *  
   157  *  \sa SDL_CreateSoftwareRenderer()
   158  *  \sa SDL_GetRendererInfo()
   159  *  \sa SDL_DestroyRenderer()
   160  */
   161 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
   162                                                int index, Uint32 flags);
   163 
   164 /**
   165  *  \brief Create a 2D software rendering context for a surface.
   166  *  
   167  *  \param surface The surface where rendering is done.
   168  *  
   169  *  \return A valid rendering context or NULL if there was an error.
   170  *  
   171  *  \sa SDL_CreateRenderer()
   172  *  \sa SDL_DestroyRenderer()
   173  */
   174 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
   175 
   176 /**
   177  *  \brief Get information about a rendering context.
   178  */
   179 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
   180                                                 SDL_RendererInfo * info);
   181 
   182 /**
   183  *  \brief Create a texture for a rendering context.
   184  *  
   185  *  \param format The format of the texture.
   186  *  \param access One of the enumerated values in ::SDL_TextureAccess.
   187  *  \param w      The width of the texture in pixels.
   188  *  \param h      The height of the texture in pixels.
   189  *  
   190  *  \return The created texture is returned, or 0 if no rendering context was 
   191  *          active,  the format was unsupported, or the width or height were out
   192  *          of range.
   193  *  
   194  *  \sa SDL_QueryTexture()
   195  *  \sa SDL_UpdateTexture()
   196  *  \sa SDL_DestroyTexture()
   197  */
   198 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,                                                        Uint32 format,
   199                                                         int access, int w,
   200                                                         int h);
   201 
   202 /**
   203  *  \brief Create a texture from an existing surface.
   204  *  
   205  *  \param surface The surface containing pixel data used to fill the texture.
   206  *  
   207  *  \return The created texture is returned, or 0 on error.
   208  *  
   209  *  \note The surface is not modified or freed by this function.
   210  *  
   211  *  \sa SDL_QueryTexture()
   212  *  \sa SDL_DestroyTexture()
   213  */
   214 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
   215 
   216 /**
   217  *  \brief Query the attributes of a texture
   218  *  
   219  *  \param texture A texture to be queried.
   220  *  \param format  A pointer filled in with the raw format of the texture.  The 
   221  *                 actual format may differ, but pixel transfers will use this 
   222  *                 format.
   223  *  \param access  A pointer filled in with the actual access to the texture.
   224  *  \param w       A pointer filled in with the width of the texture in pixels.
   225  *  \param h       A pointer filled in with the height of the texture in pixels.
   226  *  
   227  *  \return 0 on success, or -1 if the texture is not valid.
   228  */
   229 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
   230                                              Uint32 * format, int *access,
   231                                              int *w, int *h);
   232 
   233 /**
   234  *  \brief Set an additional color value used in render copy operations.
   235  *  
   236  *  \param texture The texture to update.
   237  *  \param r       The red color value multiplied into copy operations.
   238  *  \param g       The green color value multiplied into copy operations.
   239  *  \param b       The blue color value multiplied into copy operations.
   240  *  
   241  *  \return 0 on success, or -1 if the texture is not valid or color modulation 
   242  *          is not supported.
   243  *  
   244  *  \sa SDL_GetTextureColorMod()
   245  */
   246 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
   247                                                    Uint8 r, Uint8 g, Uint8 b);
   248 
   249 
   250 /**
   251  *  \brief Get the additional color value used in render copy operations.
   252  *  
   253  *  \param texture The texture to query.
   254  *  \param r         A pointer filled in with the current red color value.
   255  *  \param g         A pointer filled in with the current green color value.
   256  *  \param b         A pointer filled in with the current blue color value.
   257  *  
   258  *  \return 0 on success, or -1 if the texture is not valid.
   259  *  
   260  *  \sa SDL_SetTextureColorMod()
   261  */
   262 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
   263                                                    Uint8 * r, Uint8 * g,
   264                                                    Uint8 * b);
   265 
   266 /**
   267  *  \brief Set an additional alpha value used in render copy operations.
   268  *  
   269  *  \param texture The texture to update.
   270  *  \param alpha     The alpha value multiplied into copy operations.
   271  *  
   272  *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
   273  *          is not supported.
   274  *  
   275  *  \sa SDL_GetTextureAlphaMod()
   276  */
   277 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
   278                                                    Uint8 alpha);
   279 
   280 /**
   281  *  \brief Get the additional alpha value used in render copy operations.
   282  *  
   283  *  \param texture The texture to query.
   284  *  \param alpha     A pointer filled in with the current alpha value.
   285  *  
   286  *  \return 0 on success, or -1 if the texture is not valid.
   287  *  
   288  *  \sa SDL_SetTextureAlphaMod()
   289  */
   290 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
   291                                                    Uint8 * alpha);
   292 
   293 /**
   294  *  \brief Set the blend mode used for texture copy operations.
   295  *  
   296  *  \param texture The texture to update.
   297  *  \param blendMode ::SDL_BlendMode to use for texture blending.
   298  *  
   299  *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
   300  *          not supported.
   301  *  
   302  *  \note If the blend mode is not supported, the closest supported mode is
   303  *        chosen.
   304  *  
   305  *  \sa SDL_GetTextureBlendMode()
   306  */
   307 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
   308                                                     SDL_BlendMode blendMode);
   309 
   310 /**
   311  *  \brief Get the blend mode used for texture copy operations.
   312  *  
   313  *  \param texture   The texture to query.
   314  *  \param blendMode A pointer filled in with the current blend mode.
   315  *  
   316  *  \return 0 on success, or -1 if the texture is not valid.
   317  *  
   318  *  \sa SDL_SetTextureBlendMode()
   319  */
   320 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
   321                                                     SDL_BlendMode *blendMode);
   322 
   323 /**
   324  *  \brief Update the given texture rectangle with new pixel data.
   325  *  
   326  *  \param texture   The texture to update
   327  *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
   328  *                   update the entire texture.
   329  *  \param pixels    The raw pixel data.
   330  *  \param pitch     The number of bytes between rows of pixel data.
   331  *  
   332  *  \return 0 on success, or -1 if the texture is not valid.
   333  *  
   334  *  \note This is a fairly slow function.
   335  */
   336 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
   337                                               const SDL_Rect * rect,
   338                                               const void *pixels, int pitch);
   339 
   340 /**
   341  *  \brief Lock a portion of the texture for pixel access.
   342  *  
   343  *  \param texture   The texture to lock for access, which was created with 
   344  *                   ::SDL_TEXTUREACCESS_STREAMING.
   345  *  \param rect      A pointer to the rectangle to lock for access. If the rect 
   346  *                   is NULL, the entire texture will be locked.
   347  *  \param pixels    This is filled in with a pointer to the locked pixels, 
   348  *                   appropriately offset by the locked area.
   349  *  \param pitch     This is filled in with the pitch of the locked pixels.
   350  *  
   351  *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
   352  *  
   353  *  \sa SDL_UnlockTexture()
   354  */
   355 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
   356                                             const SDL_Rect * rect,
   357                                             void **pixels, int *pitch);
   358 
   359 /**
   360  *  \brief Unlock a texture, uploading the changes to video memory, if needed.
   361  *  
   362  *  \sa SDL_LockTexture()
   363  */
   364 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
   365 
   366 /**
   367  *  \brief Set the clipping rectangle for rendering on the current target
   368  *
   369  *  \param rect The rectangle to clip rendering to, or NULL to disable clipping.
   370  *
   371  *  The contents of the window are not defined after calling
   372  *  SDL_RenderPresent(), so you should clear the clip rectangle and draw
   373  *  over the entire window each frame.
   374  */
   375 extern DECLSPEC void SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
   376                                                    const SDL_Rect * rect);
   377 
   378 /**
   379  *  \brief Set the color used for drawing operations (Fill and Line).
   380  *  
   381  *  \param r The red value used to draw on the rendering target.
   382  *  \param g The green value used to draw on the rendering target.
   383  *  \param b The blue value used to draw on the rendering target.
   384  *  \param a The alpha value used to draw on the rendering target, usually 
   385  *           ::SDL_ALPHA_OPAQUE (255).
   386  *  
   387  *  \return 0 on success, or -1 on error
   388  */
   389 extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
   390                                            Uint8 r, Uint8 g, Uint8 b,
   391                                            Uint8 a);
   392 
   393 /**
   394  *  \brief Get the color used for drawing operations (Fill and Line).
   395  *  
   396  *  \param r A pointer to the red value used to draw on the rendering target.
   397  *  \param g A pointer to the green value used to draw on the rendering target.
   398  *  \param b A pointer to the blue value used to draw on the rendering target.
   399  *  \param a A pointer to the alpha value used to draw on the rendering target, 
   400  *           usually ::SDL_ALPHA_OPAQUE (255).
   401  *  
   402  *  \return 0 on success, or -1 on error
   403  */
   404 extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
   405                                            Uint8 * r, Uint8 * g, Uint8 * b,
   406                                            Uint8 * a);
   407 
   408 /**
   409  *  \brief Set the blend mode used for drawing operations (Fill and Line).
   410  *  
   411  *  \param blendMode ::SDL_BlendMode to use for blending.
   412  *  
   413  *  \return 0 on success, or -1 on error
   414  *  
   415  *  \note If the blend mode is not supported, the closest supported mode is 
   416  *        chosen.
   417  *  
   418  *  \sa SDL_GetRenderDrawBlendMode()
   419  */
   420 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
   421                                                        SDL_BlendMode blendMode);
   422 
   423 /**
   424  *  \brief Get the blend mode used for drawing operations.
   425  *  
   426  *  \param blendMode A pointer filled in with the current blend mode.
   427  *  
   428  *  \return 0 on success, or -1 on error
   429  *  
   430  *  \sa SDL_SetRenderDrawBlendMode()
   431  */
   432 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
   433                                                        SDL_BlendMode *blendMode);
   434 
   435 /**
   436  *  \brief Clear the current rendering target with the drawing color
   437  */
   438 extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
   439 
   440 /**
   441  *  \brief Draw a point on the current rendering target.
   442  *  
   443  *  \param x The x coordinate of the point.
   444  *  \param y The y coordinate of the point.
   445  *  
   446  *  \return 0 on success, or -1 on error
   447  */
   448 extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
   449                                                 int x, int y);
   450 
   451 /**
   452  *  \brief Draw multiple points on the current rendering target.
   453  *  
   454  *  \param points The points to draw
   455  *  \param count The number of points to draw
   456  *  
   457  *  \return 0 on success, or -1 on error
   458  */
   459 extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
   460                                                  const SDL_Point * points,
   461                                                  int count);
   462 
   463 /**
   464  *  \brief Draw a line on the current rendering target.
   465  *  
   466  *  \param x1 The x coordinate of the start point.
   467  *  \param y1 The y coordinate of the start point.
   468  *  \param x2 The x coordinate of the end point.
   469  *  \param y2 The y coordinate of the end point.
   470  *  
   471  *  \return 0 on success, or -1 on error
   472  */
   473 extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
   474                                                int x1, int y1, int x2, int y2);
   475 
   476 /**
   477  *  \brief Draw a series of connected lines on the current rendering target.
   478  *  
   479  *  \param points The points along the lines
   480  *  \param count The number of points, drawing count-1 lines
   481  *  
   482  *  \return 0 on success, or -1 on error
   483  */
   484 extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
   485                                                 const SDL_Point * points,
   486                                                 int count);
   487 
   488 /**
   489  *  \brief Draw a rectangle on the current rendering target.
   490  *  
   491  *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
   492  *  
   493  *  \return 0 on success, or -1 on error
   494  */
   495 extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
   496                                                const SDL_Rect * rect);
   497 
   498 /**
   499  *  \brief Draw some number of rectangles on the current rendering target.
   500  *  
   501  *  \param rects A pointer to an array of destination rectangles.
   502  *  \param count The number of rectangles.
   503  *  
   504  *  \return 0 on success, or -1 on error
   505  */
   506 extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
   507                                                 const SDL_Rect ** rects,
   508                                                 int count);
   509 
   510 /**
   511  *  \brief Fill a rectangle on the current rendering target with the drawing color.
   512  *  
   513  *  \param rect A pointer to the destination rectangle, or NULL for the entire 
   514  *              rendering target.
   515  *  
   516  *  \return 0 on success, or -1 on error
   517  */
   518 extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
   519                                                const SDL_Rect * rect);
   520 
   521 /**
   522  *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
   523  *  
   524  *  \param rects A pointer to an array of destination rectangles.
   525  *  \param count The number of rectangles.
   526  *  
   527  *  \return 0 on success, or -1 on error
   528  */
   529 extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
   530                                                 const SDL_Rect ** rect,
   531                                                 int count);
   532 
   533 /**
   534  *  \brief Copy a portion of the texture to the current rendering target.
   535  *  
   536  *  \param texture The source texture.
   537  *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
   538  *                   texture.
   539  *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
   540  *                   entire rendering target.
   541  *  
   542  *  \return 0 on success, or -1 on error
   543  */
   544 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
   545                                            SDL_Texture * texture,
   546                                            const SDL_Rect * srcrect,
   547                                            const SDL_Rect * dstrect);
   548 
   549 /**
   550  *  \brief Read pixels from the current rendering target.
   551  *  
   552  *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
   553  *                render target.
   554  *  \param format The desired format of the pixel data, or 0 to use the format
   555  *                of the rendering target
   556  *  \param pixels A pointer to be filled in with the pixel data
   557  *  \param pitch  The pitch of the pixels parameter.
   558  *  
   559  *  \return 0 on success, or -1 if pixel reading is not supported.
   560  *  
   561  *  \warning This is a very slow operation, and should not be used frequently.
   562  */
   563 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
   564                                                  const SDL_Rect * rect,
   565                                                  Uint32 format,
   566                                                  void *pixels, int pitch);
   567 
   568 /**
   569  *  \brief Update the screen with rendering performed.
   570  */
   571 extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
   572 
   573 /**
   574  *  \brief Destroy the specified texture.
   575  *  
   576  *  \sa SDL_CreateTexture()
   577  *  \sa SDL_CreateTextureFromSurface()
   578  */
   579 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
   580 
   581 /**
   582  *  \brief Destroy the rendering context for a window and free associated
   583  *         textures.
   584  *  
   585  *  \sa SDL_CreateRenderer()
   586  */
   587 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
   588 
   589 
   590 /* Ends C function definitions when using C++ */
   591 #ifdef __cplusplus
   592 /* *INDENT-OFF* */
   593 }
   594 /* *INDENT-ON* */
   595 #endif
   596 #include "close_code.h"
   597 
   598 #endif /* _SDL_render_h */
   599 
   600 /* vi: set ts=4 sw=4 expandtab: */