The Pedigree Project  0.1
objects.cc
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include "winman.h"
21 #include <errno.h>
22 #include <string.h>
23 #include <sys/klog.h>
24 #include <sys/socket.h>
25 #include <sys/un.h>
26 
27 #include <protocol.h>
28 
29 #include <pango/pangocairo.h>
30 
31 #include "util.h"
32 
33 static size_t g_nextContextId = 1;
34 
35 DirtyRectangle::DirtyRectangle() : m_X(~0), m_Y(~0), m_X2(0), m_Y2(0)
36 {
37 }
38 
39 DirtyRectangle::~DirtyRectangle()
40 {
41 }
42 
43 void DirtyRectangle::point(size_t x, size_t y)
44 {
45  if (x < m_X)
46  m_X = x;
47  if (x > m_X2)
48  m_X2 = x;
49 
50  if (y < m_Y)
51  m_Y = y;
52  if (y > m_Y2)
53  m_Y2 = y;
54 }
55 
56 void WObject::reposition(size_t x, size_t y, size_t w, size_t h)
57 {
58  if (x == ~0UL)
59  x = m_Dimensions.getX();
60  if (y == ~0UL)
61  y = m_Dimensions.getY();
62  if (w == ~0UL)
63  w = m_Dimensions.getW();
64  if (h == ~0UL)
65  h = m_Dimensions.getH();
66 
67  m_Dimensions.update(x, y, w, h);
68 
69  refreshContext();
70 }
71 
72 void WObject::bump(ssize_t bumpX, ssize_t bumpY)
73 {
74  size_t x = m_Dimensions.getX() + bumpX;
75  size_t y = m_Dimensions.getY() + bumpY;
76  size_t w = m_Dimensions.getW();
77  size_t h = m_Dimensions.getH();
78  m_Dimensions.update(x, y, w, h);
79 }
80 
81 Window::Window(
82  uint64_t handle, int sock, struct sockaddr *sa, size_t sa_len,
83  ::Container *pParent)
84  : m_Handle(handle), m_pParent(pParent), m_Framebuffer(0), m_Dirty(),
85  m_bPendingDecoration(false), m_bFocus(false), m_bRefresh(true),
86  m_nRegionWidth(0), m_nRegionHeight(0), m_Socket(sock), m_Sa(sa),
87  m_SaLen(sa_len)
88 {
89  refreshContext();
90  m_pParent->addChild(this);
91 }
92 
94 {
97 #ifdef TARGET_LINUX
98  delete m_Framebuffer;
99 #endif
100  delete m_Sa;
101 }
102 
104 {
105  PedigreeGraphics::Rect &me = getDimensions();
106  if (!m_bRefresh)
107  {
108  // Not refreshing context currently.
109  m_bPendingDecoration = true;
110  klog(LOG_DEBUG, "not refreshing context, marking for redecoration");
111  return;
112  }
113 
114  if ((me.getW() < WINDOW_CLIENT_LOST_W) ||
115  (me.getH() < WINDOW_CLIENT_LOST_H))
116  {
117  // We have some basic requirements for window sizes.
118  klog(
119  LOG_DEBUG, "extents %ux%u are too small for a new context",
120  me.getW(), me.getH());
121  return;
122  }
123 
124  klog(LOG_DEBUG, "destroying old framebuffer...");
125  delete m_Framebuffer;
126  m_Framebuffer = 0;
127  klog(LOG_DEBUG, "destroying old framebuffer complete");
128 
129  // Size of the IPC region we need to allocate.
130  size_t regionWidth = me.getW() - WINDOW_CLIENT_LOST_W;
131  size_t regionHeight = me.getH() - WINDOW_CLIENT_LOST_H;
132  int stride =
133  cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, regionWidth);
134  size_t regionSize = regionHeight * stride;
135  m_Framebuffer = new SharedBuffer(regionSize);
136  memset(m_Framebuffer->getBuffer(), 0, regionSize);
137 
138  klog(
139  LOG_DEBUG, "new framebuffer created: %zd bytes @%p", regionSize,
140  m_Framebuffer->getBuffer());
141 
142  m_nRegionWidth = regionWidth;
143  m_nRegionHeight = regionHeight;
144 
145  if ((m_Socket >= 0) && m_Framebuffer)
146  {
147  size_t totalSize = sizeof(LibUiProtocol::WindowManagerMessage) +
149  char *buffer = new char[totalSize];
150  memset(buffer, 0, totalSize);
151 
153  reinterpret_cast<LibUiProtocol::WindowManagerMessage *>(buffer);
154  pHeader->messageCode = LibUiProtocol::Reposition;
155  pHeader->widgetHandle = m_Handle;
157  pHeader->isResponse = false;
158 
159  LibUiProtocol::RepositionMessage *pReposition =
160  reinterpret_cast<LibUiProtocol::RepositionMessage *>(
161  buffer + sizeof(LibUiProtocol::WindowManagerMessage));
162  pReposition->rt.update(0, 0, regionWidth, regionHeight);
163  pReposition->shmem_handle = m_Framebuffer->getHandle();
164  pReposition->shmem_size = regionSize;
165 
166  // Transmit to the client.
167  sendMessage(buffer, totalSize);
168 
169  delete[] buffer;
170  }
171 
172  m_bPendingDecoration = true;
173 }
174 
175 void *Window::getFramebuffer() const
176 {
177  return m_Framebuffer ? m_Framebuffer->getBuffer() : 0;
178 }
179 
180 void Window::sendMessage(const char *msg, size_t len)
181 {
182  sendto(m_Socket, msg, len, 0, m_Sa, m_SaLen);
183 }
184 
185 void Window::setDirty(PedigreeGraphics::Rect &dirty)
186 {
187  PedigreeGraphics::Rect &me = getDimensions();
188 
189  size_t realX = dirty.getX();
190  size_t realY = dirty.getY();
191  size_t realW = dirty.getW();
192  size_t realH = dirty.getH();
193 
194  size_t clientW = me.getW() - WINDOW_CLIENT_LOST_W;
195  size_t clientH = me.getH() - WINDOW_CLIENT_LOST_H;
196 
197  if (realX > clientW || realY > clientH)
198  {
199  return;
200  }
201 
202  if ((realX + realW) > clientW)
203  {
204  realW = clientW - realX;
205  }
206 
207  if ((realY + realH) > clientH)
208  {
209  realH = clientH - realY;
210  }
211 
212  m_Dirty.update(
213  realX + WINDOW_CLIENT_START_X, realY + WINDOW_CLIENT_START_Y, realW,
214  realH);
215 }
216 
217 void Window::render(cairo_t *cr)
218 {
219  // Render pretty window frames.
220  PedigreeGraphics::Rect &me = getDimensions();
221  size_t x = me.getX() + WINDOW_BORDER_X;
222  size_t y = me.getY() + WINDOW_BORDER_Y;
223  size_t w = me.getW() - (WINDOW_BORDER_X * 2);
224  size_t h = me.getH() - (WINDOW_BORDER_Y * 2);
225 
226  // Draw the child framebuffer before window decorations.
227  void *pBuffer = getFramebuffer();
228  if (pBuffer && (isDirty() && m_bRefresh))
229  {
230  cairo_save(cr);
231  size_t regionWidth = m_nRegionWidth;
232  size_t regionHeight = m_nRegionHeight;
233  int stride =
234  cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, regionWidth);
235 
236  cairo_surface_t *surface = cairo_image_surface_create_for_data(
237  (uint8_t *) pBuffer, CAIRO_FORMAT_ARGB32, regionWidth, regionHeight,
238  stride);
239 
240  PedigreeGraphics::Rect realDirty = getDirty();
241  size_t dirtyX = realDirty.getX();
242  size_t dirtyY = realDirty.getY();
243  size_t dirtyWidth = realDirty.getW();
244  size_t dirtyHeight = realDirty.getH();
245 
246  // Adjust if the dirty rectangle is outside of the window area.
247  if (dirtyX < WINDOW_CLIENT_START_X)
248  {
249  dirtyX = WINDOW_CLIENT_START_X;
250  }
251  if (dirtyY < WINDOW_CLIENT_START_Y)
252  {
253  dirtyY = WINDOW_CLIENT_START_Y;
254  }
255  if ((dirtyX + dirtyWidth) > regionWidth)
256  {
257  dirtyWidth = regionWidth;
258  }
259  if ((dirtyY + dirtyHeight) > regionHeight)
260  {
261  dirtyHeight = regionHeight;
262  }
263 
264  // Fix the dirty rectangle after adjustments.
265  realDirty.update(dirtyX, dirtyY, dirtyWidth, dirtyHeight);
266 
267  cairo_set_source_surface(
268  cr, surface, me.getX() + WINDOW_CLIENT_START_X,
269  me.getY() + WINDOW_CLIENT_START_Y);
270 
271  // Clip to the dirty rectangle (don't update anything more)
272  cairo_rectangle(
273  cr, me.getX() + realDirty.getX(), me.getY() + realDirty.getY(),
274  realDirty.getW(), realDirty.getH());
275  cairo_clip(cr);
276 
277  // Clip to the window only (fixes rendering glitches during resize)
278  cairo_rectangle(
279  cr, me.getX() + WINDOW_CLIENT_START_X,
280  me.getY() + WINDOW_CLIENT_START_Y, me.getW() - WINDOW_CLIENT_LOST_W,
281  me.getH() - WINDOW_CLIENT_LOST_H);
282  cairo_clip(cr);
283 
284  // cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
285  cairo_paint(cr);
286 
287  cairo_surface_destroy(surface);
288  cairo_restore(cr);
289 
290  // No longer dirty - rendered.
291  m_Dirty.update(0, 0, 0, 0);
292 
293  // Send back a response to ACK any pending redraw that's waiting.
294  // We wait until after we perform the redraw to permit the client to
295  // continue, as it doesn't make sense for the client to keep hitting
296  // us with redraw messages when we aren't ready.
298  memset(&ackmsg, 0, sizeof(ackmsg));
299  ackmsg.messageCode = LibUiProtocol::RequestRedraw;
300  ackmsg.widgetHandle = m_Handle;
301  ackmsg.messageSize = 0;
302  ackmsg.isResponse = true;
303  sendMessage((const char *) &ackmsg, sizeof(ackmsg));
304  }
305 
306  if (m_bPendingDecoration)
307  {
308  double r = 0.0, g = 0.0, b = 0.0;
309  if (m_bFocus)
310  r = 1.0;
311  else if (m_pParent->getFocusWindow() == this)
312  r = 0.5;
313  else
314  r = g = b = 1.0;
315 
316  cairo_save(cr);
317 
318  PangoLayout *layout = pango_cairo_create_layout(cr);
319  PangoFontDescription *desc =
320  pango_font_description_from_string(WINMAN_PANGO_FONT);
321  pango_layout_set_font_description(layout, desc);
322  pango_font_description_free(desc);
323 
324  gchar *safe_markup = g_markup_escape_text(m_sWindowTitle.c_str(), -1);
325  pango_layout_set_markup(layout, safe_markup, -1);
326 
327  // Window title bar.
328  cairo_set_line_width(cr, 0);
329  cairo_set_source_rgba(cr, 0.2, 0.3, 0.3, 1.0);
330  cairo_rectangle(cr, x, y, w, WINDOW_TITLE_H);
331  cairo_fill(cr);
332 
333  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
334  cairo_set_source_rgba(cr, 0.7, 0.7, 0.7, 1.0);
335 
336  // Window title.
337  int width = 0, height = 0;
338  pango_layout_get_size(layout, &width, &height);
339  cairo_move_to(cr, x + ((w / 2) - ((width / PANGO_SCALE) / 2)), y);
340  pango_cairo_show_layout(cr, layout);
341 
342  // Window border.
343  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
344  cairo_set_source_rgba(cr, r, g, b, 1.0);
345  cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
346  cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER);
347  cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
348  cairo_set_line_width(cr, 1.0);
349 
350  cairo_rectangle(cr, x, y, w, h);
351  cairo_stroke(cr);
352 
353  g_object_unref(layout);
354  g_free(safe_markup);
355  cairo_restore(cr);
356  }
357 
358  m_bPendingDecoration = false;
359 }
360 
361 void Window::focus()
362 {
363  m_bFocus = true;
364  m_pParent->setFocusWindow(this);
365  m_bPendingDecoration = true;
366 
369  memset(pHeader, 0, sizeof(*pHeader));
370  pHeader->messageCode = LibUiProtocol::Focus;
371  pHeader->widgetHandle = m_Handle;
372  pHeader->messageSize = 0;
373  pHeader->isResponse = false;
374 
375  sendMessage((const char *) pHeader, sizeof(*pHeader));
376  delete pHeader;
377 }
378 
379 void Window::nofocus()
380 {
381  m_bFocus = false;
382  m_bPendingDecoration = true;
383 
386  memset(pHeader, 0, sizeof(*pHeader));
387  pHeader->messageCode = LibUiProtocol::NoFocus;
388  pHeader->widgetHandle = m_Handle;
389  pHeader->messageSize = 0;
390  pHeader->isResponse = false;
391 
392  sendMessage((const char *) pHeader, sizeof(*pHeader));
393  delete pHeader;
394 }
395 
396 void Window::resize(
397  ssize_t horizDistance, ssize_t vertDistance, WObject *pChild)
398 {
399  PedigreeGraphics::Rect &me = getDimensions();
400  size_t currentWidth = me.getW();
401  size_t currentHeight = me.getH();
402 
403  reposition(
404  me.getX(), me.getY(), currentWidth + horizDistance,
405  currentHeight + vertDistance);
406 
407  // Pass resize up to parent to arrange other tiles to resize around this
408  // one, as necessary.
409  m_pParent->resize(horizDistance, vertDistance, this);
410 
411  m_bPendingDecoration = true;
412 }
413 
415 {
416  if (m_Children.size() == 0)
417  {
418  klog(LOG_INFO, "winman: no children in container, no retile");
419  return;
420  }
421 
422  PedigreeGraphics::Rect &me = getDimensions();
423  size_t currentWidth = me.getW();
424  size_t currentHeight = me.getH();
425 
426  if (m_Layout == SideBySide)
427  {
428  size_t dividedW = currentWidth / m_Children.size();
429  size_t newX = me.getX();
430  size_t newY = me.getY();
431 
432  WObjectList_t::iterator it = m_Children.begin();
433  for (; it != m_Children.end(); ++it)
434  {
435  (*it)->reposition(newX, newY, dividedW, currentHeight);
436  newX += dividedW;
437  }
438  }
439  else if (m_Layout == Stacked)
440  {
441  size_t dividedH = currentHeight / m_Children.size();
442  size_t newX = me.getX();
443  size_t newY = me.getY();
444 
445  WObjectList_t::iterator it = m_Children.begin();
446  for (; it != m_Children.end(); ++it)
447  {
448  (*it)->reposition(newX, newY, currentWidth, dividedH);
449  newY += dividedH;
450  }
451  }
452 
453  // Retile child containers (reposition does not do that)
454  WObjectList_t::iterator it = m_Children.begin();
455  for (; it != m_Children.end(); ++it)
456  {
457  if ((*it)->getType() == WObject::Container ||
458  (*it)->getType() == WObject::Root)
459  {
460  Container *pContainer = static_cast<Container *>(*it);
461  pContainer->retile();
462  }
463  }
464 }
465 
467  ssize_t horizDistance, ssize_t vertDistance, WObject *pChild)
468 {
469  PedigreeGraphics::Rect &me = getDimensions();
470  size_t currentWidth = me.getW();
471  size_t currentHeight = me.getH();
472 
473  if (pChild)
474  {
475  ssize_t bumpX = horizDistance;
476  ssize_t bumpY = vertDistance;
477 
478  horizDistance = -horizDistance;
479  vertDistance = -vertDistance;
480 
481  WObjectList_t::iterator it = m_Children.begin();
482  bool bResize = false;
483  for (; it != m_Children.end(); ++it)
484  {
485  if (bResize)
486  {
487  (*it)->bump(bumpX, bumpY); // Bump X/Y co-ords.
488  (*it)->resize(horizDistance, vertDistance);
489  return; // Resize will cascade.
490  }
491 
492  if ((*it) == pChild)
493  {
494  bResize = true;
495  }
496  }
497 
498  if (!bResize)
499  klog(LOG_INFO, "winman: didn't find children for resize???");
500  }
501  else
502  {
503  reposition(
504  me.getX(), me.getY(), currentWidth + horizDistance,
505  currentHeight + vertDistance);
506 
507  if (m_Children.size())
508  {
509  // We need tiles to fill the space created by resizing.
510  // For most resizes, we'll be going one direction, but if
511  // we get resized vertically and horizontally, this handles
512  // that nicely.
513  // Is this right?
514  ssize_t extendW =
515  horizDistance / static_cast<ssize_t>(m_Children.size());
516  ssize_t extendH =
517  vertDistance / static_cast<ssize_t>(m_Children.size());
518 
519  // Resize children in the relevant direction for them.
520  WObjectList_t::iterator it = m_Children.begin();
521  size_t bumpX = 0;
522  for (; it != m_Children.end(); ++it)
523  {
524  if (m_Layout == Stacked)
525  {
526  (*it)->resize(horizDistance, extendH);
527  }
528  else if (m_Layout == SideBySide)
529  {
530  (*it)->bump(bumpX, 0);
531  (*it)->resize(extendW, vertDistance);
532 
533  bumpX += extendW;
534  }
535  }
536  }
537  }
538 
539  // Resize siblings.
540  if (m_pParent && ((m_pParent->getType() == WObject::Container) ||
541  m_pParent->getType() == WObject::Root))
542  {
543  Container *pContainer = static_cast<Container *>(m_pParent);
544 
545  pContainer->resize(
546  horizDistance, vertDistance, static_cast<WObject *>(this));
547  }
548 }
549 
550 void Container::render(cairo_t *cr)
551 {
552  WObjectList_t::iterator it = m_Children.begin();
553  for (; it != m_Children.end(); ++it)
554  {
555  if ((*it)->getType() == WObject::Container)
556  {
557  Container *pContainer = static_cast<Container *>(*it);
558  pContainer->render(cr);
559  }
560  else if ((*it)->getType() == WObject::Window)
561  {
562  ::Window *pWindow = static_cast<::Window *>(*it);
563  pWindow->render(cr);
564  }
565  }
566 }
567 
569 {
570  WObjectList_t::const_iterator it = m_Children.begin();
571  for (; it != m_Children.end(); ++it)
572  {
573  if ((*it) == pChild)
574  {
575  if (it == m_Children.begin())
576  {
577  break;
578  }
579 
580  --it;
581  return (*it);
582  }
583  }
584 
585  return 0;
586 }
587 
589 {
590  WObjectList_t::const_iterator it = m_Children.begin();
591  for (; it != m_Children.end(); ++it)
592  {
593  if ((*it) == pChild)
594  {
595  ++it;
596 
597  if (it == m_Children.end())
598  {
599  break;
600  }
601 
602  return (*it);
603  }
604  }
605 
606  return 0;
607 }
608 
610 {
611  return getLeftSibling(this);
612 }
613 
615 {
616  return getRightSibling(this);
617 }
618 
620 {
621  WObject *sibling = 0;
622  if (m_Layout == SideBySide)
623  {
624  WObject *sibling = getLeftSibling(obj);
625  if (sibling)
626  {
627  return sibling;
628  }
629  }
630 
631  // No sibling to the child. If we are inside a side-by-side layout,
632  // this could be trivial.
633  if (m_pParent && (m_pParent->getType() == WObject::Container))
634  {
635  const Container *pContainer = static_cast<const Container *>(m_pParent);
636  if (pContainer->getLayout() == SideBySide)
637  {
638  sibling = getLeftObject();
639  if (sibling)
640  {
641  return sibling;
642  }
643  }
644  }
645 
646  // Root has no parent.
647  if (getType() != WObject::Root)
648  {
649  const Container *pContainer = static_cast<const Container *>(m_pParent);
650  return pContainer->getLeft(this);
651  }
652 
653  return 0;
654 }
655 
657 {
658  WObject *sibling = 0;
659  if (m_Layout == SideBySide)
660  {
661  WObject *sibling = getRightSibling(obj);
662  if (sibling)
663  {
664  return sibling;
665  }
666  }
667 
668  // No sibling to the child. If we are inside a side-by-side layout,
669  // this could be trivial.
670  if (m_pParent && (m_pParent->getType() == WObject::Container))
671  {
672  const Container *pContainer = static_cast<const Container *>(m_pParent);
673  if (pContainer->getLayout() == SideBySide)
674  {
675  sibling = getRightObject();
676  if (sibling)
677  {
678  return sibling;
679  }
680  }
681  }
682 
683  // Root has no parent.
684  if (getType() != WObject::Root)
685  {
686  const Container *pContainer = static_cast<const Container *>(m_pParent);
687  return pContainer->getRight(this);
688  }
689 
690  return 0;
691 }
692 
693 WObject *Container::getUp(const WObject *obj) const
694 {
695  WObject *sibling = 0;
696  if (m_Layout == Stacked)
697  {
698  WObject *sibling = getLeftSibling(obj);
699  if (sibling)
700  {
701  return sibling;
702  }
703  }
704 
705  // No sibling to the child. If we are inside a stacked layout,
706  // this could be trivial.
707  if (m_pParent && (m_pParent->getType() == WObject::Container))
708  {
709  const Container *pContainer = static_cast<const Container *>(m_pParent);
710  if (pContainer->getLayout() == Stacked)
711  {
712  sibling = getLeftObject();
713  if (sibling)
714  {
715  return sibling;
716  }
717  }
718  }
719 
720  // Root has no parent.
721  if (getType() != WObject::Root)
722  {
723  const Container *pContainer = static_cast<const Container *>(m_pParent);
724  return pContainer->getUp(this);
725  }
726 
727  return 0;
728 }
729 
731 {
732  WObject *sibling = 0;
733  if (m_Layout == Stacked)
734  {
735  WObject *sibling = getRightSibling(obj);
736  if (sibling)
737  {
738  return sibling;
739  }
740  }
741 
742  // No sibling to the child. If we are inside a stacked layout,
743  // this could be trivial.
744  if (m_pParent && (m_pParent->getType() == WObject::Container))
745  {
746  const Container *pContainer = static_cast<const Container *>(m_pParent);
747  if (pContainer->getLayout() == Stacked)
748  {
749  sibling = getRightObject();
750  if (sibling)
751  {
752  return sibling;
753  }
754  }
755  }
756 
757  // Root has no parent.
758  if (getType() != WObject::Root)
759  {
760  const Container *pContainer = static_cast<const Container *>(m_pParent);
761  return pContainer->getDown(this);
762  }
763 
764  return 0;
765 }
766 
768  ssize_t horizDistance, ssize_t vertDistance, WObject *pChild)
769 {
770  if (pChild)
771  {
772  // Use the Container implementation to resize siblings of the
773  // child that we've been passed.
774  Container::resize(horizDistance, vertDistance, pChild);
775  }
776 }
777 
780 {
781  WObjectList_t::const_iterator it = m_Children.begin();
782  for (; it != m_Children.end(); ++it)
783  {
784  (*it)->norefresh();
785  }
786 }
787 
790 {
791  WObjectList_t::const_iterator it = m_Children.begin();
792  for (; it != m_Children.end(); ++it)
793  {
794  (*it)->yesrefresh();
795  }
796 }
PedigreeGraphics::Rect rt
New rect.
Definition: protocol.h:219
WObject * getRightSibling(const WObject *pChild) const
Definition: objects.cc:588
virtual void yesrefresh()
Refresh context on every reposition.
Definition: objects.cc:789
Definition: winman.h:195
void * shmem_handle
New handle for the shared memory space.
Definition: protocol.h:222
WObject * getLeftSibling(const WObject *pChild) const
Definition: objects.cc:568
WObject * getDown(const WObject *obj) const
Definition: objects.cc:730
virtual void refreshContext()
Refresh our graphical context, called after reposition.
Definition: objects.cc:103
Abstracts a buffer shared between multiple processes.
Definition: util.h:33
handle_t widgetHandle
Handle for the widget being referred to. Zero if no widget.
Definition: protocol.h:171
void retile()
Definition: objects.cc:414
size_t messageSize
Size of the data in the message (after this header).
Definition: protocol.h:174
WObject * getRight(const WObject *obj) const
Definition: objects.cc:656
size_t shmem_size
Size of the framebuffer.
Definition: protocol.h:225
virtual ~Window()
Definition: objects.cc:93
void render(cairo_t *cr)
Definition: objects.cc:550
WObject * getLeft(const WObject *obj) const
Definition: objects.cc:619
MessageIdentifiers messageCode
Code of the message being sent.
Definition: protocol.h:168
virtual void norefresh()
Don&#39;t refresh the context on every reposition.
Definition: objects.cc:779
virtual void resize(ssize_t horizDistance, ssize_t vertDistance, WObject *pChild=0)
Definition: objects.cc:767
virtual void resize(ssize_t horizDistance, ssize_t vertDistance, WObject *pChild=0)
Definition: objects.cc:466
WObject * getUp(const WObject *obj) const
Definition: objects.cc:693
WObject * getRightObject() const
Definition: objects.cc:614
bool isResponse
Whether this message is a response from the window manager or not.
Definition: protocol.h:177
WObject * getLeftObject() const
Definition: objects.cc:609