Author: ayoung
Date: Mon Jun  7 06:31:48 2010
New Revision: 8846

URL: http://svn.slimdevices.com/jive?rev=8846&view=rev
Log:
bug 16288: Squeezeplay-based testing client 
Stub out all graphics (on JIVE_NO_DISPLAY).

Modified:
    7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_font.c
    7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
    7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_surface.c

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_font.c
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_font.c?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_font.c (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_font.c Mon Jun  7 
06:31:48 2010
@@ -276,7 +276,11 @@
 JiveSurface *jive_font_draw_text(JiveFont *font, Uint32 color, const char 
*str) {
        assert(font && font->magic == JIVE_FONT_MAGIC);
 
+#ifdef JIVE_NO_DISPLAY
+       return (JiveSurface *)1;
+#else
        return jive_surface_new_SDLSurface(str ? font->draw(font, color, str) : 
NULL);
+#endif
 }
 
 JiveSurface *jive_font_ndraw_text(JiveFont *font, Uint32 color, const char 
*str, size_t len) {

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Mon Jun  7 
06:31:48 2010
@@ -163,23 +163,31 @@
        /* linux fbcon does not need a mouse */
        SDL_putenv("SDL_NOMOUSE=1");
 
+#ifdef JIVE_NO_DISPLAY
+#   define JIVE_SDL_FEATURES (SDL_INIT_TIMER)
+#else
+#   define JIVE_SDL_FEATURES (SDL_INIT_VIDEO|SDL_INIT_TIMER)
+#endif
        /* initialise SDL */
-       if (SDL_Init(SDL_INIT_VIDEO) < 0) {
+       if (SDL_Init(JIVE_SDL_FEATURES) < 0) {
                LOG_ERROR(log_ui_draw, "SDL_Init(V|T|A): %s\n", SDL_GetError());
                SDL_Quit();
                exit(-1);
        }
 
        /* report video info */
-       video_info = SDL_GetVideoInfo();
-       LOG_INFO(log_ui_draw, "%d,%d %d bits/pixel %d bytes/pixel [R<<%d G<<%d 
B<<%d]", video_info->current_w, video_info->current_h, 
video_info->vfmt->BitsPerPixel, video_info->vfmt->BytesPerPixel, 
video_info->vfmt->Rshift, video_info->vfmt->Gshift, video_info->vfmt->Bshift);
-       LOG_INFO(log_ui_draw, "Hardware acceleration %s available", 
video_info->hw_available?"is":"is not");
+       if ((video_info = SDL_GetVideoInfo())) {
+               LOG_INFO(log_ui_draw, "%d,%d %d bits/pixel %d bytes/pixel 
[R<<%d G<<%d B<<%d]", video_info->current_w, video_info->current_h, 
video_info->vfmt->BitsPerPixel, video_info->vfmt->BytesPerPixel, 
video_info->vfmt->Rshift, video_info->vfmt->Gshift, video_info->vfmt->Bshift);
+               LOG_INFO(log_ui_draw, "Hardware acceleration %s available", 
video_info->hw_available?"is":"is not");
+       }
 
        /* Register callback for additional events (used for multimedia keys)*/
        SDL_EventState(SDL_SYSWMEVENT,SDL_ENABLE);
        SDL_SetEventFilter(filter_events);
 
        platform_init(L);
+
+#ifndef JIVE_NO_DISPLAY
 
        /* open window */
        SDL_WM_SetCaption("SqueezePlay Beta", "SqueezePlay Beta");
@@ -267,6 +275,8 @@
 
        ui_watchdog = watchdog_get();
        watchdog_keepalive(ui_watchdog, 6); /* 60 seconds to start */
+
+#endif /* JIVE_NO_DISPLAY */
 
        return 0;
 }

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_surface.c
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_surface.c?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_surface.c (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/src/ui/jive_surface.c Mon Jun  7 
06:31:48 2010
@@ -6,6 +6,8 @@
 
 #include "common.h"
 #include "jive.h"
+
+#ifndef JIVE_NO_DISPLAY
 
 /*
  * This file combines both JiveSurface and JiveTile into a single 
implementation.
@@ -1640,3 +1642,139 @@
                          y3 + srf->offset_y,
                          col);
 }
+
+
+#else /* JIVE_NO_DISPLAY */
+
+#define DUMMY_SURFACE ((JiveTile *)1)
+#define IS_DUMMY_SURFACE(srf) ((srf) == DUMMY_SURFACE)
+
+JiveTile *jive_tile_fill_color(Uint32 col) {return DUMMY_SURFACE;}
+
+JiveTile *jive_tile_load_image(const char *path) {return path ? DUMMY_SURFACE 
: NULL;}
+
+JiveTile *jive_tile_load_image_data(const char *data, size_t len) {return 
DUMMY_SURFACE;}
+
+JiveTile *jive_tile_load_tiles(char *path[9]) {return DUMMY_SURFACE;}
+
+JiveTile *jive_tile_load_vtiles(char *path[3]) {return DUMMY_SURFACE;}
+
+JiveTile *jive_tile_load_htiles(char *path[3]) {return DUMMY_SURFACE;}
+
+JiveTile *jive_tile_ref(JiveTile *tile) {return tile;}
+
+void jive_tile_get_min_size(JiveTile *tile, Uint16 *w, Uint16 *h) {
+       if (w) *w = 1;
+       if (h) *h = 1;
+}
+
+void jive_tile_set_alpha(JiveTile *tile, Uint32 flags) {return;}
+
+void jive_tile_free(JiveTile *tile) {return;}
+
+/* this function must only be used for blitting tiles */
+void jive_surface_get_tile_blit(JiveSurface *srf, SDL_Surface **sdl, Sint16 
*x, Sint16 *y) {*x = *y = 1;}
+
+void jive_tile_blit(JiveTile *tile, JiveSurface *dst, Uint16 dx, Uint16 dy, 
Uint16 dw, Uint16 dh) {return;}
+
+void jive_tile_blit_centered(JiveTile *tile, JiveSurface *dst, Uint16 dx, 
Uint16 dy, Uint16 dw, Uint16 dh) {return;}
+
+JiveSurface *jive_surface_set_video_mode(Uint16 w, Uint16 h, Uint16 bpp, bool 
fullscreen) {return DUMMY_SURFACE;}
+
+JiveSurface *jive_surface_newRGB(Uint16 w, Uint16 h) {return DUMMY_SURFACE;}
+
+JiveSurface *jive_surface_newRGBA(Uint16 w, Uint16 h) {return DUMMY_SURFACE;}
+
+JiveSurface *jive_surface_new_SDLSurface(SDL_Surface *sdl_surface) {return 
DUMMY_SURFACE;}
+
+JiveSurface *jive_surface_ref(JiveSurface *srf) {return srf;}
+
+JiveSurface *jive_surface_load_image(const char *path) {return DUMMY_SURFACE;}
+
+JiveSurface *jive_surface_load_image_data(const char *data, size_t len) 
{return DUMMY_SURFACE;}
+
+int jive_surface_set_wm_icon(JiveSurface *srf) {return 1;}
+
+int jive_surface_save_bmp(JiveSurface *srf, const char *file) {return 0;}
+
+int jive_surface_cmp(JiveSurface *a, JiveSurface *b, Uint32 key) {return 0;}
+
+void jive_surface_get_offset(JiveSurface *srf, Sint16 *x, Sint16 *y) {*x = *y 
= 1;}
+
+void jive_surface_set_offset(JiveSurface *srf, Sint16 x, Sint16 y) {return;}
+
+void jive_surface_get_clip(JiveSurface *srf, SDL_Rect *r) {return;}
+
+void jive_surface_set_clip(JiveSurface *srf, SDL_Rect *r) {return;}
+
+void jive_surface_push_clip(JiveSurface *srf, SDL_Rect *r, SDL_Rect *pop) 
{return;}
+
+void jive_surface_set_clip_arg(JiveSurface *srf, Uint16 x, Uint16 y, Uint16 w, 
Uint16 h) {return;}
+
+void jive_surface_get_clip_arg(JiveSurface *srf, Uint16 *x, Uint16 *y, Uint16 
*w, Uint16 *h) {*x = *y = *h = *w = 1;}
+
+void jive_surface_flip(JiveSurface *srf) {return;}
+
+
+void jive_surface_blit(JiveSurface *src, JiveSurface *dst, Uint16 dx, Uint16 
dy) {return;}
+
+void jive_surface_blit_clip(JiveSurface *src, Uint16 sx, Uint16 sy, Uint16 sw, 
Uint16 sh,
+                         JiveSurface* dst, Uint16 dx, Uint16 dy) {return;}
+
+void jive_surface_blit_alpha(JiveSurface *src, JiveSurface *dst, Uint16 dx, 
Uint16 dy, Uint8 alpha) {return;}
+
+void jive_surface_get_size(JiveSurface *srf, Uint16 *w, Uint16 *h) {
+       if (w) *w = 1;
+       if (h) *h = 1;
+}
+
+int jive_surface_get_bytes(JiveSurface *srf) {return 0;}
+
+void jive_surface_free(JiveSurface *srf) {return;}
+
+void jive_surface_release(JiveSurface *srf) {return;}
+
+/* SDL_gfx encapsulated functions */
+JiveSurface *jive_surface_rotozoomSurface(JiveSurface *srf, double angle, 
double zoom, int smooth) {return srf;}
+
+JiveSurface *jive_surface_zoomSurface(JiveSurface *srf, double zoomx, double 
zoomy, int smooth) {return srf;}
+
+JiveSurface *jive_surface_shrinkSurface(JiveSurface *srf, int factorx, int 
factory) {return srf;}
+
+void jive_surface_pixelColor(JiveSurface *srf, Sint16 x, Sint16 y, Uint32 
color) {return;}
+
+void jive_surface_hlineColor(JiveSurface *srf, Sint16 x1, Sint16 x2, Sint16 y, 
Uint32 color) {return;}
+
+void jive_surface_vlineColor(JiveSurface *srf, Sint16 x, Sint16 y1, Sint16 y2, 
Uint32 color) {return;}
+
+void jive_surface_rectangleColor(JiveSurface *srf, Sint16 x1, Sint16 y1, 
Sint16 x2, Sint16 y2, Uint32 col) {return;}
+
+void jive_surface_boxColor(JiveSurface *srf, Sint16 x1, Sint16 y1, Sint16 x2, 
Sint16 y2, Uint32 col) {return;}
+
+void jive_surface_lineColor(JiveSurface *srf, Sint16 x1, Sint16 y1, Sint16 x2, 
Sint16 y2, Uint32 col) {return;}
+
+void jive_surface_aalineColor(JiveSurface *srf, Sint16 x1, Sint16 y1, Sint16 
x2, Sint16 y2, Uint32 col) {return;}
+
+void jive_surface_circleColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 r, 
Uint32 col) {return;}
+
+void jive_surface_aacircleColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 
r, Uint32 col) {return;}
+
+void jive_surface_filledCircleColor(JiveSurface *srf, Sint16 x, Sint16 y, 
Sint16 r, Uint32 col) {return;}
+
+void jive_surface_ellipseColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 
rx, Sint16 ry, Uint32 col) {return;}
+
+void jive_surface_aaellipseColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 
rx, Sint16 ry, Uint32 col) {return;}
+
+void jive_surface_filledEllipseColor(JiveSurface *srf, Sint16 x, Sint16 y, 
Sint16 rx, Sint16 ry, Uint32 col) {return;}
+
+void jive_surface_pieColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 rad, 
Sint16 start, Sint16 end, Uint32 col) {return;}
+
+void jive_surface_filledPieColor(JiveSurface *srf, Sint16 x, Sint16 y, Sint16 
rad, Sint16 start, Sint16 end, Uint32 col) {return;}
+
+void jive_surface_trigonColor(JiveSurface *srf, Sint16 x1, Sint16 y1, Sint16 
x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 col) {return;}
+
+void jive_surface_aatrigonColor(JiveSurface *srf, Sint16 x1, Sint16 y1, Sint16 
x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 col) {return;}
+
+void jive_surface_filledTrigonColor(JiveSurface *srf, Sint16 x1, Sint16 y1, 
Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 col) {return;}
+
+#endif /* JIVE_NO_DISPLAY */

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to