1 /** ************************************************************************** 2 \file GUI_render.h 3 \brief Lib to draw stuff on screen. 4 copyright : (C) 2001--2008 by mean 5 email : fixounet@free.fr 6 ***************************************************************************/ 7 8 /*************************************************************************** 9 * * 10 * This program is free software; you can redistribute it and/or modify * 11 * it under the terms of the GNU General Public License as published by * 12 * the Free Software Foundation; either version 2 of the License, or * 13 * (at your option) any later version. * 14 * * 15 ***************************************************************************/ 16 17 18 #ifndef GUI_RENDER_H 19 #define GUI_RENDER_H 20 21 #include "ADM_render6_export.h" 22 #include "ADM_image.h" 23 typedef bool (*refreshSB)(void); 24 #include "ADM_windowInfo.h" 25 #include <string> 26 27 #define ZOOM_AUTO -1. 28 #define ZOOM_1_4 0.25 29 #define ZOOM_1_2 0.5 30 #define ZOOM_1_1 1. 31 32 ADM_RENDER6_EXPORT uint8_t renderInit( void ); 33 ADM_RENDER6_EXPORT void renderDestroy(void); 34 ADM_RENDER6_EXPORT uint8_t renderDisplayResize(uint32_t w, uint32_t h, float zoom); 35 uint8_t renderRefresh(void); 36 ADM_RENDER6_EXPORT uint8_t renderExpose(void); 37 ADM_RENDER6_EXPORT uint8_t renderUpdateImage(ADMImage *img); 38 uint8_t renderUpdateImageBlit(uint8_t *ptr,uint32_t startx, uint32_t starty, uint32_t w, uint32_t,uint32_t primary); 39 bool renderCompleteRedrawRequest(void); // will call admPreview 40 ADM_RENDER6_EXPORT uint8_t renderStartPlaying( void ); 41 ADM_RENDER6_EXPORT uint8_t renderStopPlaying( void ); 42 ADM_RENDER6_EXPORT bool renderExposeEventFromUI(void); // This is called by UI, return true if UI should redraw, false else 43 ADM_RENDER6_EXPORT ADM_HW_IMAGE renderGetPreferedImageFormat(void); 44 ADM_RENDER6_EXPORT uint8_t renderLock(void); 45 ADM_RENDER6_EXPORT uint8_t renderUnlock(void); 46 ADM_RENDER6_EXPORT bool renderHookRefreshRequest(refreshSB cb); 47 ADM_RENDER6_EXPORT void renderGetName(std::string &name); 48 ADM_RENDER6_EXPORT bool renderClearInstance(void); 49 50 51 /* These functions are trampolined through render as they are UI dependant */ 52 53 void *UI_getDrawWidget(void); 54 void UI_rgbDraw(void *widg,uint32_t w, uint32_t h,uint8_t *ptr); 55 void UI_updateDrawWindowSize(void *win,uint32_t w,uint32_t h); 56 void UI_getWindowInfo(void *draw, GUI_WindowInfo *xinfo); 57 void UI_resize(uint32_t width, uint32_t height); 58 bool UI_getNeedsResizingFlag(void); 59 void UI_setNeedsResizingFlag(bool resize); 60 void UI_setBlockZoomChangesFlag(bool block); 61 void UI_resetZoomThreshold(void); 62 void UI_setZoomToFitIntoWindow(void); 63 64 /* The list of render engine we support. Warning the list is UI dependant, i.e. for example on macOsX, the GTK version can do Xv, but the QT4 one cannot */ 65 typedef enum 66 { 67 RENDER_GTK=0, 68 #ifdef USE_XV 69 RENDER_XV=1, 70 #endif 71 72 #ifdef USE_SDL 73 RENDER_SDL=2, 74 75 #ifdef _WIN32 76 RENDER_DIRECTX=3, 77 #endif 78 #endif 79 #ifdef USE_VDPAU 80 RENDER_VDPAU=4, 81 82 #endif 83 #ifdef USE_OPENGL 84 RENDER_QTOPENGL=5, 85 #endif 86 #ifdef USE_LIBVA 87 RENDER_LIBVA=6, 88 #endif 89 #ifdef USE_DXVA2 90 RENDER_DXVA2=6, 91 #endif //USE_DXVA2 92 93 RENDER_LAST 94 95 96 }ADM_RENDER_TYPE; 97 98 #endif 99