| 28 | { |
| 29 | public: |
| 30 | InfoExampleUI() |
| 31 | : UI(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT), |
| 32 | fSampleRate(getSampleRate()), |
| 33 | fResizable(isResizable()), |
| 34 | fScale(1.0f), |
| 35 | fScaleFactor(getScaleFactor()), |
| 36 | fResizeHandle(this) |
| 37 | { |
| 38 | std::memset(fParameters, 0, sizeof(float)*kParameterCount); |
| 39 | std::memset(fStrBuf, 0, sizeof(char)*(0xff+1)); |
| 40 | |
| 41 | #ifdef DGL_NO_SHARED_RESOURCES |
| 42 | createFontFromFile("sans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"); |
| 43 | #else |
| 44 | loadSharedResources(); |
| 45 | #endif |
| 46 | |
| 47 | if (d_isNotEqual(fScaleFactor, 1.0)) |
| 48 | { |
| 49 | const uint width = DISTRHO_UI_DEFAULT_WIDTH * fScaleFactor; |
| 50 | const uint height = DISTRHO_UI_DEFAULT_HEIGHT * fScaleFactor; |
| 51 | setGeometryConstraints(width, height, true); |
| 52 | setSize(width, height); |
| 53 | } |
| 54 | else |
| 55 | { |
| 56 | setGeometryConstraints(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT, true); |
| 57 | } |
| 58 | |
| 59 | // no need to show resize handle if window is user-resizable |
| 60 | if (fResizable) |
| 61 | fResizeHandle.hide(); |
| 62 | } |
| 63 | |
| 64 | protected: |
| 65 | /* -------------------------------------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected