include/SDL_surface.h
author Bob Pendleton <bob@pendleton.com>
Thu, 09 Jul 2009 21:31:27 +0000
changeset 3216 48a80f2a7ff2
parent 3103 7be21a78777e
child 3341 710139a1692d
permissions -rw-r--r--
volitile... duh, yeah the variable need to be labeled volitile
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 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_surface.h
    25  *
    26  * Header file for SDL_surface definition and management functions
    27  */
    28 
    29 #ifndef _SDL_surface_h
    30 #define _SDL_surface_h
    31 
    32 #include "SDL_stdinc.h"
    33 #include "SDL_pixels.h"
    34 #include "SDL_rect.h"
    35 #include "SDL_rwops.h"
    36 
    37 #include "begin_code.h"
    38 /* Set up for C function definitions, even when using C++ */
    39 #ifdef __cplusplus
    40 /* *INDENT-OFF* */
    41 extern "C" {
    42 /* *INDENT-ON* */
    43 #endif
    44 
    45 /* These are the currently supported flags for the SDL_surface */
    46 /* Used internally (read-only) */
    47 #define SDL_PREALLOC        0x00000001  /* Surface uses preallocated memory */
    48 #define SDL_RLEACCEL        0x00000002  /* Surface is RLE encoded */
    49 
    50 /* Evaluates to true if the surface needs to be locked before access */
    51 #define SDL_MUSTLOCK(S)	(((S)->flags & SDL_RLEACCEL) != 0)
    52 
    53 /**
    54  * \struct SDL_Surface
    55  *
    56  * \brief A collection of pixels used in software blitting
    57  *
    58  * \note  This structure should be treated as read-only, except for 'pixels',
    59  *        which, if not NULL, contains the raw pixel data for the surface.
    60  */
    61 typedef struct SDL_Surface
    62 {
    63     Uint32 flags;               /**< Read-only */
    64     SDL_PixelFormat *format;    /**< Read-only */
    65     int w, h;                   /**< Read-only */
    66     int pitch;                  /**< Read-only */
    67     void *pixels;               /**< Read-write */
    68 
    69     /* Application data associated with the surfade */
    70     void *userdata;             /**< Read-write */
    71 
    72     /* information needed for surfaces requiring locks */
    73     int locked;                 /**< Read-only */
    74     void *lock_data;            /**< Read-only */
    75 
    76     /* clipping information */
    77     SDL_Rect clip_rect;         /**< Read-only */
    78 
    79     /* info for fast blit mapping to other surfaces */
    80     struct SDL_BlitMap *map;    /**< Private */
    81 
    82     /* format version, bumped at every change to invalidate blit maps */
    83     unsigned int format_version;        /**< Private */
    84 
    85     /* Reference count -- used when freeing surface */
    86     int refcount;               /**< Read-mostly */
    87 } SDL_Surface;
    88 
    89 /**
    90  * \typedef SDL_blit
    91  *
    92  * \brief The type of function used for surface blitting functions
    93  */
    94 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
    95                          struct SDL_Surface * dst, SDL_Rect * dstrect);
    96 
    97 /*
    98  * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
    99  * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
   100  * If the depth is greater than 8 bits, the pixel format is set using the
   101  * flags '[RGB]mask'.
   102  * If the function runs out of memory, it will return NULL.
   103  *
   104  * The 'flags' are obsolete and should be set to 0.
   105  */
   106 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
   107     (Uint32 flags, int width, int height, int depth,
   108      Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
   109 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
   110                                                               int width,
   111                                                               int height,
   112                                                               int depth,
   113                                                               int pitch,
   114                                                               Uint32 Rmask,
   115                                                               Uint32 Gmask,
   116                                                               Uint32 Bmask,
   117                                                               Uint32 Amask);
   118 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
   119 
   120 /**
   121  * \fn int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)
   122  *
   123  * \brief Set the palette used by a surface.
   124  *
   125  * \return 0, or -1 if the surface format doesn't use a palette.
   126  *
   127  * \note A single palette can be shared with many surfaces.
   128  */
   129 extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
   130                                                   SDL_Palette * palette);
   131 
   132 /*
   133  * SDL_LockSurface() sets up a surface for directly accessing the pixels.
   134  * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
   135  * to and read from 'surface->pixels', using the pixel format stored in 
   136  * 'surface->format'.  Once you are done accessing the surface, you should 
   137  * use SDL_UnlockSurface() to release it.
   138  *
   139  * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
   140  * to 0, then you can read and write to the surface at any time, and the
   141  * pixel format of the surface will not change.
   142  * 
   143  * No operating system or library calls should be made between lock/unlock
   144  * pairs, as critical system locks may be held during this time.
   145  *
   146  * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
   147  */
   148 extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
   149 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
   150 
   151 /*
   152  * Load a surface from a seekable SDL data source (memory or file.)
   153  * If 'freesrc' is non-zero, the source will be closed after being read.
   154  * Returns the new surface, or NULL if there was an error.
   155  * The new surface should be freed with SDL_FreeSurface().
   156  */
   157 extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
   158                                                     int freesrc);
   159 
   160 /* Convenience macro -- load a surface from a file */
   161 #define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
   162 
   163 /*
   164  * Save a surface to a seekable SDL data source (memory or file.)
   165  * If 'freedst' is non-zero, the source will be closed after being written.
   166  * Returns 0 if successful or -1 if there was an error.
   167  */
   168 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
   169     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
   170 
   171 /* Convenience macro -- save a surface to a file */
   172 #define SDL_SaveBMP(surface, file) \
   173 		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
   174 
   175 /*
   176  * \fn int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)
   177  *
   178  * \brief Sets the RLE acceleration hint for a surface.
   179  *
   180  * \return 0 on success, or -1 if the surface is not valid
   181  *
   182  * \note If RLE is enabled, colorkey and alpha blending blits are much faster,
   183  *       but the surface must be locked before directly accessing the pixels.
   184  */
   185 extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
   186                                               int flag);
   187 
   188 /*
   189  * \fn int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key)
   190  *
   191  * \brief Sets the color key (transparent pixel) in a blittable surface.
   192  *
   193  * \param surface The surface to update
   194  * \param flag Non-zero to enable colorkey and 0 to disable colorkey 
   195  * \param key The transparent pixel in the native surface format
   196  *
   197  * \return 0 on success, or -1 if the surface is not valid
   198  */
   199 extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
   200                                             Uint32 flag, Uint32 key);
   201 
   202 /*
   203  * \fn int SDL_GetColorKey(SDL_Surface *surface, Uint32 *key)
   204  *
   205  * \brief Sets the color key (transparent pixel) in a blittable surface.
   206  *
   207  * \param surface The surface to update
   208  * \param key A pointer filled in with the transparent pixel in the native surface format
   209  *
   210  * \return 0 on success, or -1 if the surface is not valid or colorkey is not enabled.
   211  */
   212 extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
   213                                             Uint32 * key);
   214 
   215 /**
   216  * \fn int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b)
   217  *
   218  * \brief Set an additional color value used in blit operations
   219  *
   220  * \param surface The surface to update
   221  * \param r The red source color value multiplied into blit operations
   222  * \param g The green source color value multiplied into blit operations
   223  * \param b The blue source color value multiplied into blit operations
   224  *
   225  * \return 0 on success, or -1 if the surface is not valid
   226  *
   227  * \sa SDL_GetSurfaceColorMod()
   228  */
   229 extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
   230                                                    Uint8 r, Uint8 g, Uint8 b);
   231 
   232 
   233 /**
   234  * \fn int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b)
   235  *
   236  * \brief Get the additional color value used in blit operations
   237  *
   238  * \param surface The surface to query
   239  * \param r A pointer filled in with the source red color value
   240  * \param g A pointer filled in with the source green color value
   241  * \param b A pointer filled in with the source blue color value
   242  *
   243  * \return 0 on success, or -1 if the surface is not valid
   244  *
   245  * \sa SDL_SetSurfaceColorMod()
   246  */
   247 extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
   248                                                    Uint8 * r, Uint8 * g,
   249                                                    Uint8 * b);
   250 
   251 /**
   252  * \fn int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha)
   253  *
   254  * \brief Set an additional alpha value used in blit operations
   255  *
   256  * \param surface The surface to update
   257  * \param alpha The source alpha value multiplied into blit operations.
   258  *
   259  * \return 0 on success, or -1 if the surface is not valid
   260  *
   261  * \sa SDL_GetSurfaceAlphaMod()
   262  */
   263 extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
   264                                                    Uint8 alpha);
   265 
   266 /**
   267  * \fn int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha)
   268  *
   269  * \brief Get the additional alpha value used in blit operations
   270  *
   271  * \param surface The surface to query
   272  * \param alpha A pointer filled in with the source alpha value
   273  *
   274  * \return 0 on success, or -1 if the surface is not valid
   275  *
   276  * \sa SDL_SetSurfaceAlphaMod()
   277  */
   278 extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
   279                                                    Uint8 * alpha);
   280 
   281 /**
   282  * \fn int SDL_SetSurfaceBlendMode(SDL_Surface *surface, int blendMode)
   283  *
   284  * \brief Set the blend mode used for blit operations
   285  *
   286  * \param surface The surface to update
   287  * \param blendMode SDL_TextureBlendMode to use for blit blending
   288  *
   289  * \return 0 on success, or -1 if the parameters are not valid
   290  *
   291  * \sa SDL_GetSurfaceBlendMode()
   292  */
   293 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
   294                                                     int blendMode);
   295 
   296 /**
   297  * \fn int SDL_GetSurfaceBlendMode(SDL_Surface *surface, int *blendMode)
   298  *
   299  * \brief Get the blend mode used for blit operations
   300  *
   301  * \param surface The surface to query
   302  * \param blendMode A pointer filled in with the current blend mode
   303  *
   304  * \return 0 on success, or -1 if the surface is not valid
   305  *
   306  * \sa SDL_SetSurfaceBlendMode()
   307  */
   308 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
   309                                                     int *blendMode);
   310 
   311 /**
   312  * \fn int SDL_SetSurfaceScaleMode(SDL_Surface *surface, int scaleMode)
   313  *
   314  * \brief Set the scale mode used for blit operations
   315  *
   316  * \param surface The surface to update
   317  * \param scaleMode SDL_TextureScaleMode to use for blit scaling
   318  *
   319  * \return 0 on success, or -1 if the surface is not valid or the scale mode is not supported
   320  *
   321  * \note If the scale mode is not supported, the closest supported mode is chosen.  Currently only SDL_TEXTURESCALEMODE_FAST is supported on surfaces.
   322  *
   323  * \sa SDL_GetSurfaceScaleMode()
   324  */
   325 extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
   326                                                     int scaleMode);
   327 
   328 /**
   329  * \fn int SDL_GetSurfaceScaleMode(SDL_Surface *surface, int *scaleMode)
   330  *
   331  * \brief Get the scale mode used for blit operations
   332  *
   333  * \param surface The surface to query
   334  * \param scaleMode A pointer filled in with the current scale mode
   335  *
   336  * \return 0 on success, or -1 if the surface is not valid
   337  *
   338  * \sa SDL_SetSurfaceScaleMode()
   339  */
   340 extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
   341                                                     int *scaleMode);
   342 
   343 /*
   344  * Sets the clipping rectangle for the destination surface in a blit.
   345  *
   346  * If the clip rectangle is NULL, clipping will be disabled.
   347  * If the clip rectangle doesn't intersect the surface, the function will
   348  * return SDL_FALSE and blits will be completely clipped.  Otherwise the
   349  * function returns SDL_TRUE and blits to the surface will be clipped to
   350  * the intersection of the surface area and the clipping rectangle.
   351  *
   352  * Note that blits are automatically clipped to the edges of the source
   353  * and destination surfaces.
   354  */
   355 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
   356                                                  const SDL_Rect * rect);
   357 
   358 /*
   359  * Gets the clipping rectangle for the destination surface in a blit.
   360  * 'rect' must be a pointer to a valid rectangle which will be filled
   361  * with the correct values.
   362  */
   363 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
   364                                              SDL_Rect * rect);
   365 
   366 /*
   367  * Creates a new surface of the specified format, and then copies and maps 
   368  * the given surface to it so the blit of the converted surface will be as 
   369  * fast as possible.  If this function fails, it returns NULL.
   370  *
   371  * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
   372  * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
   373  * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
   374  * surface.
   375  *
   376  * This function is used internally by SDL_DisplayFormat().
   377  */
   378 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
   379     (SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);
   380 
   381 /*
   382  * This function draws a point with 'color'
   383  * The color should be a pixel of the format used by the surface, and 
   384  * can be generated by the SDL_MapRGB() function.
   385  * This function returns 0 on success, or -1 on error.
   386  */
   387 extern DECLSPEC int SDLCALL SDL_DrawPoint
   388     (SDL_Surface * dst, int x, int y, Uint32 color);
   389 
   390 /*
   391  * This function blends a point with an RGBA value
   392  * The color should be a pixel of the format used by the surface, and 
   393  * can be generated by the SDL_MapRGB() function.
   394  * This function returns 0 on success, or -1 on error.
   395  */
   396 extern DECLSPEC int SDLCALL SDL_BlendPoint
   397     (SDL_Surface * dst, int x, int y, int blendMode,
   398      Uint8 r, Uint8 g, Uint8 b, Uint8 a);
   399 
   400 /*
   401  * This function draws a line with 'color'
   402  * The color should be a pixel of the format used by the surface, and 
   403  * can be generated by the SDL_MapRGB() function.
   404  * This function returns 0 on success, or -1 on error.
   405  */
   406 extern DECLSPEC int SDLCALL SDL_DrawLine
   407     (SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
   408 
   409 /*
   410  * This function blends an RGBA value along a line
   411  * This function returns 0 on success, or -1 on error.
   412  */
   413 extern DECLSPEC int SDLCALL SDL_BlendLine
   414     (SDL_Surface * dst, int x1, int y1, int x2, int y2, int blendMode,
   415      Uint8 r, Uint8 g, Uint8 b, Uint8 a);
   416 
   417 /*
   418  * This function performs a fast fill of the given rectangle with 'color'
   419  * The given rectangle is clipped to the destination surface clip area
   420  * and the final fill rectangle is saved in the passed in pointer.
   421  * If 'dstrect' is NULL, the whole surface will be filled with 'color'
   422  * The color should be a pixel of the format used by the surface, and 
   423  * can be generated by the SDL_MapRGB() function.
   424  * This function returns 0 on success, or -1 on error.
   425  */
   426 extern DECLSPEC int SDLCALL SDL_FillRect
   427     (SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color);
   428 
   429 /*
   430  * This function blends an RGBA value into the given rectangle.
   431  * The given rectangle is clipped to the destination surface clip area
   432  * and the final fill rectangle is saved in the passed in pointer.
   433  * If 'dstrect' is NULL, the whole surface will be filled with 'color'
   434  * This function returns 0 on success, or -1 on error.
   435  */
   436 extern DECLSPEC int SDLCALL SDL_BlendRect
   437     (SDL_Surface * dst, SDL_Rect * dstrect, int blendMode, Uint8 r, Uint8 g,
   438      Uint8 b, Uint8 a);
   439 
   440 /*
   441  * This performs a fast blit from the source surface to the destination
   442  * surface.  It assumes that the source and destination rectangles are
   443  * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
   444  * surface (src or dst) is copied.  The final blit rectangles are saved
   445  * in 'srcrect' and 'dstrect' after all clipping is performed.
   446  * If the blit is successful, it returns 0, otherwise it returns -1.
   447  *
   448  * The blit function should not be called on a locked surface.
   449  *
   450  * The blit semantics for surfaces with and without alpha and colorkey
   451  * are defined as follows:
   452  *
   453  * RGBA->RGB:
   454  *     SDL_SRCALPHA set:
   455  * 	alpha-blend (using alpha-channel).
   456  * 	SDL_SRCCOLORKEY ignored.
   457  *     SDL_SRCALPHA not set:
   458  * 	copy RGB.
   459  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   460  * 	RGB values of the source colour key, ignoring alpha in the
   461  * 	comparison.
   462  * 
   463  * RGB->RGBA:
   464  *     SDL_SRCALPHA set:
   465  * 	alpha-blend (using the source per-surface alpha value);
   466  * 	set destination alpha to opaque.
   467  *     SDL_SRCALPHA not set:
   468  * 	copy RGB, set destination alpha to source per-surface alpha value.
   469  *     both:
   470  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   471  * 	source colour key.
   472  * 
   473  * RGBA->RGBA:
   474  *     SDL_SRCALPHA set:
   475  * 	alpha-blend (using the source alpha channel) the RGB values;
   476  * 	leave destination alpha untouched. [Note: is this correct?]
   477  * 	SDL_SRCCOLORKEY ignored.
   478  *     SDL_SRCALPHA not set:
   479  * 	copy all of RGBA to the destination.
   480  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   481  * 	RGB values of the source colour key, ignoring alpha in the
   482  * 	comparison.
   483  * 
   484  * RGB->RGB: 
   485  *     SDL_SRCALPHA set:
   486  * 	alpha-blend (using the source per-surface alpha value).
   487  *     SDL_SRCALPHA not set:
   488  * 	copy RGB.
   489  *     both:
   490  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
   491  * 	source colour key.
   492  *
   493  * If either of the surfaces were in video memory, and the blit returns -2,
   494  * the video memory was lost, so it should be reloaded with artwork and 
   495  * re-blitted:
   496 	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
   497 		while ( SDL_LockSurface(image) < 0 )
   498 			Sleep(10);
   499 		-- Write image pixels to image->pixels --
   500 		SDL_UnlockSurface(image);
   501 	}
   502  * This happens under DirectX 5.0 when the system switches away from your
   503  * fullscreen application.  The lock will also fail until you have access
   504  * to the video memory again.
   505  */
   506 /* You should call SDL_BlitSurface() unless you know exactly how SDL
   507    blitting works internally and how to use the other blit functions.
   508 */
   509 #define SDL_BlitSurface SDL_UpperBlit
   510 
   511 /* This is the public blit function, SDL_BlitSurface(), and it performs
   512    rectangle validation and clipping before passing it to SDL_LowerBlit()
   513 */
   514 extern DECLSPEC int SDLCALL SDL_UpperBlit
   515     (SDL_Surface * src, SDL_Rect * srcrect,
   516      SDL_Surface * dst, SDL_Rect * dstrect);
   517 /* This is a semi-private blit function and it performs low-level surface
   518    blitting only.
   519 */
   520 extern DECLSPEC int SDLCALL SDL_LowerBlit
   521     (SDL_Surface * src, SDL_Rect * srcrect,
   522      SDL_Surface * dst, SDL_Rect * dstrect);
   523 
   524 /**
   525  * \fn int SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect)
   526  *
   527  * \brief Perform a fast, low quality, stretch blit between two surfaces of the same pixel format.
   528  *
   529  * \note This function uses a static buffer, and is not thread-safe.
   530  */
   531 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
   532                                             const SDL_Rect * srcrect,
   533                                             SDL_Surface * dst,
   534                                             const SDL_Rect * dstrect);
   535 
   536 /* Ends C function definitions when using C++ */
   537 #ifdef __cplusplus
   538 /* *INDENT-OFF* */
   539 }
   540 /* *INDENT-ON* */
   541 #endif
   542 #include "close_code.h"
   543 
   544 #endif /* _SDL_surface_h */
   545 
   546 /* vi: set ts=4 sw=4 expandtab: */