--- trunk/src/GPGOE.h 2006/04/07 10:46:41 12 +++ trunk/src/GPGOE.h 2006/04/13 07:41:30 18 @@ -27,7 +27,7 @@ #include -/* wrapper around free. */ +/* safe wrapper around free. */ #define free_if_alloc(ptr) \ do { \ if (ptr) free (ptr); \ @@ -45,7 +45,7 @@ #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len) -/* Dialog IDs for clipboard operations. */ +/* Dialog IDs for the various operations. */ #define ID_OE_SELECTALL 40125 #define ID_OE_COPY 40484 #define ID_OE_PASTE 40231 @@ -85,6 +85,7 @@ /* Viewer context. */ struct viewer_ctx_s { + HWND main_wnd; const char *msg; }; typedef struct viewer_ctx_s *viewer_ctx_t; @@ -95,17 +96,32 @@ /*EXPORT*/ int gpgoe_remove (void); /*-- OEProc.c --*/ +extern plugin_ctx_t oe_plug; extern HINSTANCE mod_hinst_dll; +extern HANDLE plugin_active; + +/* support for the mailer window. */ extern WNDPROC oe_proc_old; +LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam); + +/* support for the common dialogs. */ 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); +LRESULT CALLBACK of_proc (HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam); + +/* support for the main window. */ +extern WNDPROC oe_main_proc_old; +LRESULT CALLBACK oe_main_proc (HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam); + /*-- OECrypto.c --*/ gpgme_error_t oe_handle_mail (plugin_ctx_t ctx); +gpgme_error_t oe_decrypt_msg (HWND main_wnd, char **r_msg); /*-- OEMisc.c --*/ +void center_window (HWND hwndChild, HWND parent); char* utf8_to_native (const char *string); char* native_to_utf8 (const char *string); char* get_clip_text (HWND hwnd); @@ -115,6 +131,7 @@ void* xcalloc (size_t n, size_t m); char* xstrdup (const char *s); void xfree (void *p); +void quote_msg_text (const char *inp, char **r_outp); /*-- dialogs --*/ BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, @@ -134,6 +151,8 @@ int prev_was_bad, int fd); void free_pass_cb (pass_cb_t cb); pass_cb_t new_pass_cb (HWND main); +int pass_cb_cancelled (pass_cb_t cb); +void free_pass_cache (void); /*-- OENLS.c --*/ int setup_gettext (void);