📄 connect.h
字号:
//**************************************************************//* filename: connect.h *//* *//**************************************************************//* programmed by: Thomas Wagner *//* last change: (XXX: not updated) *//**************************************************************#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#define STARTPOINT 0#define ENDPOINT 1#ifndef CONNECT_H#define CONNECT_Hclass Connection;class Connectlist;#include "moveicon.h"#include "mainwindow.h"#define ARROWWIDTH 10#define ARROWPOINTNUMBER 3#define CONNECTSTATUS_INVISIBLE 0#define CONNECTSTATUS_VISIBLE (1<<0)class Connection{ friend class Connectlist; protected: MainWindow * mainwindow; GC gc; Display *display; XPoint Points[4]; char status; MoveableIcon *Start, *End; public: Connection (Display * initdisplay, GC initgc, MainWindow * parentwindow, short startx, short starty, short endx, short endy); virtual ~ Connection (); void SetStatus (char newstatus) { status = newstatus; } char GetStatus () { return status; } MoveableIcon *GetStartIcon (); MoveableIcon *GetEndIcon (); void SetStartIcon (MoveableIcon * Starticon) { Start = Starticon; } void SetEndIcon (MoveableIcon * Endicon) { End = Endicon; } void SendActiontoStart (int actionnumber, int value); void SendActiontoEnd (int actionnumber, int value); void SetStart (short x, short y); void SetEnd (short x, short y); short GetStartx () { return Points[0].x; } short GetStarty () { return Points[0].y; } short GetEndx () { return Points[2].x; } short GetEndy () { return Points[2].y; } void MoveStart (short x, short y); void MoveEnd (short x, short y); void DrawArrow (); void EraseArrow (); void ErasetempArrow (); void DrawtempArrow (); void DrawtempArrow (short startx, short starty, short endx, short endy) { SetStart (startx, starty); DrawtempArrow (endx, endy); } void DrawtempArrow (short endx, short endy); protected: double CalculateDistance (int x, int y, char *pointtyp);};class Connectlist{ protected: Connectlist * Next; Connectlist *Previous; Connection *connection; Connectlist *first; public: Connectlist (); // delete full list with all connections ~Connectlist (); void DrawAllArrow (); Connectlist *GetNext () { return Next; } Connection *FindnearestConnection (int x, int y, char *pointtyp); Connection *FindnearestConnection (int x, int y) { char dummy; return (FindnearestConnection (x, y, &dummy)); } Connection *GetConnection () { return connection; } char ConnectionExists (MoveableIcon * starticon, MoveableIcon * endicon); void operator += (Connection * nextconnection); void operator -= (Connection * delconnection); void SendActiontoallEnds (int actionnumber, int value);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -