![]() |
GNU PROLOG with UTF8 support
|
#include <stdio.h>#include <ctype.h>#include <string.h>#include <malloc.h>#include "../EnginePl/gp_config.h"#include "../EnginePl/pl_params.h"#include "../EnginePl/set_locale.h"#include "w32gc_interf.h"#include "../TopComp/prolog_path.c"#include "../TopComp/copying.c"#include <windows.h>#include <windowsx.h>#include <commctrl.h>#include <richedit.h>#include <shlobj.h>#include <shellapi.h>#include "w32_resource.h"#include "../Linedit/terminal.h"
Macros | |
| #define | GUI_VERSION "1.1" |
| #define | ADDITIONAL_INFORMATION |
| #define | DLLEXPORT __declspec(dllexport) |
| #define | GetWindowLongPtr GetWindowLong |
| #define | SetWindowLongPtr SetWindowLong |
| #define | EDIT_FIELD_SIZE 64000 /* 0 does not work ! why ? */ |
| #define | FIX_TAB 1 |
| #define | FIX_CR 2 |
| #define | FIX_BACKSLASH 4 |
| #define | FIX_QUOTE 8 |
| #define | Queue_Is_Empty() (queue_start == queue_end) |
| #define | Enqueue(c) |
| #define | Dequeue(c) |
| #define | SET_CHECKED_OPT(idm_cmd, var) CheckMenuItem(GetMenu(hwndMain), idm_cmd, (var) ? MF_CHECKED : MF_UNCHECKED) |
| #define | READ_INT_REG(key_name, var) |
| #define | WRITE_INT_REG(key_name, var) |
| #define | READ_BOOL_REG(key_name, var) |
| #define | WRITE_BOOL_REG(key_name, var) |
| #define | Is_A_Sep(c) (!isprint(c) || (strchr(separators, c) != NULL)) |
| #define | BIF_NEWDIALOGSTYLE 0x40 |
| #define | BIF_NONEWFOLDERBUTTON 0x0200 |
Functions | |
| static int | CallMain (void *unused) |
| static int | StartWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) |
| static BOOL | InitApplication (void) |
| static HWND | Createw32_consoleWndClassWnd (void) |
| static LRESULT CALLBACK | MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) |
| static void | MainWndProc_OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) |
| static void | Create_Edit_Control (HWND hwnd) |
| static void | SubClassEditField (HWND hwnd) |
| static LRESULT CALLBACK | SubClassEdit (HWND hwnd, UINT msg, WPARAM mp1, LPARAM mp2) |
| static int CALLBACK | WordBreakProc (LPTSTR lpcb, int ichCurrent, int cch, int code) |
| static void | Toggle_Wrap_Mode (HWND hwnd) |
| static HFONT | Create_Courier_Font (void) |
| static int | Change_Font (HWND hwnd) |
| BOOL CALLBACK | StackSizesProc (HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) |
| static void | Load_Options (void) |
| static void | Save_Options (void) |
| static void | Activate_Options (void) |
| static char * | Get_Current_Word (int select_it) |
| static void | Consult_File (void) |
| static void | Change_Directory (void) |
| static void | Insert_File_Name (void) |
| static char * | Get_Selected_File_Name (char *title, char *default_ext, char *filter) |
| static char * | Get_Selected_Directory (char *title, int new_folder) |
| static void | Show_Help (char *word) |
| static int | Get_CHM_Help_Path (char *path) |
| static int WINAPI | BrowseCallbackProc (HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) |
| static void | Add_Clipboard_To_Queue (void) |
| static void | Add_String_To_Queue (char *str, int mask_fix) |
| static void | Add_Char_To_Queue (int c) |
| static void | Set_Selection (int posit, int n) |
| static void | Set_Caret_Position (int posit) |
| static int | Move_Caret_To (int start_or_end) |
| static void | Move_Caret_From_Mouse (int if_no_selection) |
| static int | Delete_Selection (void) |
| static void | Display_Text (char *str, int n) |
| static void | Flush_Buffer (void) |
| DLLEXPORT void | W32GC_Set_Line_Buffering (int is_buffered) |
| DLLEXPORT void | W32GC_Backd (int n) |
| DLLEXPORT int | W32GC_Confirm_Box (char *titre, char *msg) |
| static BOOL | Launched_From_Command_Line () |
| static HWND | Find_Text_Console_Handle (void) |
| static void | Show_Text_Console (int show) |
| BOOL DLLEXPORT WINAPI | DllMain (HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved) |
| DLLEXPORT int | W32GC_Start_Window (char *(*get_separators)(), int(*get_prompt_length)(), PlLong(*query_stack)()) |
| static char * | Make_Windows_Filter (char *filter) |
| DLLEXPORT int | W32GC_Kbd_Is_Not_Empty () |
| DLLEXPORT int | W32GC_Get_Char0 () |
| DLLEXPORT int | W32GC_Get_Line_Buffering (void) |
| DLLEXPORT void | W32GC_Flush (FILE *f) |
| DLLEXPORT void | W32GC_Put_Char (int c) |
| DLLEXPORT void | W32GC_Forwd (int n) |
| DLLEXPORT void | W32GC_Displ (int n, char *str) |
| DLLEXPORT void | W32GC_Displ_Str (char *str) |
| DLLEXPORT void | W32GC_Erase (int n) |
| DLLEXPORT void | W32GC_Emit_Beep () |
| DLLEXPORT void | W32GC_Ins_Mode (int ins_mode) |
| DLLEXPORT void | W32GC_Screen_Size (int *row, int *col) |
| DLLEXPORT void | W32GC_Message_Box (char *title, char *msg, int type) |
| DLLEXPORT void | W32GC_Exit_Process (int ret_val) |
Variables | |
| static char *(* | fct_get_separators )() |
| static int(* | fct_get_prompt_length )() |
| static PlLong(* | fct_query_stack )() |
| static unsigned int | queue [EDIT_FIELD_SIZE] |
| static int | queue_start |
| static int | queue_end |
| static CRITICAL_SECTION | cs_queue |
| static HANDLE | event_window_is_ready |
| static HANDLE | event_char_in_queue |
| static HWND | hwndMain |
| static HWND | hwndEditControl |
| static WNDPROC | lpEProc |
| static HINSTANCE | hInst |
| static LOGFONT | currentFont |
| static HFONT | hFont |
| static int | show_console = 0 |
| static HWND | hwnd_console |
| static int | in_get_char = 0 |
| static int | last_is_read = 0 |
| static int | posit = 0 |
| static int | ec_start = 0 |
| static int | win_x = CW_USEDEFAULT |
| static int | win_y = CW_USEDEFAULT |
| static int | win_width = CW_USEDEFAULT |
| static int | win_height = CW_USEDEFAULT |
| static int | copy_on_sel = 1 |
| static int | wrap_mode = 0 |
| static int | line_buffering = 1 |
| static int | beep_on_error = 0 |
| static char | wr_buffer [10240] |
| static char * | wr_buffer_ptr = wr_buffer |
| static int | dont_use_selection |
| static char | buff_pathname [MAX_PATH] |
| struct { | |
| int idc_desc | |
| int idc_def_sz | |
| int idc_env_var_name | |
| int idc_env_var_sz | |
| int idc_reg_sz | |
| int idc_cur_sz | |
| } | stk [] |
| #define ADDITIONAL_INFORMATION |
| #define BIF_NEWDIALOGSTYLE 0x40 |
| #define BIF_NONEWFOLDERBUTTON 0x0200 |
| #define DLLEXPORT __declspec(dllexport) |
| #define EDIT_FIELD_SIZE 64000 /* 0 does not work ! why ? */ |
| #define FIX_BACKSLASH 4 |
| #define FIX_CR 2 |
| #define FIX_QUOTE 8 |
| #define FIX_TAB 1 |
| #define GetWindowLongPtr GetWindowLong |
| #define GUI_VERSION "1.1" |
| #define Is_A_Sep | ( | c | ) | (!isprint(c) || (strchr(separators, c) != NULL)) |
| #define Queue_Is_Empty | ( | ) | (queue_start == queue_end) |
| #define READ_BOOL_REG | ( | key_name, | |
| var | |||
| ) |
| #define READ_INT_REG | ( | key_name, | |
| var | |||
| ) |
| #define SET_CHECKED_OPT | ( | idm_cmd, | |
| var | |||
| ) | CheckMenuItem(GetMenu(hwndMain), idm_cmd, (var) ? MF_CHECKED : MF_UNCHECKED) |
| #define SetWindowLongPtr SetWindowLong |
| #define WRITE_BOOL_REG | ( | key_name, | |
| var | |||
| ) |
| #define WRITE_INT_REG | ( | key_name, | |
| var | |||
| ) |
|
static |


|
static |

|
static |


|
static |

|
static |

|
static |


|
static |


|
static |

|
static |


|
static |

|
static |


|
static |

|
static |


|
static |


| BOOL DLLEXPORT WINAPI DllMain | ( | HINSTANCE | hDLLInst, |
| DWORD | fdwReason, | ||
| LPVOID | lpvReserved | ||
| ) |
|
static |

|
static |


|
static |


|
static |

|
static |


|
static |


|
static |


|
static |


|
static |

|
static |


|
static |


|
static |


|
static |

|
static |


|
static |


|
static |

|
static |


|
static |

|
static |


|
static |

| BOOL CALLBACK StackSizesProc | ( | HWND | hwndDlg, |
| UINT | message, | ||
| WPARAM | wParam, | ||
| LPARAM | lParam | ||
| ) |

|
static |


|
static |


|
static |


|
static |


| DLLEXPORT void W32GC_Backd | ( | int | n | ) |


| DLLEXPORT int W32GC_Confirm_Box | ( | char * | titre, |
| char * | msg | ||
| ) |


| DLLEXPORT void W32GC_Displ | ( | int | n, |
| char * | str | ||
| ) |

| DLLEXPORT void W32GC_Displ_Str | ( | char * | str | ) |

| DLLEXPORT void W32GC_Emit_Beep | ( | ) |
| DLLEXPORT void W32GC_Erase | ( | int | n | ) |

| DLLEXPORT void W32GC_Exit_Process | ( | int | ret_val | ) |

| DLLEXPORT void W32GC_Flush | ( | FILE * | f | ) |

| DLLEXPORT void W32GC_Forwd | ( | int | n | ) |

| DLLEXPORT int W32GC_Get_Char0 | ( | ) |

| DLLEXPORT int W32GC_Get_Line_Buffering | ( | void | ) |
| DLLEXPORT void W32GC_Ins_Mode | ( | int | ins_mode | ) |
| DLLEXPORT int W32GC_Kbd_Is_Not_Empty | ( | ) |
| DLLEXPORT void W32GC_Message_Box | ( | char * | title, |
| char * | msg, | ||
| int | type | ||
| ) |


| DLLEXPORT void W32GC_Put_Char | ( | int | c | ) |

| DLLEXPORT void W32GC_Screen_Size | ( | int * | row, |
| int * | col | ||
| ) |
| DLLEXPORT void W32GC_Set_Line_Buffering | ( | int | is_buffered | ) |


| DLLEXPORT int W32GC_Start_Window | ( | char *(*)() | get_separators, |
| int(*)() | get_prompt_length, | ||
| PlLong(*)() | query_stack | ||
| ) |


|
static |

|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| int idc_cur_sz |
| int idc_def_sz |
| int idc_desc |
| int idc_env_var_name |
| int idc_env_var_sz |
| int idc_reg_sz |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct { ... } stk[] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
1.8.11