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 {
65 kBorderMaximizeButton,
69 kWindowModeDynamicScrollbar = 1 << 0
72 using namespace MacWindowConstants;
112 virtual void setVisible(
bool visible,
bool silent =
false);
145 virtual bool draw(
bool forceRedraw =
false) = 0;
154 virtual bool draw(
ManagedSurface *g,
bool forceRedraw =
false) = 0;
168 virtual bool isDirty() = 0;
230 void move(
int x,
int y);
237 virtual void resize(
int w,
int h);
244 virtual void resizeInner(
int w,
int h);
266 void setBackgroundPattern(
int pattern);
275 bool draw(
bool forceRedraw =
false)
override;
285 void center(
bool toCenter =
true);
292 void setActive(
bool active)
override;
297 bool isActive()
const;
309 virtual void setTitleVisible(
bool visible);
314 bool isTitleVisible();
327 void setHighlight(WindowClick highlightedPart);
333 void setScroll(
float scrollPos,
float scrollSize);
338 bool hasAllFocus()
override {
return _beingDragged || _beingResized; }
354 void disableBorder();
355 void loadInternalBorder(uint32 flags);
366 void setCloseable(
bool closeable);
372 void setBorderType(
int borderType);
384 uint32 getBorderFlags()
const;
388 void mergeDirtyRects();
390 void clearDirtyRects() { _dirtyRects.clear(); }
393 bool isDirty()
override {
return _borderIsDirty || _contentIsDirty; }
395 void setBorderDirty(
bool dirty) { _borderIsDirty =
true; }
396 void setContentDirty(
bool dirty) { _contentIsDirty =
true; }
397 void resizeBorderSurface();
399 void setMode(uint32 mode) { _mode = mode; }
400 void setBorderOffsets(
BorderOffsets &offsets) { _macBorder.setOffsets(offsets); }
402 void updateInnerDims();
405 void rebuildSurface();
409 void fillRect(
ManagedSurface *g,
int x,
int y,
int w,
int h,
int color);
410 const Font *getTitleFont();
411 void updateOuterDims();
413 bool isInCloseButton(
int x,
int y)
const;
414 bool isInResizeButton(
int x,
int y)
const;
415 WindowClick isInScroll(
int x,
int y)
const;
419 WindowClick isInBorder(
int x,
int y)
const;
420 const BorderOffsets &getBorderOffsets()
const {
return _macBorder.getOffset(); }
442 bool _isTitleVisible;
446 bool _beingDragged, _beingResized;
447 int _draggedX, _draggedY;
449 WindowClick _highlightedPart;
Definition: managed_surface.h:51
const Common::String & getTitle() const
Definition: macwindow.h:320
Definition: macwindow.h:203
int getBorderType() const
Definition: macwindow.h:377
ManagedSurface * getWindowSurface()
Definition: macwindow.h:123
void setCallback(bool(*callback)(WindowClick, Common::Event &, void *), void *data)
Definition: macwindow.h:177
Definition: macwindowmanager.h:147
Definition: macwindowborder.h:57
ManagedSurface * getBorderSurface() override
Definition: macwindow.h:279
const Common::Rect & getInnerDimensions() override
Definition: macwindow.h:278
Definition: formatinfo.h:28
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
bool isEditable()
Definition: macwindow.h:106
int getId()
Definition: macwindow.h:93
WindowType getType()
Definition: macwindow.h:100
bool isDirty() override
Definition: macwindow.h:393
void setDraggable(bool draggable)
Definition: macwindow.h:183
void enableScrollbar(bool active)
Definition: macwindow.h:360
Definition: macwindow.h:78
Definition: macwindowborder.h:80