| 1 | /* $Id: macpgkey.c,v 1.1 2003/02/16 13:03:12 ben Exp $ */ |
| 2 | /* |
| 3 | * Copyright (c) 2003 Ben Harris |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person |
| 7 | * obtaining a copy of this software and associated documentation |
| 8 | * files (the "Software"), to deal in the Software without |
| 9 | * restriction, including without limitation the rights to use, |
| 10 | * copy, modify, merge, publish, distribute, sublicense, and/or |
| 11 | * sell copies of the Software, and to permit persons to whom the |
| 12 | * Software is furnished to do so, subject to the following |
| 13 | * conditions: |
| 14 | * |
| 15 | * The above copyright notice and this permission notice shall be |
| 16 | * included in all copies or substantial portions of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR |
| 22 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 23 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 25 | * SOFTWARE. |
| 26 | */ |
| 27 | |
| 28 | /* Stuff to handle the key window in PuTTYgen */ |
| 29 | |
| 30 | #include <MacTypes.h> |
| 31 | #include <Dialogs.h> |
| 32 | #include <MacWindows.h> |
| 33 | |
| 34 | #include "putty.h" |
| 35 | #include "mac.h" |
| 36 | #include "macpgrid.h" |
| 37 | |
| 38 | void mac_newkey(void) |
| 39 | { |
| 40 | KeyState *ks; |
| 41 | WinInfo *wi; |
| 42 | |
| 43 | ks = smalloc(sizeof(*ks)); |
| 44 | ks->box = GetNewDialog(wKey, NULL, (WindowPtr)-1); |
| 45 | wi = smalloc(sizeof(*wi)); |
| 46 | memset(wi, 0, sizeof(*wi)); |
| 47 | wi->ks = ks; |
| 48 | wi->wtype = wKey; |
| 49 | SetWRefCon(ks->box, (long)wi); |
| 50 | ShowWindow(ks->box); |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | * Local Variables: |
| 55 | * c-file-style: "simon" |
| 56 | * End: |
| 57 | */ |