/************************************************************************ ** ** FILE : hakasete.c ** ** ZWECK : ** ** AUTOR : Michael C. Ancutici ** Universitaet Stuttgart, Fakultaet Informatik ** ** DATUM : 14.03.93 ** *************************************************************************/ #include "hakasete.h" #include "haka.h" #include "haka.H" #include "cellkalook.h" #include "hamess.h" #include "celltype.h" #include "katype.h" /************************************************************************* ** FUNKTION: HaKaSetEck ** ZWECK: ** EINGABE: ** AUSGABE: ** RETURN: ** ANMERK: *************************************************************************/ void HaKaSetEck( w, event, params, num_params) Widget w; XEvent *event; String *params; Cardinal *num_params; { ECKE *e; char ergLook; int i; int x = ((XButtonEvent *)event)->x; int y = ((XButtonEvent *)event)->y; if (CellKaGetStart( x, y, &ergLook, &i) ) { HaMessage( HA_ECKE_IN_KNOTEN); return; } if (Ecke) ergLook = CellKaLookFor( HaKaFirst.x, HaKaFirst.y, x, y, CE_NOTHING, CE_NOTHING ); else if (StartTyp == CE_STELLE) ergLook = CellKaLookFor( HaKaFirst.x, HaKaFirst.y, x, y, StartNr, CE_NOTHING); else ergLook = CellKaLookFor( HaKaFirst.x, HaKaFirst.y, x, y, CE_NOTHING, StartNr); if (ergLook != CE_OK) { HaMessage( HA_OBJ_NEAR_OBJ); return; } e = (ECKE *)malloc( sizeof( ECKE)); e->x = HaKaFirst.x = x; e->y = HaKaFirst.y = y; e->ENr = ENeuNr++; e->next = Ecke; /* ACHTUNG: Ecken werden in */ Ecke = e; /* umgekehrter Reihenf. gesp. */ HaKaInvLine( HaKaFirst.x, HaKaFirst.y, HaAlt.x, HaAlt.y); }