--- trunk/src/GPGOE.h 2006/04/03 17:10:15 11 +++ trunk/src/GPGOE.h 2006/04/07 10:46:41 12 @@ -21,8 +21,10 @@ #ifndef GPGOE_H #define GPGOE_H -/* dummy until gettext support is finished. */ -#define _(X) (X) +/* gettext support. */ +const char *gettext (const char *msgid); +#define _(X) gettext ((X)) + #include /* wrapper around free. */ @@ -43,19 +45,17 @@ #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len) -/* OE5 V5.x/V6 command id's. */ -#define ID_OE5_SELECTALL 40125 -#define ID_OE5_COPY 40484 -#define ID_OE5_PASTE 40231 -#define ID_OE5_ENCRYPT 40260 -#define ID_OE5_SIGN 40299 -#define ID_OE5_SEND 40411 -#define ID_OE5_PREVMSG 40145 -#define ID_OE5_NEXTMSG 40146 - -/* Common dialogs (GetOpenFileName) */ -#define OF_IDOK 1 -#define OF_IDFILE 1152 +/* Dialog IDs for clipboard operations. */ +#define ID_OE_SELECTALL 40125 +#define ID_OE_COPY 40484 +#define ID_OE_PASTE 40231 +#define ID_OE_SAVE_ATT 40104 + +/* Common dialogs (Get{Open,Save}FileName) */ +#define ID_OF_OK 1 +#define ID_OF_CANCEL 2 +#define ID_OF_OPEN_FILE 1152 +#define ID_OF_SAVE_FILE 1148 /* Context for the recipient list. */ @@ -70,6 +70,7 @@ struct plugin_ctx_s { HWND msg_wnd, main_wnd, addr_wnd; HWND to_wnd, cc_wnd, bcc_wnd; + HWND attach; char *to; char *cc; char *bcc; @@ -78,6 +79,7 @@ recip_list_t rset; char errbuf[256]; char *orig_text; + int use_utf8; }; typedef struct plugin_ctx_s *plugin_ctx_t; @@ -95,19 +97,24 @@ /*-- OEProc.c --*/ extern HINSTANCE mod_hinst_dll; extern WNDPROC oe_proc_old; +extern WNDPROC of_proc_old; +extern HANDLE plugin_active; LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); +LRESULT CALLBACK of_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); /*-- OECrypto.c --*/ gpgme_error_t oe_handle_mail (plugin_ctx_t ctx); /*-- OEMisc.c --*/ char* utf8_to_native (const char *string); +char* native_to_utf8 (const char *string); char* get_clip_text (HWND hwnd); int set_clip_text (HWND hwnd, const char *text, int nbytes); void show_error (HWND hwnd, const char *caption, UINT type, const char *fmt, ...); void* xcalloc (size_t n, size_t m); char* xstrdup (const char *s); +void xfree (void *p); /*-- dialogs --*/ BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, @@ -128,4 +135,7 @@ void free_pass_cb (pass_cb_t cb); pass_cb_t new_pass_cb (HWND main); +/*-- OENLS.c --*/ +int setup_gettext (void); + #endif /* GPGOE_H */