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 {
67 kBorderMaximizeButton,
71 kWindowModeDynamicScrollbar = 1 << 0
74 using namespace MacWindowConstants;
114 virtual void setVisible(
bool visible,
bool silent =
false);
147 virtual bool draw(
bool forceRedraw =
false) = 0;
156 virtual bool draw(
ManagedSurface *g,
bool forceRedraw =
false) = 0;
170 virtual bool isDirty() = 0;
232 void move(
int x,
int y);
239 virtual void resize(
int w,
int h);
246 virtual void resizeInner(
int w,
int h);
268 void setBackgroundPattern(
int pattern);
277 bool draw(
bool forceRedraw =
false)
override;
287 void center(
bool toCenter =
true);
294 void setActive(
bool active)
override;
299 bool isActive()
const;
311 virtual void setTitleVisible(
bool visible);
316 bool isTitleVisible();
329 void setHighlight(WindowClick highlightedPart);
335 void setScroll(
float scrollPos,
float scrollSize);
340 bool hasAllFocus()
override {
return _beingDragged || _beingResized; }
356 void disableBorder();
357 void loadInternalBorder(uint32 flags);
368 void setCloseable(
bool closeable);
374 void setBorderType(
int borderType);
386 uint32 getBorderFlags()
const;
390 void mergeDirtyRects();
392 void clearDirtyRects() { _dirtyRects.clear(); }
395 bool isDirty()
override {
return _borderIsDirty || _contentIsDirty; }
397 void setBorderDirty(
bool dirty) { _borderIsDirty =
true; }
398 void setContentDirty(
bool dirty) { _contentIsDirty =
true; }
399 void resizeBorderSurface();
401 void setMode(uint32 mode) { _mode = mode; }
402 void setBorderOffsets(
BorderOffsets &offsets) { _macBorder.setOffsets(offsets); }
403 const BorderOffsets &getBorderOffsets()
const {
return _macBorder.getOffset(); }
405 void updateInnerDims();
408 void rebuildSurface();
412 void fillRect(
ManagedSurface *g,
int x,
int y,
int w,
int h,
int color);
413 const Font *getTitleFont();
414 void updateOuterDims();
416 bool isInCloseButton(
int x,
int y)
const;
417 bool isInResizeButton(
int x,
int y)
const;
418 WindowClick isInScroll(
int x,
int y)
const;
422 WindowClick isInBorder(
int x,
int y)
const;
444 bool _isTitleVisible;
448 bool _beingDragged, _beingResized;
449 int _draggedX, _draggedY;
451 WindowClick _highlightedPart;
Definition: managed_surface.h:51
const Common::String & getTitle() const
Definition: macwindow.h:322
Definition: macwindow.h:205
int getBorderType() const
Definition: macwindow.h:379
ManagedSurface * getWindowSurface()
Definition: macwindow.h:125
void setCallback(bool(*callback)(WindowClick, Common::Event &, void *), void *data)
Definition: macwindow.h:179
Definition: macwindowmanager.h:147
Definition: macwindowborder.h:57
ManagedSurface * getBorderSurface() override
Definition: macwindow.h:281
const Common::Rect & getInnerDimensions() override
Definition: macwindow.h:280
Definition: formatinfo.h:28
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
bool isEditable()
Definition: macwindow.h:108
int getId()
Definition: macwindow.h:95
WindowType getType()
Definition: macwindow.h:102
bool isDirty() override
Definition: macwindow.h:395
void setDraggable(bool draggable)
Definition: macwindow.h:185
void enableScrollbar(bool active)
Definition: macwindow.h:362
Definition: macwindow.h:80
Definition: macwindowborder.h:81