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.

423 lines
15 KiB

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