22 #ifndef GRAPHICS_MACGUI_MACWINDOW_H 23 #define GRAPHICS_MACGUI_MACWINDOW_H 25 #include "common/stream.h" 27 #include "graphics/managed_surface.h" 28 #include "graphics/nine_patch.h" 29 #include "graphics/font.h" 31 #include "graphics/macgui/macwidget.h" 32 #include "graphics/macgui/macwindowborder.h" 36 class MacWindowManager;
37 class MacWindowBorder;
40 namespace MacWindowConstants {
64 kWindowModeDynamicScrollbar = 1 << 0
67 using namespace MacWindowConstants;
107 virtual void setVisible(
bool visible,
bool silent =
false);
140 virtual bool draw(
bool forceRedraw =
false) = 0;
149 virtual bool draw(
ManagedSurface *g,
bool forceRedraw =
false) = 0;
163 virtual bool isDirty() = 0;
212 void move(
int x,
int y);
219 virtual void resize(
int w,
int h);
226 virtual void resizeInner(
int w,
int h);
248 void setBackgroundPattern(
int pattern);
257 bool draw(
bool forceRedraw =
false)
override;
267 void center(
bool toCenter =
true);
274 void setActive(
bool active)
override;
279 bool isActive()
const;
291 virtual void setTitleVisible(
bool visible);
296 bool isTitleVisible();
309 void setHighlight(WindowClick highlightedPart);
315 void setScroll(
float scrollPos,
float scrollSize);
320 bool hasAllFocus()
override {
return _beingDragged || _beingResized; }
336 void disableBorder();
337 void loadInternalBorder(uint32 flags);
348 void setCloseable(
bool closeable);
354 void setBorderType(
int borderType);
366 uint32 getBorderFlags()
const;
370 void mergeDirtyRects();
372 bool isDirty()
override {
return _borderIsDirty || _contentIsDirty; }
374 void setBorderDirty(
bool dirty) { _borderIsDirty =
true; }
375 void resizeBorderSurface();
377 void setMode(uint32 mode) { _mode = mode; }
378 void setBorderOffsets(
BorderOffsets &offsets) { _macBorder.setOffsets(offsets); }
380 void updateInnerDims();
383 void rebuildSurface();
387 void fillRect(
ManagedSurface *g,
int x,
int y,
int w,
int h,
int color);
388 const Font *getTitleFont();
389 void updateOuterDims();
391 bool isInCloseButton(
int x,
int y)
const;
392 bool isInResizeButton(
int x,
int y)
const;
393 WindowClick isInScroll(
int x,
int y)
const;
397 WindowClick isInBorder(
int x,
int y)
const;
398 BorderOffsets getBorderOffsets()
const {
return _macBorder.getOffset(); }
420 bool _isTitleVisible;
424 bool _beingDragged, _beingResized;
425 int _draggedX, _draggedY;
427 WindowClick _highlightedPart;
Definition: managed_surface.h:51
const Common::String & getTitle() const
Definition: macwindow.h:302
Definition: macwindow.h:192
int getBorderType() const
Definition: macwindow.h:359
ManagedSurface * getWindowSurface()
Definition: macwindow.h:118
void setCallback(bool(*callback)(WindowClick, Common::Event &, void *), void *data)
Definition: macwindow.h:172
Definition: macwindowmanager.h:149
Definition: macwindowborder.h:57
ManagedSurface * getBorderSurface() override
Definition: macwindow.h:261
const Common::Rect & getInnerDimensions() override
Definition: macwindow.h:260
Definition: formatinfo.h:28
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
bool isEditable()
Definition: macwindow.h:101
int getId()
Definition: macwindow.h:88
WindowType getType()
Definition: macwindow.h:95
bool isDirty() override
Definition: macwindow.h:372
void enableScrollbar(bool active)
Definition: macwindow.h:342
Definition: macwindow.h:73
Definition: macwindowborder.h:75