From: <ai...@us...> - 2010-04-12 22:10:25
|
Revision: 10909 http://plplot.svn.sourceforge.net/plplot/?rev=10909&view=rev Author: airwin Date: 2010-04-12 22:10:19 +0000 (Mon, 12 Apr 2010) Log Message: ----------- Style recent changes. Modified Paths: -------------- trunk/drivers/cairo.c trunk/examples/c/x01c.c trunk/examples/c/x06c.c trunk/examples/c/x07c.c trunk/fonts/font01.c trunk/fonts/font11.c trunk/fonts/plhershey-unicode-gen.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/drivers/cairo.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -74,8 +74,8 @@ #define MAX_MARKUP_LEN MAX_STRING_LEN * 10 /* Values to reset the dirty rectangle regions */ -#define DIRTY_MIN (1.0e50) -#define DIRTY_MAX (-1.0e50) +#define DIRTY_MIN ( 1.0e50 ) +#define DIRTY_MAX ( -1.0e50 ) static int text_clipping; static int text_anti_aliasing; @@ -290,13 +290,13 @@ /* Create an image surface and context for the offscreen rendering */ aStream->cairoSurface_raster = - /* - cairo_surface_create_similar( aStream->cairoSurface, - CAIRO_CONTENT_COLOR, - pls->xlength, pls->ylength ); - */ + /* + * cairo_surface_create_similar( aStream->cairoSurface, + * CAIRO_CONTENT_COLOR, + * pls->xlength, pls->ylength ); + */ cairo_image_surface_create( CAIRO_FORMAT_ARGB32, - pls->xlength, pls->ylength ); + pls->xlength, pls->ylength ); aStream->cairoContext_raster = cairo_create( aStream->cairoSurface_raster ); /* Disable antialiasing for the raster surface. The output seems to look @@ -1615,13 +1615,13 @@ aStream->cairoContext_X = cairo_create( aStream->cairoSurface_X ); /* This is the Cairo surface PLplot will actually plot to. */ aStream->cairoSurface = - /* - cairo_surface_create_similar( aStream->cairoSurface_X, - CAIRO_CONTENT_COLOR, - pls->xlength, pls->ylength ); - */ + /* + * cairo_surface_create_similar( aStream->cairoSurface_X, + * CAIRO_CONTENT_COLOR, + * pls->xlength, pls->ylength ); + */ cairo_image_surface_create( CAIRO_FORMAT_RGB24, - pls->xlength, pls->ylength ); + pls->xlength, pls->ylength ); aStream->cairoContext = cairo_create( aStream->cairoSurface ); /* Invert the surface so that the graphs are drawn right side up. */ @@ -1705,7 +1705,7 @@ cairo_rectangle( aStream->cairoContext_X, x, y, w, h ); cairo_set_operator( aStream->cairoContext_X, CAIRO_OPERATOR_SOURCE ); cairo_set_source_surface( aStream->cairoContext_X, aStream->cairoSurface, - 0.0, 0.0 ); + 0.0, 0.0 ); cairo_fill( aStream->cairoContext_X ); cairo_restore( aStream->cairoContext_X ); @@ -1794,7 +1794,7 @@ if ( expose->count == 0 ) { blit_to_x( aStream, expose->x, expose->y, - expose->width, expose->height ); + expose->width, expose->height ); } break; } @@ -1847,14 +1847,14 @@ { case PLESC_FLUSH: /* forced update of the window */ blit_to_x( aStream, aStream->dirty_x1, aStream->dirty_y1, - aStream->dirty_x2 - aStream->dirty_x1, - aStream->dirty_y2 - aStream->dirty_y1 ); + aStream->dirty_x2 - aStream->dirty_x1, + aStream->dirty_y2 - aStream->dirty_y1 ); XFlush( aStream->XDisplay ); break; case PLESC_GETC: /* get cursor position */ blit_to_x( aStream, aStream->dirty_x1, aStream->dirty_y1, - aStream->dirty_x2 - aStream->dirty_x1, - aStream->dirty_y2 - aStream->dirty_y1 ); + aStream->dirty_x2 - aStream->dirty_x1, + aStream->dirty_y2 - aStream->dirty_y1 ); XFlush( aStream->XDisplay ); xcairo_get_cursor( pls, (PLGraphicsIn*) ptr ); break; @@ -1940,15 +1940,15 @@ gin->dY = (PLFLT) ( pls->ylength - event.xbutton.y ) / ( (PLFLT) ( pls->ylength ) ); /* Get key pressed (if any) */ - if ( event.type == KeyPress || event.type == KeyRelease ) + if ( event.type == KeyPress || event.type == KeyRelease ) { number_chars = XLookupString( (XKeyEvent *) &event, str, 100, &keysym, NULL ); - if (keysym == NoSymbol) - ksname = "NoSymbol"; - else if (!(ksname = XKeysymToString(keysym))) - ksname = "(no name)"; - strcpy(gin->string, ksname); - // gin->string[number_chars] = '\0'; + if ( keysym == NoSymbol ) + ksname = "NoSymbol"; + else if ( !( ksname = XKeysymToString( keysym ) ) ) + ksname = "(no name)"; + strcpy( gin->string, ksname ); + // gin->string[number_chars] = '\0'; switch ( keysym ) { case XK_BackSpace: @@ -1965,8 +1965,8 @@ } else // button press { - sprintf(gin->string, "button %u", gin->button); - gin->keysym = 0x20; + sprintf( gin->string, "button %u", gin->button ); + gin->keysym = 0x20; } /* Switch back to normal cursor */ @@ -2825,39 +2825,39 @@ * ---------------------------------------------------------------------*/ void -handle_locate( PLStream *pls , PLGraphicsIn *gin) +handle_locate( PLStream *pls, PLGraphicsIn *gin ) { - int located = 0; + int located = 0; PLCairo *aStream = (PLCairo *) pls->dev; /* Initialize PLplot mouse event structure */ plGinInit( gin ); - while ( GetMessage( &aStream->msg, NULL, 0, 0 ) && !located) - { - TranslateMessage( &aStream->msg ); + while ( GetMessage( &aStream->msg, NULL, 0, 0 ) && !located ) + { + TranslateMessage( &aStream->msg ); - switch ( (int) aStream->msg.message ) - { - case WM_MOUSEMOVE: - case WM_LBUTTONDOWN: - gin->state = 1; - gin->button = 1; - gin->pX = LOWORD(aStream->msg.lParam); - gin->pY = pls->ylength - HIWORD(aStream->msg.lParam); - gin->dX = (PLFLT) LOWORD(aStream->msg.lParam) / ((PLFLT) pls->xlength); - gin->dY = (PLFLT) (pls->ylength - HIWORD(aStream->msg.lParam)) / ((PLFLT) pls->ylength); - break; - case WM_CHAR: - gin->keysym = aStream->msg.wParam; - located = 1; - break; - - default: - DispatchMessage( &aStream->msg ); - break; - } - } + switch ( (int) aStream->msg.message ) + { + case WM_MOUSEMOVE: + case WM_LBUTTONDOWN: + gin->state = 1; + gin->button = 1; + gin->pX = LOWORD( aStream->msg.lParam ); + gin->pY = pls->ylength - HIWORD( aStream->msg.lParam ); + gin->dX = (PLFLT) LOWORD( aStream->msg.lParam ) / ( (PLFLT) pls->xlength ); + gin->dY = (PLFLT) ( pls->ylength - HIWORD( aStream->msg.lParam ) ) / ( (PLFLT) pls->ylength ); + break; + case WM_CHAR: + gin->keysym = aStream->msg.wParam; + located = 1; + break; + + default: + DispatchMessage( &aStream->msg ); + break; + } + } } /*--------------------------------------------------------------------- @@ -3092,7 +3092,7 @@ InvalidateRect( aStream->hwnd, NULL, TRUE ); break; case PLESC_GETC: - handle_locate(pls, (PLGraphicsIn*) ptr); + handle_locate( pls, (PLGraphicsIn*) ptr ); break; default: plD_esc_cairo( pls, op, ptr ); Modified: trunk/examples/c/x01c.c =================================================================== --- trunk/examples/c/x01c.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/examples/c/x01c.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -203,10 +203,10 @@ pltext(); if ( gin.keysym < 0xFF && isprint( gin.keysym ) ) printf( "subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = '%c' s = '%s'\n", - gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym, gin.string ); + gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym, gin.string ); else printf( "subwin = %d, wx = %f, wy = %f, dx = %f, dy = %f, c = 0x%02x s - '%s'\n", - gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym, gin.string ); + gin.subwindow, gin.wX, gin.wY, gin.dX, gin.dY, gin.keysym, gin.string ); plgra(); } Modified: trunk/examples/c/x06c.c =================================================================== --- trunk/examples/c/x06c.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/examples/c/x06c.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -26,64 +26,66 @@ plinit(); - for(kind_font=0;kind_font<2; kind_font++) { - plfontld (kind_font); - if(kind_font == 0) - maxfont = 1; - else - maxfont = 4; + for ( kind_font = 0; kind_font < 2; kind_font++ ) + { + plfontld( kind_font ); + if ( kind_font == 0 ) + maxfont = 1; + else + maxfont = 4; - for(font=0; font<maxfont; font++) { - plfont(font+1); + for ( font = 0; font < maxfont; font++ ) + { + plfont( font + 1 ); - pladv( 0 ); + pladv( 0 ); /* Set up viewport and window */ - plcol0( 2 ); - plvpor( 0.1, 1.0, 0.1, 0.9 ); - plwind( 0.0, 1.0, 0.0, 1.3 ); + plcol0( 2 ); + plvpor( 0.1, 1.0, 0.1, 0.9 ); + plwind( 0.0, 1.0, 0.0, 1.3 ); /* Draw the grid using plbox */ - plbox( "bcg", 0.1, 0, "bcg", 0.1, 0 ); + plbox( "bcg", 0.1, 0, "bcg", 0.1, 0 ); /* Write the digits below the frame */ - plcol0( 15 ); - for ( i = 0; i <= 9; i++ ) - { - sprintf( text, "%d", i ); - plmtex( "b", 1.5, ( 0.1 * i + 0.05 ), 0.5, text ); - } + plcol0( 15 ); + for ( i = 0; i <= 9; i++ ) + { + sprintf( text, "%d", i ); + plmtex( "b", 1.5, ( 0.1 * i + 0.05 ), 0.5, text ); + } - k = 0; - for ( i = 0; i <= 12; i++ ) - { - /* Write the digits to the left of the frame */ + k = 0; + for ( i = 0; i <= 12; i++ ) + { + /* Write the digits to the left of the frame */ - sprintf( text, "%d", 10 * i ); - plmtex( "lv", 1.0, ( 1.0 - ( 2 * i + 1 ) / 26.0 ), 1.0, text ); - for ( j = 0; j <= 9; j++ ) - { - x = 0.1 * j + 0.05; - y = 1.25 - 0.1 * i; + sprintf( text, "%d", 10 * i ); + plmtex( "lv", 1.0, ( 1.0 - ( 2 * i + 1 ) / 26.0 ), 1.0, text ); + for ( j = 0; j <= 9; j++ ) + { + x = 0.1 * j + 0.05; + y = 1.25 - 0.1 * i; - /* Display the symbols (plpoin expects that x and y are arrays so */ - /* pass pointers) */ + /* Display the symbols (plpoin expects that x and y are arrays so */ + /* pass pointers) */ - if ( k < 128 ) - plpoin( 1, &x, &y, k ); - k = k + 1; + if ( k < 128 ) + plpoin( 1, &x, &y, k ); + k = k + 1; + } + } + + if ( kind_font == 0 ) + plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)" ); + else + plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)" ); } } - - if(kind_font == 0) - plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (compact)" ); - else - plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 6 - plpoin symbols (extended)" ); -} -} plend(); exit( 0 ); } Modified: trunk/examples/c/x07c.c =================================================================== --- trunk/examples/c/x07c.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/examples/c/x07c.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -10,7 +10,7 @@ #include "plcdemos.h" static int base[20] = -{ 0, 100, 0, 100, 200, 500, 600, 700, 800, 900, +{ 0, 100, 0, 100, 200, 500, 600, 700, 800, 900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900 }; /*--------------------------------------------------------------------------*\ @@ -37,7 +37,7 @@ plfontld( 0 ); for ( l = 0; l < 20; l++ ) { - if (l == 2) plfontld(1); + if ( l == 2 ) plfontld( 1 ); pladv( 0 ); /* Set up viewport and window */ @@ -78,11 +78,10 @@ } } - if( l < 2) - plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)" ); + if ( l < 2 ) + plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (compact)" ); else - plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)" ); - + plmtex( "t", 1.5, 0.5, 0.5, "PLplot Example 7 - PLSYM symbols (extended)" ); } plend(); exit( 0 ); Modified: trunk/fonts/font01.c =================================================================== --- trunk/fonts/font01.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/fonts/font01.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -238,7 +238,7 @@ 3499, 3541, 3573, 3621, 3656, 3688, 3722, 3757, 3798, 3829, 3857, 3893, 3928, 3956, 3995, 4036, 0, 0, 0, 0, 0, 0, 4079, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; short int subindex06[100] = { 4091, 4112, 4133, 4151, 4172, 4193, 4205, 4231, 4245, 4257, @@ -253,16 +253,16 @@ 0, 0, 0, 0, 0, 0, 5825, 5830, 5835, 5840 }; short int subindex07[100] = { - 5861, 5869, 5887, 5906, 5916, 5937, 5964, 5973, 6006, 6033, - 6042, 6054, 6069, 6087, 6099, 6123, 6129, 6138, 6155, 6185, - 6191, 6205, 6219, 6225, 6231, 6240, 6249, 6258, 6270, 6279, - 6290, 6301, 6313, 6328, 6366, 0, 6397, 6406, 6415, 6422, - 6443, 6479, 6508, 6531, 6582, 6640, 0, 0, 0, 6698, - 6719, 6738, 6750, 6781, 6810, 6827, 6840, 6854, 6870, 6884, - 6894, 6903, 6913, 6923, 6947, 6971, 7005, 7030, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,26692, 7063, 7069, 7075, 7081, 7087 + 5861, 5869, 5887, 5906, 5916, 5937, 5964, 5973, 6006, 6033, + 6042, 6054, 6069, 6087, 6099, 6123, 6129, 6138, 6155, 6185, + 6191, 6205, 6219, 6225, 6231, 6240, 6249, 6258, 6270, 6279, + 6290, 6301, 6313, 6328, 6366, 0, 6397, 6406, 6415, 6422, + 6443, 6479, 6508, 6531, 6582, 6640, 0, 0, 0, 6698, + 6719, 6738, 6750, 6781, 6810, 6827, 6840, 6854, 6870, 6884, + 6894, 6903, 6913, 6923, 6947, 6971, 7005, 7030, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 26692, 7063, 7069, 7075, 7081, 7087 }; short int subindex08[100] = { 7093, 7099, 7105, 7111, 7117, 7123, 7129, 7135, 7141, 7147, Modified: trunk/fonts/font11.c =================================================================== --- trunk/fonts/font11.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/fonts/font11.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -276,7 +276,7 @@ 2241, 2238, 2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, - 2026, 2223, 804, 2224, 832, 795, 2249, 2101, 2102, 2103, + 2026, 2223, 804, 2224, 832, 795, 2249, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2225, 2229, 2226, 2246, 2199, 2027, 2028, @@ -296,7 +296,7 @@ 2241, 2776, 2242, 2765, 2273, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, - 2076, 2223, 804, 2224, 832, 795, 2249, 2151, 2152, 2153, + 2076, 2223, 804, 2224, 832, 795, 2249, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2225, 2229, 2226, 2246, 2199, 2027, 2028, @@ -316,7 +316,7 @@ 2241, 2776, 2242, 2765, 2273, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, - 2576, 2223, 804, 2224, 832, 795, 2249, 2651, 2652, 2653, + 2576, 2223, 804, 2224, 832, 795, 2249, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2225, 2229, 2226, 2246, 2199, 2027, 2028, Modified: trunk/fonts/plhershey-unicode-gen.c =================================================================== --- trunk/fonts/plhershey-unicode-gen.c 2010-04-12 21:51:06 UTC (rev 10908) +++ trunk/fonts/plhershey-unicode-gen.c 2010-04-12 22:10:19 UTC (rev 10909) @@ -89,7 +89,7 @@ int *Hershey = NULL; int *Unicode = NULL; char *Font = NULL; - int Hershey_old = 0; + int Hershey_old = 0; int i = 0; int number_of_lines = 0; @@ -126,10 +126,10 @@ while ( ( fgets( readbuffer, 255, fr ) != NULL ) ) { sscanf( readbuffer, "%x,%d,%c", (int *) &Unicode[i], (int *) &Hershey[i], (char *) &Font[i] ); - if (Hershey[i] <= Hershey_old) + if ( Hershey[i] <= Hershey_old ) { - fprintf(stderr, "Error: Hershey index = %d is not ascending\n", Hershey[i]); - return(1); + fprintf( stderr, "Error: Hershey index = %d is not ascending\n", Hershey[i] ); + return ( 1 ); } Hershey_old = Hershey[i]; i++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |