From 1f483baf37359032ca3224a5d07853aaf725def4 Mon Sep 17 00:00:00 2001 From: Rr42 Date: Mon, 4 Jun 2018 15:25:44 +0530 Subject: Commented all GUI code for core test --- ldmicro/includes/advanceddialog.h | 284 +++++++++++++++++++------------------- ldmicro/includes/ldmicro.h | 22 +-- ldmicro/includes/windows.h | 40 ++++++ 3 files changed, 193 insertions(+), 153 deletions(-) create mode 100644 ldmicro/includes/windows.h (limited to 'ldmicro/includes') diff --git a/ldmicro/includes/advanceddialog.h b/ldmicro/includes/advanceddialog.h index 5e4808f..5adadbc 100644 --- a/ldmicro/includes/advanceddialog.h +++ b/ldmicro/includes/advanceddialog.h @@ -1,142 +1,142 @@ -#ifndef _ADVANCED_DIALOG_H -#define _ADVANCED_DIALOG_H - -#define MAX_PIN_NAME 128 - -/*Advanced Dialog Menus*/ -#define MNU_ADV_NEW 0x01 -#define MNU_ADV_OPEN 0x02 -#define MNU_ADV_SAVE 0x03 -#define MNU_ADV_SAVE_AS 0x04 -#define MNU_ADV_EXIT 0x05 - -#define MNU_ADV_UNDO 0x10 -#define MNU_ADV_REDO 0x11 -#define MNU_ADV_CUT 0x12 -#define MNU_ADV_COPY 0x13 -#define MNU_ADV_PASTE 0x14 -#define MNU_ADV_DEL 0x15 - -#define MNU_ADV_SIMULATION_MODE 0x20 -#define MNU_ADV_START_SIMULATION 0x21 -#define MNU_ADV_STOP_SIMULATION 0x22 -#define MNU_ADV_SINGLE_CYCLE 0x23 - -#define MNU_ADV_MANUAL 0x30 -#define MNU_ADV_ABOUT 0x31 - -#define MAX_NAME_LENGTH 128 -#define MAX_SCREEN_ITEMS 512 -#define MAX_PINS 4000 -#define MCU_PIN_FLAG 4000 -#define MAX_MCU_PINS 128 -#define TIMER_ADV_SIMULATE 101 - - -typedef struct ImageStructTag { - int selectedState; - HIMAGELIST Images; - int ComponentId; -} ImageStruct; - -typedef struct ImageLocationTag{ - int Id; - ImageStruct* Image; - int Index; - int x; - int y; - void* Properties; - void* PinId; - void* PinName; -}ImageLocation; - -typedef struct PinInfoTag{ - double Volt; - double OperatingVolt; - void** ImageId; - int* Index; - int* ImageType; //To compare with imagelocation array - int LinkCount; //No of valid entries in array - double ProgVolt; - void* ProgComponent; -}PinInfo; - -typedef struct PinMcuTag{ - UINT PinId; - UINT state; - int type; - BOOL InternalPullup; -}PinMcu; - -typedef struct PinNameTag{ - UINT PinId; //Need to generate unique pinid every time user saves a name - TCHAR Name[MAX_NAME_LENGTH]; - PinInfo PinData; -}PinName; - -typedef struct PinComponentTag{ - UINT PinId; - void** ComponentAddress; - int Count; - void* Next; -}PinComponent; - -extern HANDLE ImageHeap; -extern HFONT AdvNiceFont; -extern HFONT AdvFixedFont; -extern UINT NameCount; -extern ImageLocation ImageStack[MAX_SCREEN_ITEMS]; -// extern PinInfo PinData[MAX_PINS]; -extern PinMcu McuPin[MAX_MCU_PINS]; -extern PinName NameId[MAX_PINS]; -extern HWND AdvancedDialog; -extern PinComponent ComponentPin; - -/*Advanced Dialog Functions*/ -void MakeAdvancedDialogControls(void); -void AdvancedDialogResized(void); -void MakeAdvancedWindowMenus(void); -void ProcessEvent(int x, int y, int Event); -void AdvancedWindowClosing(void); -void ToggleAdvancedSimulationMode(void); -void SimulateOneAdvCycle(BOOL ForceRefresh); -int IsMCUPin(int PinId); -// void CreateVoltRequest(int PinId, int Index, double VoltReq); - -// Heap Functions -void* AllocImageHeap(size_t n); -void* ReallocImageHeap(LPVOID lpMem, size_t n); -void FreeImageHeap(void *p); - -// Component Functions - -void InitComponents(void); - -double GetGlobalVoltage(int PinId, void* ComponentAddress); -double RefreshVolt(int PinId, int Index, UINT Id, void* ComponentAddress, double volt); -double RefreshProcessorStat(int PinId, UINT Id); - - -int RegisterPinName(LPCTSTR Name); -int SetPinImage(int PinId,void* ImageId,int ImageType, int Index); -int FlushPinNames(void); //Clear Pins which are deleted from MainWindow -int DeRegisterPinName(LPCTSTR Name, void* ImageId); -int DeletePinImage(LPCTSTR Name, void* ImageId, int Index); -int DeletePinName(UINT Index); -void SetMcu(int PinId, int Type); -void RefreshNamingList(void); -void PopulateNamingList(void); - -double RequestVoltChange(int PinId, int Index, void *ComponentAddress, double volt); - -int DeleteComponentPin(int PinId, void* ComponentAddress); -int AddComponentPin(int PinId, void* ComponentAddress); -// int RegisterPinState(int Index, double Volt); - -//NamingList functions -void ToggleInternalPullup(int PinId); - - -extern BOOL SimulationStarted; - -#endif +// #ifndef _ADVANCED_DIALOG_H +// #define _ADVANCED_DIALOG_H + +// #define MAX_PIN_NAME 128 + +// /*Advanced Dialog Menus*/ +// #define MNU_ADV_NEW 0x01 +// #define MNU_ADV_OPEN 0x02 +// #define MNU_ADV_SAVE 0x03 +// #define MNU_ADV_SAVE_AS 0x04 +// #define MNU_ADV_EXIT 0x05 + +// #define MNU_ADV_UNDO 0x10 +// #define MNU_ADV_REDO 0x11 +// #define MNU_ADV_CUT 0x12 +// #define MNU_ADV_COPY 0x13 +// #define MNU_ADV_PASTE 0x14 +// #define MNU_ADV_DEL 0x15 + +// #define MNU_ADV_SIMULATION_MODE 0x20 +// #define MNU_ADV_START_SIMULATION 0x21 +// #define MNU_ADV_STOP_SIMULATION 0x22 +// #define MNU_ADV_SINGLE_CYCLE 0x23 + +// #define MNU_ADV_MANUAL 0x30 +// #define MNU_ADV_ABOUT 0x31 + +// #define MAX_NAME_LENGTH 128 +// #define MAX_SCREEN_ITEMS 512 +// #define MAX_PINS 4000 +// #define MCU_PIN_FLAG 4000 +// #define MAX_MCU_PINS 128 +// #define TIMER_ADV_SIMULATE 101 + + +// typedef struct ImageStructTag { +// int selectedState; +// HIMAGELIST Images; +// int ComponentId; +// } ImageStruct; + +// typedef struct ImageLocationTag{ +// int Id; +// ImageStruct* Image; +// int Index; +// int x; +// int y; +// void* Properties; +// void* PinId; +// void* PinName; +// }ImageLocation; + +// typedef struct PinInfoTag{ +// double Volt; +// double OperatingVolt; +// void** ImageId; +// int* Index; +// int* ImageType; //To compare with imagelocation array +// int LinkCount; //No of valid entries in array +// double ProgVolt; +// void* ProgComponent; +// }PinInfo; + +// typedef struct PinMcuTag{ +// UINT PinId; +// UINT state; +// int type; +// BOOL InternalPullup; +// }PinMcu; + +// typedef struct PinNameTag{ +// UINT PinId; //Need to generate unique pinid every time user saves a name +// TCHAR Name[MAX_NAME_LENGTH]; +// PinInfo PinData; +// }PinName; + +// typedef struct PinComponentTag{ +// UINT PinId; +// void** ComponentAddress; +// int Count; +// void* Next; +// }PinComponent; + +// extern HANDLE ImageHeap; +// extern HFONT AdvNiceFont; +// extern HFONT AdvFixedFont; +// extern UINT NameCount; +// extern ImageLocation ImageStack[MAX_SCREEN_ITEMS]; +// // extern PinInfo PinData[MAX_PINS]; +// extern PinMcu McuPin[MAX_MCU_PINS]; +// extern PinName NameId[MAX_PINS]; +// extern HWND AdvancedDialog; +// extern PinComponent ComponentPin; + +// /*Advanced Dialog Functions*/ +// void MakeAdvancedDialogControls(void); +// void AdvancedDialogResized(void); +// void MakeAdvancedWindowMenus(void); +// void ProcessEvent(int x, int y, int Event); +// void AdvancedWindowClosing(void); +// void ToggleAdvancedSimulationMode(void); +// void SimulateOneAdvCycle(BOOL ForceRefresh); +// int IsMCUPin(int PinId); +// // void CreateVoltRequest(int PinId, int Index, double VoltReq); + +// // Heap Functions +// void* AllocImageHeap(size_t n); +// void* ReallocImageHeap(LPVOID lpMem, size_t n); +// void FreeImageHeap(void *p); + +// // Component Functions + +// void InitComponents(void); + +// double GetGlobalVoltage(int PinId, void* ComponentAddress); +// double RefreshVolt(int PinId, int Index, UINT Id, void* ComponentAddress, double volt); +// double RefreshProcessorStat(int PinId, UINT Id); + + +// int RegisterPinName(LPCTSTR Name); +// int SetPinImage(int PinId,void* ImageId,int ImageType, int Index); +// int FlushPinNames(void); //Clear Pins which are deleted from MainWindow +// int DeRegisterPinName(LPCTSTR Name, void* ImageId); +// int DeletePinImage(LPCTSTR Name, void* ImageId, int Index); +// int DeletePinName(UINT Index); +// void SetMcu(int PinId, int Type); +// void RefreshNamingList(void); +// void PopulateNamingList(void); + +// double RequestVoltChange(int PinId, int Index, void *ComponentAddress, double volt); + +// int DeleteComponentPin(int PinId, void* ComponentAddress); +// int AddComponentPin(int PinId, void* ComponentAddress); +// // int RegisterPinState(int Index, double Volt); + +// //NamingList functions +// void ToggleInternalPullup(int PinId); + + +// extern BOOL SimulationStarted; + +// #endif diff --git a/ldmicro/includes/ldmicro.h b/ldmicro/includes/ldmicro.h index 579d3a7..f7a3d9b 100644 --- a/ldmicro/includes/ldmicro.h +++ b/ldmicro/includes/ldmicro.h @@ -501,7 +501,6 @@ typedef struct McuIoInfoTag { #define NUM_SUPPORTED_MCUS 16 -/* //----------------------------------------------- // Function prototypes @@ -513,7 +512,7 @@ void SetMenusEnabled(BOOL canNegate, BOOL canNormal, BOOL canResetOnly, void SetUndoEnabled(BOOL undoEnabled, BOOL redoEnabled); void RefreshScrollbars(void); extern HINSTANCE Instance; -extern HWND MainWindow; +extern HWID MainWindow; extern HDC Hdc; extern PlcProgram Prog; extern char CurrentSaveFile[MAX_PATH]; @@ -554,14 +553,14 @@ extern BOOL SelectionActive; extern BOOL ThisHighlighted; // draw_outputdev.cpp -extern void (*DrawChars)(int, int, char *); -void CALLBACK BlinkCursor(HWND hwnd, UINT msg, UINT_PTR id, DWORD time); -void PaintWindow(void); -void ExportDrawingAsText(char *file); -void InitForDrawing(void); -void SetUpScrollbars(BOOL *horizShown, SCROLLINFO *horiz, SCROLLINFO *vert); -int ScreenRowsAvailable(void); -int ScreenColsAvailable(void); +// extern void (*DrawChars)(int, int, char *); +// void CALLBACK BlinkCursor(HWND hwnd, UINT msg, UINT_PTR id, DWORD time); +// void PaintWindow(void); +// void ExportDrawingAsText(char *file); +// void InitForDrawing(void); +// void SetUpScrollbars(BOOL *horizShown, SCROLLINFO *horiz, SCROLLINFO *vert); +// int ScreenRowsAvailable(void); +// int ScreenColsAvailable(void); extern HFONT FixedWidthFont; extern HFONT FixedWidthFontBold; extern int SelectedGxAfterNextPaint; @@ -703,6 +702,7 @@ void ShowHelpDialog(BOOL about); Error("Internal error at line %d file '%s'\n", __LINE__, __FILE__); \ exit(1); \ } + void dbp(char *str, ...); void Error(char *str, ...); void *CheckMalloc(size_t n); @@ -777,5 +777,5 @@ void CompileAnsiC(char *outFile); void CompileInterpreted(char *outFile); //Arduino.cpp void CompileArduino(char *outFile); -*/ + #endif diff --git a/ldmicro/includes/windows.h b/ldmicro/includes/windows.h new file mode 100644 index 0000000..2e0621d --- /dev/null +++ b/ldmicro/includes/windows.h @@ -0,0 +1,40 @@ +#ifndef __windows_h_ +#define __windoew_h_ +#include "linuxUI.h" +#include +typedef void* HFONT; +typedef void* HMODULE; +typedef void* HHOOK; +typedef void* HBRUSH; +typedef void* HFONT; + +#if defined(__UNIX64) + typedef __int64_t LONG_PTR; +#else + typedef long LONG_PTR; +#endif + +typedef UINT_PTR WPARAM; +typedef LONG_PTR LPARAM; +typedef LONG_PTR LRESULT; + +typedef struct tagSCROLLINFO { + UINT cbSize; + UINT fMask; + int nMin; + int nMax; + UINT nPage; + int nPos; + int nTrackPos; +} SCROLLINFO, *LPCSCROLLINFO; + +typedef struct tagNMHDR { + HWND hwndFrom; + UINT_PTR idFrom; + UINT code; +} NMHDR; + +void OutputDebugString(char*); +double GetTickCount(void); + +#endif \ No newline at end of file -- cgit