4 const char *name; /* For easy discovery in gdb */
5 struct pane *parent safe;
6 struct list_head siblings;
7 struct list_head children;
11 short cx, cy; /* cursor position */
16 short consistency_checks;
20 /* timestamp is low bits of time in milliseconds when some
21 * command started. This makes it easy to check when we
22 * have done too much work.
23 * 0 means nothing is running.
24 * 1 means time is exhausted
26 unsigned int timestamp;
28 struct pane *root safe;
29 struct command *handle;
30 struct attrset *attrs;
31 struct list_head notifiers, notifiees;
35 PANE_DATA_TYPE data[1];
37 #ifdef PANE_DATA_PTR_TYPE
38 PANE_DATA_PTR_TYPE data safe;
41 DOC_DATA_TYPE doc_data[1];
43 #ifdef PANE_DATA_TYPE_2
44 PANE_DATA_TYPE_2 data2[1];
46 #ifdef PANE_DATA_PTR_TYPE_2
47 PANE_DATA_PTR_TYPE_2 data2 safe;
49 #ifdef PANE_DATA_TYPE_3
50 PANE_DATA_TYPE_3 data3[1];
52 #ifdef PANE_DATA_PTR_TYPE_3
53 PANE_DATA_PTR_TYPE_3 data3 safe;
58 bool pane_no_consistency(struct pane *p safe);
59 bool pane_too_long(struct pane *p safe, unsigned int msec);
60 void pane_set_time(struct pane *p safe);
61 static inline void pane_end_time(struct pane *p safe)
66 static inline struct pane * safe pane_root(struct pane *p safe)
71 static inline void time_starts(struct pane *p safe)
73 pane_set_time(pane_root(p));
77 static inline void time_ends(struct pane *p safe)
80 pane_end_time(pane_root(p));
83 static inline bool times_up(struct pane *p safe)
85 return pane_too_long(pane_root(p), 15000);
88 static inline bool times_up_fast(struct pane *p safe)
90 return pane_root(p)->timestamp == 1;
93 static inline struct pane *safe pane_focus(struct pane *p safe)
97 while ((f = p->focus) != NULL)
102 static inline struct pane *pane_get(struct pane *p safe) safe
107 static inline void pane_put(struct pane *p safe)
113 int do_comm_call(struct command *comm safe, const struct cmd_info *ci safe);
114 static inline int do_call_val(enum target_type type, struct pane *home,
115 struct command *comm2a,
116 const char *key safe, struct pane *focus safe,
117 int num, struct mark *m, const char *str,
118 int num2, struct mark *m2, const char *str2,
119 int x, int y, struct command *comm2b)
121 struct cmd_info ci = {.key = key, .focus = focus, .home = focus,
122 .num = num, .mark = m, .str = str,
123 .num2 = num2, .mark2 = m2, .str2 = str2,
124 .comm2 = comm2a ?: comm2b, .x = x, .y = y,
125 .comm = safe_cast NULL};
128 if ((type == TYPE_pane || type == TYPE_home) && !home)
130 if (type == TYPE_comm && !comm2a)
132 ASSERT(!comm2a || !comm2b || comm2a == comm2b || type == TYPE_comm);
141 ret = key_handle(&ci);
146 ci.comm = home->handle;
147 ret = do_comm_call(ci.comm, &ci);
154 ret = do_comm_call(ci.comm, &ci);