/[gpgoe]/trunk/src/GPGOE.h
ViewVC logotype

Diff of /trunk/src/GPGOE.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by twoaday, Fri Apr 7 10:46:41 2006 UTC revision 19 by twoaday, Sun Jun 4 10:12:47 2006 UTC
# Line 21  Line 21 
21  #ifndef GPGOE_H  #ifndef GPGOE_H
22  #define GPGOE_H  #define GPGOE_H
23    
24    /* Macros to support a separate section for variables. */
25    #ifdef __GNUC__
26    #define ATTR_SEC __attribute__((section (".SHARDAT"), shared))
27    #else
28    #define ATTR_SEC
29    #endif
30    
31    #define HASH_BUCKETS 3
32    
33  /* gettext support. */  /* gettext support. */
34  const char *gettext (const char *msgid);  const char *gettext (const char *msgid);
35  #define _(X) gettext ((X))  #define _(X) gettext ((X))
36    
37    
38  #include <malloc.h>  #include <malloc.h>
39  /* wrapper around free. */  /* safe wrapper around free. */
40  #define free_if_alloc(ptr) \  #define free_if_alloc(ptr) \
41  do { \  do { \
42      if (ptr) free (ptr); \      if (ptr) free (ptr); \
# Line 45  do { \ Line 54  do { \
54    
55  #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len)  #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len)
56    
57  /* Dialog IDs for clipboard operations. */  /* Dialog IDs for the various operations. */
58  #define ID_OE_SELECTALL     40125  #define ID_OE_SELECTALL     40125
59  #define ID_OE_COPY          40484  #define ID_OE_COPY          40484
60  #define ID_OE_PASTE         40231  #define ID_OE_PASTE         40231
# Line 58  do { \ Line 67  do { \
67  #define ID_OF_SAVE_FILE      1148  #define ID_OF_SAVE_FILE      1148
68    
69    
70    /* Supported plug-in modes. */
71    enum gpgoe_mode_t {
72        GPGOE_MODE_NORMAL     = 0,
73        GPGOE_MODE_PLAINREPLY = 1,     /* decrypt mails before a reply. */
74        GPGOE_MODE_CACHEPASS  = 2,      /* cache passphrase. */
75    };
76    
77  /* Context for the recipient list. */  /* Context for the recipient list. */
78  struct recip_list_s {  struct recip_list_s {
79      struct recip_list_s *next;      struct recip_list_s *next;
# Line 85  typedef struct plugin_ctx_s *plugin_ctx_ Line 101  typedef struct plugin_ctx_s *plugin_ctx_
101    
102  /* Viewer context. */  /* Viewer context. */
103  struct viewer_ctx_s {  struct viewer_ctx_s {
104        HWND main_wnd;
105      const char *msg;      const char *msg;
106  };  };
107  typedef struct viewer_ctx_s *viewer_ctx_t;  typedef struct viewer_ctx_s *viewer_ctx_t;
108    
109    
110    struct verify_ctx_s {
111        gpgme_signature_t sig;
112        gpgme_data_t text;
113    };
114    typedef struct verify_ctx_s *verify_ctx_t;
115    
116  /*-- GPGOE.c --*/  /*-- GPGOE.c --*/
117  /*EXPORT*/ int gpgoe_initialize (void);  /*EXPORT*/ int gpgoe_initialize (void);
118  /*EXPORT*/ int gpgoe_remove (void);  /*EXPORT*/ int gpgoe_remove (void);
119    /*EXPORT*/ void gpgoe_set_active_modes (int mode);
120    /*EXPORT*/ int gpgoe_get_active_modes (void);
121    
122  /*-- OEProc.c --*/  /*-- OEProc.c --*/
123    extern plugin_ctx_t oe_plug;
124  extern HINSTANCE mod_hinst_dll;  extern HINSTANCE mod_hinst_dll;
125    extern HANDLE plugin_active;
126    
127    /* support for the mailer window. */
128  extern WNDPROC oe_proc_old;  extern WNDPROC oe_proc_old;
129    LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg,
130                              WPARAM wparam, LPARAM lparam);
131    
132    /* support for the common dialogs. */
133  extern WNDPROC of_proc_old;  extern WNDPROC of_proc_old;
134  extern HANDLE plugin_active;  LRESULT CALLBACK of_proc (HWND hwnd, UINT msg,
135  LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);                            WPARAM wparam, LPARAM lparam);
136  LRESULT CALLBACK of_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);  
137    /* support for the main window. */
138    extern WNDPROC oe_main_proc_old;
139    LRESULT CALLBACK oe_main_proc (HWND hwnd, UINT msg,
140                                   WPARAM wparam, LPARAM lparam);
141    
142    
143  /*-- OECrypto.c --*/  /*-- OECrypto.c --*/
144  gpgme_error_t oe_handle_mail (plugin_ctx_t ctx);  gpgme_error_t oe_handle_mail (plugin_ctx_t ctx);
145    gpgme_error_t oe_decrypt_msg (HWND main_wnd, char **r_msg);
146    
147  /*-- OEMisc.c --*/  /*-- OEMisc.c --*/
148    void center_window (HWND hwndChild, HWND parent);
149  char* utf8_to_native (const char *string);  char* utf8_to_native (const char *string);
150  char* native_to_utf8 (const char *string);  char* native_to_utf8 (const char *string);
151  char* get_clip_text (HWND hwnd);  char* get_clip_text (HWND hwnd);
# Line 115  void show_error (HWND hwnd, const char * Line 155  void show_error (HWND hwnd, const char *
155  void* xcalloc (size_t n, size_t m);  void* xcalloc (size_t n, size_t m);
156  char* xstrdup (const char *s);  char* xstrdup (const char *s);
157  void xfree (void *p);  void xfree (void *p);
158    void quote_msg_text (const char *inp, char **r_outp);
159    
160  /*-- dialogs --*/  /*-- dialogs --*/
161  BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam,  BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam,
# Line 134  gpgme_error_t passphrase_cb (void *hook, Line 175  gpgme_error_t passphrase_cb (void *hook,
175                               int prev_was_bad, int fd);                               int prev_was_bad, int fd);
176  void free_pass_cb (pass_cb_t cb);  void free_pass_cb (pass_cb_t cb);
177  pass_cb_t new_pass_cb (HWND main);  pass_cb_t new_pass_cb (HWND main);
178    int pass_cb_cancelled (pass_cb_t cb);
179    void reset_pass_cache (void);
180    
181  /*-- OENLS.c --*/  /*-- OENLS.c --*/
182  int setup_gettext (void);  int setup_gettext (void);

Legend:
Removed from v.12  
changed lines
  Added in v.19

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26