pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntbox.c
Go to the documentation of this file.
1 
23 #include "gntinternal.h"
24 #include "gntbox.h"
25 #include "gntstyle.h"
26 #include "gntutils.h"
27 
28 #include <string.h>
29 
30 #define PROP_LAST_RESIZE_S "last-resize"
31 #define PROP_SIZE_QUEUED_S "size-queued"
32 
33 enum
34 {
37  PROP_HOMO /* ... */
38 };
39 
40 enum
41 {
42  SIGS = 1,
43 };
44 
46 
48 
49 static void
50 add_to_focus(gpointer value, gpointer data)
51 {
52  GntBox *box = GNT_BOX(data);
54 
55  if (GNT_IS_BOX(w))
56  g_list_foreach(GNT_BOX(w)->list, add_to_focus, box);
58  box->focus = g_list_append(box->focus, w);
59 }
60 
61 static void
62 get_title_thingies(GntBox *box, char *title, int *p, int *r)
63 {
64  GntWidget *widget = GNT_WIDGET(box);
65  int len;
66  char *end = (char*)gnt_util_onscreen_width_to_pointer(title, widget->priv.width - 4, &len);
67 
68  if (p)
69  *p = (widget->priv.width - len) / 2;
70  if (r)
71  *r = (widget->priv.width + len) / 2;
72  *end = '\0';
73 }
74 
75 static void
77 {
78  GntBox *box = GNT_BOX(widget);
79 
80  if (box->focus == NULL && widget->parent == NULL)
81  g_list_foreach(box->list, add_to_focus, box);
82 
83  g_list_foreach(box->list, (GFunc)gnt_widget_draw, NULL);
84 
86  {
87  int pos, right;
88  char *title = g_strdup(box->title);
89 
90  get_title_thingies(box, title, &pos, &right);
91 
93  wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE));
94  else
95  wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE_D));
96  mvwaddch(widget->window, 0, pos-1, ACS_RTEE | gnt_color_pair(GNT_COLOR_NORMAL));
97  mvwaddstr(widget->window, 0, pos, C_(title));
98  mvwaddch(widget->window, 0, right, ACS_LTEE | gnt_color_pair(GNT_COLOR_NORMAL));
99  g_free(title);
100  }
101 
103 }
104 
105 static void
107 {
108  GList *iter;
109  GntBox *box = GNT_BOX(widget);
110  int w, h, curx, cury, max;
111  gboolean has_border = FALSE;
112 
113  w = h = 0;
114  max = 0;
115  curx = widget->priv.x;
116  cury = widget->priv.y;
118  {
119  has_border = TRUE;
120  curx += 1;
121  cury += 1;
122  }
123 
124  for (iter = box->list; iter; iter = iter->next)
125  {
127  continue;
128  gnt_widget_set_position(GNT_WIDGET(iter->data), curx, cury);
129  gnt_widget_get_size(GNT_WIDGET(iter->data), &w, &h);
130  if (box->vertical)
131  {
132  if (h)
133  {
134  cury += h + box->pad;
135  if (max < w)
136  max = w;
137  }
138  }
139  else
140  {
141  if (w)
142  {
143  curx += w + box->pad;
144  if (max < h)
145  max = h;
146  }
147  }
148  }
149 
150  if (has_border)
151  {
152  curx += 1;
153  cury += 1;
154  max += 2;
155  }
156 
157  if (box->list)
158  {
159  if (box->vertical)
160  cury -= box->pad;
161  else
162  curx -= box->pad;
163  }
164 
165  if (box->vertical)
166  {
167  widget->priv.width = max;
168  widget->priv.height = cury - widget->priv.y;
169  }
170  else
171  {
172  widget->priv.width = curx - widget->priv.x;
173  widget->priv.height = max;
174  }
175 }
176 
177 static void
179 {
180  GList *iter;
181  int changex, changey;
182 
183  changex = widget->priv.x - x;
184  changey = widget->priv.y - y;
185 
186  for (iter = GNT_BOX(widget)->list; iter; iter = iter->next)
187  {
188  GntWidget *w = GNT_WIDGET(iter->data);
189  gnt_widget_set_position(w, w->priv.x - changex,
190  w->priv.y - changey);
191  }
192 }
193 
194 static void
196 {
197  GntBox *box = GNT_BOX(widget);
198  GList *iter;
199  int maxw = 0, maxh = 0;
200 
201  g_list_foreach(box->list, (GFunc)gnt_widget_size_request, NULL);
202 
203  for (iter = box->list; iter; iter = iter->next)
204  {
205  int w, h;
206  gnt_widget_get_size(GNT_WIDGET(iter->data), &w, &h);
207  if (maxh < h)
208  maxh = h;
209  if (maxw < w)
210  maxw = w;
211  }
212 
213  for (iter = box->list; iter; iter = iter->next)
214  {
215  int w, h;
216  GntWidget *wid = GNT_WIDGET(iter->data);
217 
218  gnt_widget_get_size(wid, &w, &h);
219 
220  if (box->homogeneous)
221  {
222  if (box->vertical)
223  h = maxh;
224  else
225  w = maxw;
226  }
227  if (box->fill)
228  {
229  if (box->vertical)
230  w = maxw;
231  else
232  h = maxh;
233  }
234 
235  if (gnt_widget_confirm_size(wid, w, h))
236  gnt_widget_set_size(wid, w, h);
237  }
238 
240 }
241 
242 static void
244 {
245  if (widget->priv.width == 0 || widget->priv.height == 0)
246  {
249  }
250  GNTDEBUG;
251 }
252 
253 /* Ensures that the current widget can take focus */
254 static GntWidget *
256 {
257  /* XXX: Make sure the widget is visible? */
258  if (box->focus == NULL && GNT_WIDGET(box)->parent == NULL)
259  g_list_foreach(box->list, add_to_focus, box);
260 
261  if (box->active == NULL && box->focus)
262  box->active = box->focus->data;
263 
264  return box->active;
265 }
266 
267 static void
269 {
270  gpointer last = box->active;
271  do
272  {
273  GList *iter = g_list_find(box->focus, box->active);
274  if (iter && iter->next)
275  box->active = iter->next->data;
276  else if (box->focus)
277  box->active = box->focus->data;
280  break;
281  } while (box->active != last);
282 }
283 
284 static void
286 {
287  gpointer last = box->active;
288 
289  if (!box->focus)
290  return;
291 
292  do
293  {
294  GList *iter = g_list_find(box->focus, box->active);
295  if (!iter)
296  box->active = box->focus->data;
297  else if (!iter->prev)
298  box->active = g_list_last(box->focus)->data;
299  else
300  box->active = iter->prev->data;
302  break;
303  } while (box->active != last);
304 }
305 
306 static gboolean
308 {
309  GntBox *box = GNT_BOX(widget);
310  gboolean ret;
311 
313  return FALSE;
314 
315  if (box->active == NULL && !find_focusable_widget(box))
316  return FALSE;
317 
319  return TRUE;
320 
321  /* This dance is necessary to make sure that the child widgets get a chance
322  to trigger their bindings first */
326  return ret;
327 }
328 
329 static gboolean
330 box_focus_change(GntBox *box, gboolean next)
331 {
332  GntWidget *now;
333  now = box->active;
334 
335  if (next) {
336  find_next_focus(box);
337  } else {
338  find_prev_focus(box);
339  }
340 
341  if (now && now != box->active) {
344  return TRUE;
345  }
346 
347  return FALSE;
348 }
349 
350 static gboolean
351 action_focus_next(GntBindable *bindable, GList *null)
352 {
353  return box_focus_change(GNT_BOX(bindable), TRUE);
354 }
355 
356 static gboolean
357 action_focus_prev(GntBindable *bindable, GList *null)
358 {
359  return box_focus_change(GNT_BOX(bindable), FALSE);
360 }
361 
362 static void
364 {
365  GntWidget *w = GNT_BOX(widget)->active;
366  if (w)
369 }
370 
371 static void
373 {
374  GntWidget *w = GNT_BOX(widget)->active;
375  if (w)
378 }
379 
380 static void
382 {
383  GntBox *box = GNT_BOX(w);
384 
385  gnt_box_remove_all(box);
387 }
388 
389 static void
390 gnt_box_expose(GntWidget *widget, int x, int y, int width, int height)
391 {
392  WINDOW *win = newwin(height, width, widget->priv.y + y, widget->priv.x + x);
393  copywin(widget->window, win, y, x, 0, 0, height - 1, width - 1, FALSE);
394  wrefresh(win);
395  delwin(win);
396 }
397 
398 static gboolean
399 gnt_box_confirm_size(GntWidget *widget, int width, int height)
400 {
401  GList *iter;
402  GntBox *box = GNT_BOX(widget);
403  int wchange, hchange;
404  GntWidget *child, *last;
405 
406  if (!box->list)
407  return TRUE;
408 
409  wchange = widget->priv.width - width;
410  hchange = widget->priv.height - height;
411 
412  if (wchange == 0 && hchange == 0)
413  return TRUE; /* Quit playing games with my size */
414 
415  child = NULL;
416  last = g_object_get_data(G_OBJECT(box), PROP_LAST_RESIZE_S);
417 
418  /* First, make sure all the widgets will fit into the box after resizing. */
419  for (iter = box->list; iter; iter = iter->next) {
420  GntWidget *wid = iter->data;
421  int w, h;
422 
423  gnt_widget_get_size(wid, &w, &h);
424 
425  if (wid != last && !child && w > 0 && h > 0 &&
427  gnt_widget_confirm_size(wid, w - wchange, h - hchange)) {
428  child = wid;
429  break;
430  }
431  }
432 
433  if (!child && (child = last)) {
434  int w, h;
435  gnt_widget_get_size(child, &w, &h);
436  if (!gnt_widget_confirm_size(child, w - wchange, h - hchange))
437  child = NULL;
438  }
439 
440  g_object_set_data(G_OBJECT(box), PROP_SIZE_QUEUED_S, child);
441 
442  if (child) {
443  for (iter = box->list; iter; iter = iter->next) {
444  GntWidget *wid = iter->data;
445  int w, h;
446 
447  if (wid == child)
448  continue;
449 
450  gnt_widget_get_size(wid, &w, &h);
451  if (box->vertical) {
452  /* For a vertical box, if we are changing the width, make sure the widgets
453  * in the box will fit after resizing the width. */
454  if (wchange > 0 &&
455  w >= child->priv.width &&
456  !gnt_widget_confirm_size(wid, w - wchange, h))
457  return FALSE;
458  } else {
459  /* If we are changing the height, make sure the widgets in the box fit after
460  * the resize. */
461  if (hchange > 0 &&
462  h >= child->priv.height &&
463  !gnt_widget_confirm_size(wid, w, h - hchange))
464  return FALSE;
465  }
466 
467  }
468  }
469 
470  return (child != NULL);
471 }
472 
473 static void
474 gnt_box_size_changed(GntWidget *widget, int oldw, int oldh)
475 {
476  int wchange, hchange;
477  GList *i;
478  GntBox *box = GNT_BOX(widget);
479  GntWidget *wid;
480  int tw, th;
481 
482  wchange = widget->priv.width - oldw;
483  hchange = widget->priv.height - oldh;
484 
485  wid = g_object_get_data(G_OBJECT(box), PROP_SIZE_QUEUED_S);
486  if (wid) {
487  gnt_widget_get_size(wid, &tw, &th);
488  gnt_widget_set_size(wid, tw + wchange, th + hchange);
489  g_object_set_data(G_OBJECT(box), PROP_SIZE_QUEUED_S, NULL);
490  g_object_set_data(G_OBJECT(box), PROP_LAST_RESIZE_S, wid);
491  }
492 
493  if (box->vertical)
494  hchange = 0;
495  else
496  wchange = 0;
497 
498  for (i = box->list; i; i = i->next)
499  {
500  if (wid != i->data)
501  {
502  gnt_widget_get_size(GNT_WIDGET(i->data), &tw, &th);
503  gnt_widget_set_size(i->data, tw + wchange, th + hchange);
504  }
505  }
506 
508 }
509 
510 static gboolean
512 {
513  GList *iter;
514  for (iter = GNT_BOX(widget)->list; iter; iter = iter->next) {
515  int x, y, w, h;
516  GntWidget *wid = iter->data;
517 
518  gnt_widget_get_position(wid, &x, &y);
519  gnt_widget_get_size(wid, &w, &h);
520 
521  if (cx >= x && cx < x + w && cy >= y && cy < y + h) {
522  if (event <= GNT_MIDDLE_MOUSE_DOWN &&
524  while (widget->parent)
525  widget = widget->parent;
527  }
528  return gnt_widget_clicked(wid, event, cx, cy);
529  }
530  }
531  return FALSE;
532 }
533 
534 static void
535 gnt_box_set_property(GObject *obj, guint prop_id, const GValue *value,
536  GParamSpec *spec)
537 {
538  GntBox *box = GNT_BOX(obj);
539  switch (prop_id) {
540  case PROP_VERTICAL:
541  box->vertical = g_value_get_boolean(value);
542  break;
543  case PROP_HOMO:
544  box->homogeneous = g_value_get_boolean(value);
545  break;
546  default:
547  g_return_if_reached();
548  break;
549  }
550 }
551 
552 static void
553 gnt_box_get_property(GObject *obj, guint prop_id, GValue *value,
554  GParamSpec *spec)
555 {
556  GntBox *box = GNT_BOX(obj);
557  switch (prop_id) {
558  case PROP_VERTICAL:
559  g_value_set_boolean(value, box->vertical);
560  break;
561  case PROP_HOMO:
562  g_value_set_boolean(value, box->homogeneous);
563  break;
564  default:
565  break;
566  }
567 }
568 
569 static void
571 {
573  GObjectClass *gclass = G_OBJECT_CLASS(klass);
587 
588  gclass->set_property = gnt_box_set_property;
589  gclass->get_property = gnt_box_get_property;
590  g_object_class_install_property(gclass,
592  g_param_spec_boolean("vertical", "Vertical",
593  "Whether the child widgets in the box should be stacked vertically.",
594  TRUE,
596  )
597  );
598  g_object_class_install_property(gclass,
599  PROP_HOMO,
600  g_param_spec_boolean("homogeneous", "Homogeneous",
601  "Whether the child widgets in the box should have the same size.",
602  TRUE,
604  )
605  );
606 
608  "\t", NULL);
609  gnt_bindable_register_binding(bindable, "focus-next", GNT_KEY_RIGHT, NULL);
612  gnt_bindable_register_binding(bindable, "focus-prev", GNT_KEY_LEFT, NULL);
613 
614  gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), bindable);
615 }
616 
617 static void
618 gnt_box_init(GTypeInstance *instance, gpointer class)
619 {
620  GntWidget *widget = GNT_WIDGET(instance);
621  GntBox *box = GNT_BOX(widget);
622  /* Initially make both the height and width resizable.
623  * Update the flags as necessary when widgets are added to it. */
627  box->pad = 1;
628  box->fill = TRUE;
629  GNTDEBUG;
630 }
631 
632 /******************************************************************************
633  * GntBox API
634  *****************************************************************************/
635 GType
636 gnt_box_get_gtype(void)
637 {
638  static GType type = 0;
639 
640  if(type == 0)
641  {
642  static const GTypeInfo info = {
643  sizeof(GntBoxClass),
644  NULL, /* base_init */
645  NULL, /* base_finalize */
646  (GClassInitFunc)gnt_box_class_init,
647  NULL, /* class_finalize */
648  NULL, /* class_data */
649  sizeof(GntBox),
650  0, /* n_preallocs */
651  gnt_box_init, /* instance_init */
652  NULL /* value_table */
653  };
654 
655  type = g_type_register_static(GNT_TYPE_WIDGET,
656  "GntBox",
657  &info, 0);
658  }
659 
660  return type;
661 }
662 
663 GntWidget *gnt_box_new(gboolean homo, gboolean vert)
664 {
665  GntWidget *widget = g_object_new(GNT_TYPE_BOX, NULL);
666  GntBox *box = GNT_BOX(widget);
667 
668  box->homogeneous = homo;
669  box->vertical = vert;
670  box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID;
671 
672  return widget;
673 }
674 
676 {
677  b->list = g_list_append(b->list, widget);
678  widget->parent = GNT_WIDGET(b);
679 }
680 
681 void gnt_box_set_title(GntBox *b, const char *title)
682 {
683  char *prev = b->title;
684  GntWidget *w = GNT_WIDGET(b);
685  b->title = g_strdup(title);
687  /* Erase the old title */
688  int pos, right;
689  get_title_thingies(b, prev, &pos, &right);
690  mvwhline(w->window, 0, pos - 1, ACS_HLINE | gnt_color_pair(GNT_COLOR_NORMAL),
691  right - pos + 2);
692  }
693  g_free(prev);
694 }
695 
696 void gnt_box_set_pad(GntBox *box, int pad)
697 {
698  box->pad = pad;
699  /* XXX: Perhaps redraw if already showing? */
700 }
701 
702 void gnt_box_set_toplevel(GntBox *box, gboolean set)
703 {
704  GntWidget *widget = GNT_WIDGET(box);
705  if (set)
706  {
709  }
710  else
711  {
714  }
715 }
716 
717 void gnt_box_sync_children(GntBox *box)
718 {
719  GList *iter;
720  GntWidget *widget = GNT_WIDGET(box);
721  int pos = 1;
722 
724  pos = 0;
725 
726  if (!box->active)
728 
729  for (iter = box->list; iter; iter = iter->next)
730  {
731  GntWidget *w = GNT_WIDGET(iter->data);
732  int height, width;
733  int x, y;
734 
736  continue;
737 
738  if (GNT_IS_BOX(w))
740 
741  gnt_widget_get_size(w, &width, &height);
742 
743  x = w->priv.x - widget->priv.x;
744  y = w->priv.y - widget->priv.y;
745 
746  if (box->vertical)
747  {
748  x = pos;
749  if (box->alignment == GNT_ALIGN_RIGHT)
750  x += widget->priv.width - width;
751  else if (box->alignment == GNT_ALIGN_MID)
752  x += (widget->priv.width - width)/2;
753  if (x + width > widget->priv.width - pos)
754  x -= x + width - (widget->priv.width - pos);
755  }
756  else
757  {
758  y = pos;
759  if (box->alignment == GNT_ALIGN_BOTTOM)
760  y += widget->priv.height - height;
761  else if (box->alignment == GNT_ALIGN_MID)
762  y += (widget->priv.height - height)/2;
763  if (y + height >= widget->priv.height - pos)
764  y = widget->priv.height - height - pos;
765  }
766 
767  copywin(w->window, widget->window, 0, 0,
768  y, x, y + height - 1, x + width - 1, FALSE);
769  gnt_widget_set_position(w, x + widget->priv.x, y + widget->priv.y);
770  if (w == box->active) {
771  wmove(widget->window, y + getcury(w->window), x + getcurx(w->window));
772  }
773  }
774 }
775 
776 void gnt_box_set_alignment(GntBox *box, GntAlignment alignment)
777 {
778  box->alignment = alignment;
779 }
780 
782 {
783  box->list = g_list_remove(box->list, widget);
785  && GNT_WIDGET(box)->parent == NULL && box->focus)
786  {
787  if (widget == box->active)
788  {
789  find_next_focus(box);
790  if (box->active == widget) /* There's only one widget */
791  box->active = NULL;
792  }
793  box->focus = g_list_remove(box->focus, widget);
794  }
795 
798 }
799 
800 void gnt_box_remove_all(GntBox *box)
801 {
802  g_list_foreach(box->list, (GFunc)gnt_widget_destroy, NULL);
803  g_list_free(box->list);
804  g_list_free(box->focus);
805  box->list = NULL;
806  box->focus = NULL;
807  GNT_WIDGET(box)->priv.width = 0;
808  GNT_WIDGET(box)->priv.height = 0;
809 }
810 
811 void gnt_box_readjust(GntBox *box)
812 {
813  GList *iter;
814  GntWidget *wid;
815  int width, height;
816 
817  if (GNT_WIDGET(box)->parent != NULL)
818  return;
819 
820  for (iter = box->list; iter; iter = iter->next)
821  {
822  GntWidget *w = iter->data;
823  if (GNT_IS_BOX(w))
825  else
826  {
828  w->priv.width = 0;
829  w->priv.height = 0;
830  }
831  }
832 
833  wid = GNT_WIDGET(box);
835  wid->priv.width = 0;
836  wid->priv.height = 0;
837 
838  if (wid->parent == NULL)
839  {
840  g_list_free(box->focus);
841  box->focus = NULL;
842  box->active = NULL;
844  gnt_widget_get_size(wid, &width, &height);
845  gnt_screen_resize_widget(wid, width, height);
847  }
848 }
849 
850 void gnt_box_set_fill(GntBox *box, gboolean fill)
851 {
852  box->fill = fill;
853 }
854 
855 void gnt_box_move_focus(GntBox *box, int dir)
856 {
857  GntWidget *now;
858 
859  if (box->active == NULL)
860  {
862  return;
863  }
864 
865  now = box->active;
866 
867  if (dir == 1)
868  find_next_focus(box);
869  else if (dir == -1)
870  find_prev_focus(box);
871 
872  if (now && now != box->active)
873  {
876  }
877 
878  if (GNT_WIDGET(box)->window)
880 }
881 
883 {
884  GList *find;
885  gpointer now;
886 
887  while (GNT_WIDGET(box)->parent)
888  box = GNT_BOX(GNT_WIDGET(box)->parent);
889 
890  find = g_list_find(box->focus, widget);
891  now = box->active;
892  if (find)
893  box->active = widget;
894  if (now && now != box->active)
895  {
898  }
899 
900  if (GNT_WIDGET(box)->window)
902 }
903 
gnt_widget_set_size
gboolean gnt_widget_set_size(GntWidget *widget, int width, int height)
Definition: gntwidget.c:515
info
static PurplePluginInfo info
Definition: gntclipboard.c:147
GNT_WIDGET_NO_BORDER
Definition: gntwidget.h:59
gnt_box_set_property
static void gnt_box_set_property(GObject *obj, guint prop_id, const GValue *value, GParamSpec *spec)
Definition: gntbox.c:535
_GntWidgetPriv::width
int width
Definition: gntwidget.h:91
_GntBox::list
GList * list
Definition: gntbox.h:63
PROP_LAST_RESIZE_S
#define PROP_LAST_RESIZE_S
Definition: gntbox.c:30
_GntBox::focus
GList * focus
Definition: gntbox.h:70
GNT_WIDGET_FLAGS
#define GNT_WIDGET_FLAGS(obj)
Definition: gntwidget.h:43
max
#define max(a, b)
gnt_box_destroy
static void gnt_box_destroy(GntWidget *w)
Definition: gntbox.c:381
GNT_KEY_LEFT
#define GNT_KEY_LEFT
Definition: gntkeys.h:48
gnt_box_move_focus
void gnt_box_move_focus(GntBox *box, int dir)
Definition: gntbox.c:854
gnt_box_gained_focus
static void gnt_box_gained_focus(GntWidget *widget)
Definition: gntbox.c:372
gnt_box_set_pad
void gnt_box_set_pad(GntBox *box, int pad)
Definition: gntbox.c:695
GNT_WIDGET_GROW_X
Definition: gntwidget.h:64
gnt_box_key_pressed
static gboolean gnt_box_key_pressed(GntWidget *widget, const char *text)
Definition: gntbox.c:307
GNT_KEY_BACK_TAB
#define GNT_KEY_BACK_TAB
Definition: gntkeys.h:68
gnt_widget_get_size
void gnt_widget_get_size(GntWidget *wid, int *width, int *height)
Definition: gntwidget.c:464
gnt_widget_key_pressed
gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys)
Definition: gntwidget.c:393
GntMouseEvent
enum _GntMouseEvent GntMouseEvent
_GntBox::pad
int pad
Definition: gntbox.h:66
GNT_WIDGET_DISABLE_ACTIONS
Definition: gntwidget.h:68
_GntBox::alignment
GntAlignment alignment
Definition: gntbox.h:67
gntbox.h
G_PARAM_STATIC_BLURB
#define G_PARAM_STATIC_BLURB
Definition: gnt.h:48
_GntWidgetPriv::x
int x
Definition: gntwidget.h:90
set
static void set(PurpleDesktopItem *item, const char *key, const char *value)
Definition: desktopitem.c:206
_GntBox::vertical
gboolean vertical
Definition: gntbox.h:60
gnt_util_onscreen_width_to_pointer
const char * gnt_util_onscreen_width_to_pointer(const char *string, int len, int *w)
Definition: gntutils.c:97
GNT_WIDGET_CLASS
#define GNT_WIDGET_CLASS(klass)
Definition: gntwidget.h:38
widget
GtkWidget * widget
Definition: pidgintooltip.c:38
_GntWidget
Definition: gntwidget.h:98
window
GntWidget * window
Definition: gntcertmgr.c:45
gntutils.h
GNT_WIDGET_MAPPED
Definition: gntwidget.h:56
box_focus_change
static gboolean box_focus_change(GntBox *box, gboolean next)
Definition: gntbox.c:330
action_focus_next
static gboolean action_focus_next(GntBindable *bindable, GList *null)
Definition: gntbox.c:351
_GntWidgetClass::key_pressed
gboolean(* key_pressed)(GntWidget *widget, const char *key)
Definition: gntwidget.h:130
GNT_COLOR_TITLE_D
Definition: gntcolors.h:47
gnt_box_lost_focus
static void gnt_box_lost_focus(GntWidget *widget)
Definition: gntbox.c:363
GNT_BOX
#define GNT_BOX(obj)
Definition: gntbox.h:34
gnt_box_add_widget
void gnt_box_add_widget(GntBox *b, GntWidget *widget)
Definition: gntbox.c:674
add_to_focus
static void add_to_focus(gpointer value, gpointer data)
Definition: gntbox.c:50
PROP_SIZE_QUEUED_S
#define PROP_SIZE_QUEUED_S
Definition: gntbox.c:31
GNT_WIDGET_IS_FLAG_SET
#define GNT_WIDGET_IS_FLAG_SET(obj, flags)
Definition: gntwidget.h:46
GNT_ALIGN_MID
Definition: gntbox.h:49
gnt_box_draw
static void gnt_box_draw(GntWidget *widget)
Definition: gntbox.c:76
GNT_WIDGET_INVISIBLE
Definition: gntwidget.h:66
_GntWidgetClass::clicked
gboolean(* clicked)(GntWidget *widget, GntMouseEvent event, int x, int y)
Definition: gntwidget.h:132
gnt_bindable_register_binding
void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger,...)
Definition: gntbindable.c:380
GNT_COLOR_TITLE
Definition: gntcolors.h:46
GNTDEBUG
#define GNTDEBUG
Definition: gntbindable.h:42
gnt_widget_set_position
void gnt_widget_set_position(GntWidget *wid, int x, int y)
Definition: gntwidget.c:440
gntinternal.h
GNT_ALIGN_BOTTOM
Definition: gntbox.h:53
GNT_TYPE_BOX
#define GNT_TYPE_BOX
Definition: gntbox.h:33
_GntWidgetClass::lost_focus
void(* lost_focus)(GntWidget *widget)
Definition: gntwidget.h:124
gnt_box_clicked
static gboolean gnt_box_clicked(GntWidget *widget, GntMouseEvent event, int cx, int cy)
Definition: gntbox.c:511
klass
GntBindableClass * klass
Definition: gntbindable.c:46
data
gpointer data
Definition: gntwm.c:1781
gnt_box_remove_all
void gnt_box_remove_all(GntBox *box)
Definition: gntbox.c:799
GNT_ALIGN_RIGHT
Definition: gntbox.h:47
C_
const char * C_(const char *x)
Definition: gntmain.c:758
NULL
#define NULL
Definition: getopt1.c:52
_GntBox::title
char * title
Definition: gntbox.h:69
_GntBox
Definition: gntbox.h:56
gnt_box_set_position
static void gnt_box_set_position(GntWidget *widget, int x, int y)
Definition: gntbox.c:178
find_prev_focus
static void find_prev_focus(GntBox *box)
Definition: gntbox.c:285
SIGS
Definition: gntbox.c:42
GNT_WIDGET_UNSET_FLAGS
#define GNT_WIDGET_UNSET_FLAGS(obj, flags)
Definition: gntwidget.h:45
GNT_COLOR_NORMAL
Definition: gntcolors.h:37
gnt_box_give_focus_to_child
void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
Definition: gntbox.c:881
gnt_box_set_toplevel
void gnt_box_set_toplevel(GntBox *box, gboolean set)
Definition: gntbox.c:701
gnt_box_remove
void gnt_box_remove(GntBox *box, GntWidget *widget)
Definition: gntbox.c:780
GNT_WIDGET_SET_FLAGS
#define GNT_WIDGET_SET_FLAGS(obj, flags)
Definition: gntwidget.h:44
reposition_children
static void reposition_children(GntWidget *widget)
Definition: gntbox.c:106
gnt_widget_size_request
void gnt_widget_size_request(GntWidget *widget)
Definition: gntwidget.c:458
gnt_box_map
static void gnt_box_map(GntWidget *widget)
Definition: gntbox.c:243
G_PARAM_STATIC_NICK
#define G_PARAM_STATIC_NICK
Definition: gnt.h:47
gnt_box_class_init
static void gnt_box_class_init(GntBoxClass *klass)
Definition: gntbox.c:570
gnt_box_init
static void gnt_box_init(GTypeInstance *instance, gpointer class)
Definition: gntbox.c:618
_GntWidgetClass::expose
void(* expose)(GntWidget *widget, int x, int y, int width, int height)
Definition: gntwidget.h:122
_GntWidgetClass::map
void(* map)(GntWidget *obj)
Definition: gntwidget.h:117
r
short r
Definition: gntcolors.c:44
GNT_WIDGET
#define GNT_WIDGET(obj)
Definition: gntwidget.h:37
gnt_widget_get_position
void gnt_widget_get_position(GntWidget *wid, int *x, int *y)
Definition: gntwidget.c:449
TRUE
#define TRUE
Definition: protobuf-c.c:56
dbus-analyze-signals.type
string type
Definition: dbus-analyze-signals.py:42
gnt_box_new
GntWidget * gnt_box_new(gboolean homo, gboolean vert)
Definition: gntbox.c:662
FALSE
#define FALSE
Definition: protobuf-c.c:57
PROP_0
Definition: gntbox.c:35
GNT_WIDGET_GROW_Y
Definition: gntwidget.h:65
GntBox
struct _GntBox GntBox
Definition: gntbox.h:40
gnt_screen_resize_widget
void gnt_screen_resize_widget(GntWidget *widget, int width, int height)
Definition: gntmain.c:633
gnt_widget_confirm_size
gboolean gnt_widget_confirm_size(GntWidget *widget, int width, int height)
Definition: gntwidget.c:633
_GntWidgetClass::set_position
void(* set_position)(GntWidget *widget, int x, int y)
Definition: gntwidget.h:129
get_title_thingies
static void get_title_thingies(GntBox *box, char *title, int *p, int *r)
Definition: gntbox.c:62
_GntWidgetClass::size_request
void(* size_request)(GntWidget *widget)
Definition: gntwidget.h:126
gnt_box_set_title
void gnt_box_set_title(GntBox *b, const char *title)
Definition: gntbox.c:680
gnt_box_expose
static void gnt_box_expose(GntWidget *widget, int x, int y, int width, int height)
Definition: gntbox.c:390
gnt_screen_release
void gnt_screen_release(GntWidget *widget)
Definition: gntmain.c:561
action_focus_prev
static gboolean action_focus_prev(GntBindable *bindable, GList *null)
Definition: gntbox.c:357
text
static char * text[]
Definition: zephyr_err.c:10
PROP_VERTICAL
Definition: gntbox.c:36
b
short b
Definition: gntcolors.c:44
PROP_HOMO
Definition: gntbox.c:37
GNT_MIDDLE_MOUSE_DOWN
Definition: gntwidget.h:76
_GntWidgetClass
Definition: gntwidget.h:113
_GntBindableClass
Definition: gntbindable.h:52
gnt_style_read_actions
void gnt_style_read_actions(GType type, GntBindableClass *klass)
Definition: gntstyle.c:217
gntstyle.h
find_focusable_widget
static GntWidget * find_focusable_widget(GntBox *box)
Definition: gntbox.c:255
_GntBoxClass
Definition: gntbox.h:78
GNT_WIDGET_CAN_TAKE_FOCUS
Definition: gntwidget.h:55
gnt_box_sync_children
void gnt_box_sync_children(GntBox *box)
Definition: gntbox.c:716
gnt_color_pair
int gnt_color_pair(int pair)
Definition: gntcolors.c:298
_GntBox::fill
gboolean fill
Definition: gntbox.h:62
find_next_focus
static void find_next_focus(GntBox *box)
Definition: gntbox.c:268
_GntBox::homogeneous
gboolean homogeneous
Definition: gntbox.h:61
_GntWidgetPriv::y
int y
Definition: gntwidget.h:90
gnt_widget_destroy
void gnt_widget_destroy(GntWidget *obj)
Definition: gntwidget.c:312
gnt_widget_set_focus
gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set)
Definition: gntwidget.c:568
GNT_IS_BOX
#define GNT_IS_BOX(obj)
Definition: gntbox.h:36
gnt_box_confirm_size
static gboolean gnt_box_confirm_size(GntWidget *widget, int width, int height)
Definition: gntbox.c:399
gnt_widget_draw
void gnt_widget_draw(GntWidget *widget)
Definition: gntwidget.c:335
pietray.obj
obj
Definition: pietray.py:29
_GntWidgetClass::size_changed
void(* size_changed)(GntWidget *widget, int w, int h)
Definition: gntwidget.h:128
gnt_box_get_property
static void gnt_box_get_property(GObject *obj, guint prop_id, GValue *value, GParamSpec *spec)
Definition: gntbox.c:553
gnt_box_size_request
static void gnt_box_size_request(GntWidget *widget)
Definition: gntbox.c:195
_GntWidget::parent
GntWidget * parent
Definition: gntwidget.h:102
gnt_widget_has_focus
gboolean gnt_widget_has_focus(GntWidget *widget)
Definition: gntmain.c:572
GNT_WIDGET_NO_SHADOW
Definition: gntwidget.h:60
gnt_bindable_class_register_action
void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger,...)
Definition: gntbindable.c:396
gnt_box_get_gtype
GType gnt_box_get_gtype(void)
Definition: gntbox.c:635
parent_class
static GntWidgetClass * parent_class
Definition: gntbox.c:45
GntBoxClass
struct _GntBoxClass GntBoxClass
Definition: gntbox.h:41
_GntBox::active
GntWidget * active
Definition: gntbox.h:65
_GntWidget::window
WINDOW * window
Definition: gntwidget.h:105
gnt_widget_clicked
gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
Definition: gntwidget.c:409
_GntBindable
Definition: gntbindable.h:47
value
gpointer value
Definition: gntwm.c:1782
GNT_KEY_RIGHT
#define GNT_KEY_RIGHT
Definition: gntkeys.h:49
GNT_ALIGN_LEFT
Definition: gntbox.h:46
gnt_box_size_changed
static void gnt_box_size_changed(GntWidget *widget, int oldw, int oldh)
Definition: gntbox.c:474
GNT_TYPE_WIDGET
#define GNT_TYPE_WIDGET
Definition: gntwidget.h:36
_GntWidgetClass::destroy
void(* destroy)(GntWidget *obj)
Definition: gntwidget.h:119
GNT_BINDABLE_CLASS
#define GNT_BINDABLE_CLASS(klass)
Definition: gntbindable.h:37
_GntWidgetClass::draw
void(* draw)(GntWidget *obj)
Definition: gntwidget.h:120
_GntWidgetPriv::height
int height
Definition: gntwidget.h:91
gnt_box_readjust
void gnt_box_readjust(GntBox *box)
Definition: gntbox.c:810
_GntWidget::priv
GntWidgetPriv priv
Definition: gntwidget.h:104
_GntWidgetClass::confirm_size
gboolean(* confirm_size)(GntWidget *widget, int x, int y)
Definition: gntwidget.h:127
gnt_box_set_fill
void gnt_box_set_fill(GntBox *box, gboolean fill)
Definition: gntbox.c:849
G_PARAM_STATIC_NAME
#define G_PARAM_STATIC_NAME
Definition: gnt.h:46
GntAlignment
GntAlignment
Definition: gntbox.h:43
gnt_box_set_alignment
void gnt_box_set_alignment(GntBox *box, GntAlignment alignment)
Definition: gntbox.c:775
_GntWidgetClass::gained_focus
void(* gained_focus)(GntWidget *widget)
Definition: gntwidget.h:123