for (int i = 0; i < MAX_XWIDGETS; i++)
{
xv = &xwidget_views[i];
- if(xv->initialized && xvp->model == xv->model){
+ if(xv->initialized && EQ (xvp->model, xv->model)){
g_signal_handler_block( xv->widget,xv->handler_id);
}
}
for (int i = 0; i < MAX_XWIDGETS; i++)
{
xv = &xwidget_views[i];
- if(xv->initialized && xvp->model == xv->model){
+ if(xv->initialized && EQ (xvp->model, xv->model)){
gtk_range_set_value(GTK_RANGE(xv->widget), v);
g_signal_handler_unblock( xv->widget,xv->handler_id);
}
for (int i = 0; i < MAX_XWIDGETS; i++)//todo mvc refactor
{
xv = &xwidget_views[i];
- if(xv->initialized && xv->model == xw){
+ if(xv->initialized && XXWIDGET (xv->model) == xw){
gtk_widget_queue_draw (xv->widget); //redraw all views, the master has changed
}
}
GdkEvent *event,
gpointer xv)
{
- xwidget_set_embedder_view(((struct xwidget_view*) xv)->model,
+ xwidget_set_embedder_view(XXWIDGET (((struct xwidget_view*) xv)->model),
(struct xwidget_view*) xv);
}
xv->initialized = 1;
xv->w = s->w;
- xv->model = xww;
+ XSETXWIDGET(xv->model, xww);
//widget creation
if(EQ(xww->type, Qbutton))
for (int i = 0; i < MAX_XWIDGETS; i++) //TODO MVC refactor lazy linear search
{
xv = &xwidget_views[i];
- if(xv->initialized && xv->model == xw){
+ if(xv->initialized && XXWIDGET (xv->model) == xw){
gtk_layout_set_size (GTK_LAYOUT (xv->widgetwindow), xw->width, xw->height);
gtk_widget_set_size_request (GTK_WIDGET (xv->widget), xw->width, xw->height);
}
struct xwidget_view* xv = NULL;
for (int i = 0; i < MAX_XWIDGETS; i++){
xv = &xwidget_views[i];
- if (xv->initialized && (xv->model == xw) && (xv->w == w))
+ if (xv->initialized && (XXWIDGET (xv->model) == xw) && (xv->w == w))
return xv;
}
return NULL; /* we didnt find a matching view */
//struct for each xwidget view
-struct xwidget_view{
+struct xwidget_view {
struct vectorlike_header header;
- struct xwidget* model; //TODO should be lisp
+ Lisp_Object model;
//here ends the lisp part.
/* Test for xwidget (xwidget . spec) (car must be the symbol xwidget)*/
#define XWIDGETP(x) (CONSP (x) && EQ (XCAR (x), Qxwidget))
+
/* Test for xwidget pseudovector*/
#define XXWIDGETP(x) PSEUDOVECTORP (x, PVEC_XWIDGET)
#define XXWIDGET(a) (eassert (XXWIDGETP(a)),(struct xwidget *) XPNTR(a))
+/* Test for xwidget_view pseudovector */
+#define XXWIDGET_VIEW_P(x) PSEUDOVECTORP (x, PVEC_XWIDGET_VIEW)
+#define XXWIDGET_VIEW(a) (eassert (XXWIDGET_VIEW_P(a)),(struct xwidget_view *) XPNTR(a))
struct xwidget_type
{