1/* 2 * Copyright 2012, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef UI_UTILS_H 6#define UI_UTILS_H 7 8#include <size_t.h> 9 10#include <image.h> 11 12#include "Types.h" 13 14 15class BString; 16class BVariant; 17class StackFrame; 18class Team; 19class TeamMemoryBlock; 20class ValueNodeChild; 21 22 23class UiUtils { 24public: 25 static const char* ThreadStateToString(int state, 26 int stoppedReason); 27 28 static const char* VariantToString(const BVariant& value, 29 char* buffer, size_t bufferSize); 30 static const char* FunctionNameForFrame(StackFrame* frame, 31 char* buffer, size_t bufferSize); 32 static const char* ImageTypeToString(image_type type, 33 char* buffer, size_t bufferSize); 34 35 static const char* ReportNameForTeam(::Team* team, 36 char* buffer, size_t bufferSize); 37 38 // this function assumes the value nodes have already been resolved 39 // (if possible). 40 static void PrintValueNodeGraph(BString& _output, 41 ValueNodeChild* child, 42 int32 indentLevel, int32 maxDepth); 43 44 static void DumpMemory(BString& _output, 45 int32 indentLevel, 46 TeamMemoryBlock* block, 47 target_addr_t address, int32 itemSize, 48 int32 displayWidth, int32 count); 49}; 50 51 52#endif // UI_UTILS_H 53