You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

396 lines
14 KiB

17 years ago
17 years ago
18 years ago
18 years ago
18 years ago
  1. //*****************************************/
  2. /* prototypage des fonctions de EESchema */
  3. /*****************************************/
  4. void FreeLibraryEntry(LibCmpEntry * Entry);
  5. LibEDA_BaseStruct * LocatePin(const wxPoint & RefPos,
  6. EDA_LibComponentStruct * Entry,
  7. int Unit, int Convert, SCH_COMPONENT * DrawItem = NULL);
  8. /* Routine de localisation d'une PIN de la PartLib pointee par Entry */
  9. wxString ReturnDefaultFieldName( int aFieldNdx );
  10. /****************/
  11. /* DATABASE.CPP */
  12. /****************/
  13. void DisplayCmpDoc(wxString & Name);
  14. bool DataBaseGetName(WinEDA_DrawFrame * frame,
  15. wxString & Keys, wxString & BufName);
  16. /*********************/
  17. /* DANGLING_ENDS.CPP */
  18. /*********************/
  19. bool SegmentIntersect(int Sx1, int Sy1, int Sx2, int Sy2, int Px1, int Py1);
  20. /****************/
  21. /* BUS_WIRE_JUNCTION.CPP */
  22. /****************/
  23. void IncrementLabelMember(wxString & name);
  24. /****************/
  25. /* EDITPART.CPP */
  26. /****************/
  27. void InstallCmpeditFrame(WinEDA_SchematicFrame * parent, wxPoint & pos,
  28. SCH_COMPONENT * m_Cmp);
  29. /******************************/
  30. /* EELIBS_DRAW_COMPONENTS.CPP */
  31. /******************************/
  32. int LibraryEntryCompare(EDA_LibComponentStruct *LE1, EDA_LibComponentStruct *LE2);
  33. int NumOfLibraries();
  34. EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias = FIND_ROOT);
  35. void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC, EDA_LibComponentStruct *LibEntry,
  36. SCH_COMPONENT * DrawLibItem, int PartX, int PartY,
  37. int Multi, int convert,
  38. int Color, bool DrawPinText);
  39. void DrawLibEntry(WinEDA_DrawPanel * panel, wxDC * DC,
  40. EDA_LibComponentStruct *LibEntry, const wxPoint & aOffset,
  41. int Multi, int convert,
  42. int DrawMode, int Color = -1);
  43. void DrawLibraryDrawStruct(WinEDA_DrawPanel * aPanel, wxDC * aDC,
  44. EDA_LibComponentStruct *aLibEntry, wxPoint aPosition,
  45. LibEDA_BaseStruct *aDrawItem,
  46. int aDrawMode, int aColor = -1);
  47. bool MapAngles(int *Angle1, int *Angle2, const int TransMat[2][2]);
  48. EDA_LibComponentStruct * Read_Component_Definition(WinEDA_DrawFrame * frame, char * Line,
  49. FILE *f, int *LineNum);
  50. /* Routine to Read a DEF/ENDDEF part entry from given open file. */
  51. /** Function TransformCoordinate
  52. * Calculate the wew coordinate from the old one, according to the transform matrix.
  53. * @param aTransformMatrix = rotation, mirror .. matrix
  54. * @param aPosition = the position to transform
  55. * @return the new coordinate
  56. */
  57. wxPoint TransformCoordinate( const int aTransformMatrix[2][2], const wxPoint & aPosition );
  58. LibraryStruct *FindLibrary(const wxString & Name);
  59. int LoadDocLib(WinEDA_DrawFrame * frame, const wxString & FullDocLibName, const wxString & Libname);
  60. PriorQue *LoadLibraryAux(WinEDA_DrawFrame * frame, LibraryStruct * library,
  61. FILE *f, int *NumOfParts);
  62. LibraryStruct * LoadLibraryName(WinEDA_DrawFrame * frame,
  63. const wxString & FullLibName, const wxString & LibName);
  64. void LoadLibraries(WinEDA_DrawFrame * frame);
  65. void FreeCmpLibrary(wxWindow * frame, const wxString & LibName);
  66. const wxChar **GetLibNames();
  67. void SnapLibItemPoint(int OrigX, int OrigY, int *ClosestX, int *ClosestY,
  68. SCH_COMPONENT *DrawLibItem);
  69. bool LibItemInBox(int x1, int y1, int x2, int y2,
  70. SCH_COMPONENT *DrawLibItem);
  71. char * StrPurge(char * text);
  72. /* Supprime les caracteres Space en debut de la ligne text
  73. retourne un pointeur sur le 1er caractere non Space de text */
  74. /************/
  75. /* BLOCK.CPP */
  76. /************/
  77. SCH_ITEM * DuplicateStruct(SCH_ITEM *DrawStruct);
  78. void MoveOneStruct(SCH_ITEM *DrawStructs, const wxPoint & move_vector);
  79. /* Given a structure move it by move_vector. */
  80. bool PlaceStruct(BASE_SCREEN * screen, SCH_ITEM *DrawStruct);
  81. bool MoveStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *DrawStruct);
  82. void DeleteStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *DrawStruct);
  83. bool DrawStructInBox(int x1, int y1, int x2, int y2,
  84. SCH_ITEM *DrawStruct);
  85. /*************/
  86. /* LOCATE.CPP */
  87. /*************/
  88. LibDrawPin* LocatePinByNumber( const wxString & ePin_Number,
  89. SCH_COMPONENT* eComponent );
  90. SCH_COMPONENT * LocateSmallestComponent( SCH_SCREEN * Screen );
  91. /* Recherche du plus petit (en surface) composant pointe par la souris */
  92. SCH_ITEM * PickStruct(EDA_Rect & block, BASE_SCREEN* screen, int SearchMask );
  93. SCH_ITEM * PickStruct(const wxPoint & refpos, BASE_SCREEN* screen, int SearchMask);
  94. /* 2 functions PickStruct:
  95. Search in block, or Search at location pos
  96. SearchMask = (bitwise OR):
  97. LIBITEM
  98. WIREITEM
  99. BUSITEM
  100. RACCORDITEM
  101. JUNCTIONITEM
  102. DRAWITEM
  103. TEXTITEM
  104. LABELITEM
  105. SHEETITEM
  106. MARKERITEM
  107. NOCONNECTITEM
  108. SEARCH_PINITEM
  109. SHEETLABELITEM
  110. FIELDCMPITEM
  111. if EXCLUDE_WIRE_BUS_ENDPOINTS is set, in wire ou bus search and locate,
  112. start and end points are not included in search
  113. if WIRE_BUS_ENDPOINTS_ONLY is set, in wire ou bus search and locate,
  114. only start and end points are included in search
  115. Return:
  116. -Bloc searc:
  117. pointeur sur liste de pointeurs de structures si Plusieurs
  118. structures selectionnees.
  119. pointeur sur la structure si 1 seule
  120. Positon serach:
  121. pointeur sur la structure.
  122. Si pas de structures selectionnees: retourne NULL */
  123. LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint,
  124. EDA_LibComponentStruct * LibEntry, int Unit, int Convert, int masque);
  125. Hierarchical_PIN_Sheet_Struct * LocateSheetLabel(DrawSheetStruct *Sheet, const wxPoint & pos);
  126. LibDrawPin * LocateAnyPin(SCH_ITEM *DrawList, const wxPoint & RefPos,
  127. SCH_COMPONENT ** libpart = NULL );
  128. Hierarchical_PIN_Sheet_Struct * LocateAnyPinSheet(const wxPoint & RefPos,
  129. SCH_ITEM *DrawList);
  130. int distance(int dx, int dy, int spot_cX, int spot_cY, int seuil);
  131. /* Calcul de la distance du point spot_cx,spot_cy a un segment de droite,
  132. d'origine 0,0 et d'extremite dx, dy;
  133. retourne:
  134. 0 si distance > seuil
  135. 1 si distance <= seuil
  136. Variables utilisees ( sont ramenees au repere centre sur l'origine du segment)
  137. dx, dy = coord de l'extremite segment.
  138. spot_cX,spot_cY = coord du curseur souris
  139. la recherche se fait selon 4 cas:
  140. segment horizontal
  141. segment vertical
  142. segment quelconque */
  143. /***************/
  144. /* EEREDRAW.CPP */
  145. /***************/
  146. void DrawDanglingSymbol(WinEDA_DrawPanel * panel,wxDC * DC,
  147. const wxPoint & pos, int Color);
  148. void Draw_Marqueur(WinEDA_DrawPanel * panel, wxDC * DC,
  149. wxPoint pos, char* pt_bitmap, int DrawMode, int Color);
  150. void DrawStructsInGhost(WinEDA_DrawPanel * panel, wxDC * DC,
  151. SCH_ITEM * DrawStruct, int dx, int dy );
  152. void SetHighLightStruct(SCH_ITEM *HighLight);
  153. void RedrawActiveWindow(WinEDA_DrawPanel * panel, wxDC * DC);
  154. void RedrawStructList(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *Structs, int DrawMode,
  155. int Color = -1);
  156. void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *Struct, int DrawMode,
  157. int Color = -1);
  158. /**************/
  159. /* EELAYER.CPP */
  160. /**************/
  161. void SeedLayers();
  162. EDA_Colors ReturnLayerColor(int Layer);
  163. void DisplayColorSetupFrame(WinEDA_DrawFrame * parent, const wxPoint & pos);
  164. /*************/
  165. /* EELOAD.CPP */
  166. /*************/
  167. int CountCmpNumber();
  168. /***************/
  169. /* EECONFIG.CPP */
  170. /***************/
  171. bool Read_Config( const wxString & CfgFileName, bool ForceRereadConfig );
  172. bool Read_Hotkey_Config( WinEDA_DrawFrame * frame, bool verbose );
  173. /**************/
  174. /* SAVELIB.CPP */
  175. /**************/
  176. LibEDA_BaseStruct * CopyDrawEntryStruct( wxWindow * frame, LibEDA_BaseStruct * DrawItem);
  177. /* Routine de Duplication d'une structure DrawLibItem d'une partlib
  178. Parametres d'entree:
  179. DrawEntry = pointeur sur la structure a dupliquer
  180. La structure nouvelle est creee, mais n'est pas inseree dans le
  181. chainage
  182. Retourne:
  183. Pointeur sur la structure creee (ou NULL si impossible) */
  184. EDA_LibComponentStruct * CopyLibEntryStruct (wxWindow * frame, EDA_LibComponentStruct * OldEntry);
  185. /* Routine de copie d'une partlib
  186. Parametres d'entree: pointeur sur la structure de depart
  187. Parametres de sortie: pointeur sur la structure creee */
  188. /***************/
  189. /* SYMBEDIT.CPP */
  190. /***************/
  191. void SuppressDuplicateDrawItem(EDA_LibComponentStruct * LibEntry);
  192. /* Routine de suppression des elements de trace dupliques, situation
  193. frequente lorsque l'on charge des symboles predessines plusieurs fois
  194. pour definir un composant */
  195. /**************/
  196. /* NETLIST.CPP */
  197. /**************/
  198. int IsBusLabel(const wxString & LabelDrawList);
  199. /***************/
  200. /* ANNOTATE.CPP */
  201. /***************/
  202. void ReAnnotatePowerSymbolsOnly();
  203. int CheckAnnotate(WinEDA_SchematicFrame * frame, bool OneSheetOnly);
  204. /* Retourne le nombre de composants non annotes ou erron�s
  205. Si OneSheetOnly : recherche sur le schema courant
  206. else: recherche sur toute la hierarchie */
  207. /************/
  208. /* PLOT.CPP */
  209. /************/
  210. void SetCurrentLineWidth( int width);
  211. void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon, int width = -1);
  212. void PlotCercle(wxPoint centre, int diametre, bool fill, int width = -1);
  213. void PlotPoly( int nb, int * coord, bool fill, int width = -1);
  214. void PlotNoConnectStruct(DrawNoConnectStruct * Struct);
  215. void PlotLibPart( SCH_COMPONENT *DrawLibItem );
  216. /* Genere le trace d'un composant */
  217. void PlotSheetStruct(DrawSheetStruct *Struct);
  218. /* Routine de dessin du bloc type hierarchie */
  219. void PlotTextStruct(EDA_BaseStruct *Struct);
  220. /***************/
  221. /* DELSHEET.CPP */
  222. /***************/
  223. void DeleteSubHierarchy(DrawSheetStruct * Sheet, bool confirm_deletion);
  224. bool ClearProjectDrawList(SCH_SCREEN * FirstWindow, bool confirm_deletion);
  225. /* free the draw list screen->EEDrawList and the subhierarchies
  226. clear the screen datas (filenames ..)
  227. */
  228. /*************/
  229. /* DELETE.CPP */
  230. /*************/
  231. bool LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC);
  232. void EraseStruct(SCH_ITEM *DrawStruct, SCH_SCREEN * Window);
  233. void DeleteAllMarkers(int type);
  234. /* Effacement des marqueurs du type "type" */
  235. void DeleteOneLibraryDrawStruct(WinEDA_DrawPanel * panel,
  236. wxDC *DC, EDA_LibComponentStruct * LibEntry,
  237. LibEDA_BaseStruct * DrawItem, int Affiche);
  238. /* Routine d'effacement d'un "LibraryDrawStruct"
  239. (d'un element de dessin d'un composant )
  240. Parametres d'entree
  241. Pointeur sur le composant comportant la structure
  242. (Si NULL la structure a effacer est supposee non rattachee
  243. a un composant)
  244. Pointeur sur la structure a effacer
  245. Affiche (si != 0 Efface le graphique correspondant de l'ecran) */
  246. /**************/
  247. /* GETPART.CPP */
  248. /**************/
  249. int LookForConvertPart( EDA_LibComponentStruct * LibEntry );
  250. /* Retourne la plus grande valeur trouvee dans la liste des elements
  251. "drawings" du composant LibEntry, pour le membre .Convert
  252. Si il n'y a pas de representation type "convert", la valeur
  253. retournee est 0 ou 1
  254. Si il y a une representation type "convert",
  255. la valeur retournee est > 1 (typiquement 2) */
  256. /**************/
  257. /* PINEDIT.CPP */
  258. /**************/
  259. void InstallPineditFrame(WinEDA_LibeditFrame * parent, wxDC * DC, const wxPoint & pos);
  260. /**************/
  261. /* SELPART.CPP */
  262. /**************/
  263. int DisplayComponentsNamesInLib(WinEDA_DrawFrame * frame,
  264. LibraryStruct *Library, wxString & Buffer, wxString & OldName);
  265. LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame);
  266. /* Routine pour selectionner une librairie a partir d'une liste */
  267. int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib,
  268. wxString & BufName);
  269. /* Routine de selection du nom d'un composant en librairie pour chargement,
  270. dans la librairie Library.
  271. Si Library == NULL, il y aura demande de selection d'une librairie
  272. Retourne
  273. 1 si composant selectionne
  274. 0 si commande annulee
  275. place le nom du composant a charger, selectionne a partir d'une liste dans
  276. BufName */
  277. /**************/
  278. /* LIBARCH.CPP */
  279. /**************/
  280. bool LibArchive(wxWindow * frame, const wxString & ArchFullFileName);
  281. /**************/
  282. /* CLEANUP.CPP */
  283. /**************/
  284. void SchematicCleanUp(SCH_SCREEN * screen, wxDC * DC);
  285. /* Routine de nettoyage:
  286. - regroupe les segments de fils (ou de bus) alignes en 1 seul segment
  287. - Detecte les objets identiques superposes
  288. */
  289. void BreakSegmentOnJunction( SCH_SCREEN * Screen );
  290. /* Routine creant des debuts / fin de segment (BUS ou WIRES) sur les jonctions
  291. et les raccords */
  292. DrawPickedStruct * BreakSegment(SCH_SCREEN * screen, wxPoint breakpoint,
  293. bool PutInUndoList = FALSE);
  294. /* Coupe un segment ( BUS, WIRE ) en 2 au point breakpoint,
  295. - si ce point est sur le segment
  296. - extremites non comprises */
  297. /**************/
  298. /* EECLASS.CPP */
  299. /**************/
  300. void SetaParent(EDA_BaseStruct * Struct, BASE_SCREEN * Screen);
  301. /***************/
  302. /* LIBALIAS.CPP */
  303. /***************/
  304. bool BuildAliasData(LibraryStruct * Lib, EDA_LibComponentStruct * component);
  305. /* Create the alias data for the lib component to edit */
  306. int LocateAlias( const wxArrayString & AliasData, const wxString & Name);
  307. /* Return an index in alias data list ( -1 if not found ) */
  308. /***************/
  309. /* OPTIONS.CPP */
  310. /***************/
  311. void DisplayOptionFrame(WinEDA_DrawFrame * parent, const wxPoint & framepos);
  312. /****************/
  313. /* CONTROLE.CPP */
  314. /****************/
  315. void RemoteCommand( const char* cmdline );