| 1 | /* |
| 2 | * tkUnix.c -- |
| 3 | * |
| 4 | * This file contains procedures that are UNIX/X-specific, and |
| 5 | * will probably have to be written differently for Windows or |
| 6 | * Macintosh platforms. |
| 7 | * |
| 8 | * Copyright (c) 1995 Sun Microsystems, Inc. |
| 9 | * |
| 10 | * See the file "license.terms" for information on usage and redistribution |
| 11 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 12 | * |
| 13 | * RCS: @(#) $Id: tkUnix.c,v 1.5 2002/01/25 21:09:37 dgp Exp $ |
| 14 | */ |
| 15 | |
| 16 | #include <tkInt.h> |
| 17 | |
| 18 | /* |
| 19 | *---------------------------------------------------------------------- |
| 20 | * |
| 21 | * TkGetServerInfo -- |
| 22 | * |
| 23 | * Given a window, this procedure returns information about |
| 24 | * the window server for that window. This procedure provides |
| 25 | * the guts of the "winfo server" command. |
| 26 | * |
| 27 | * Results: |
| 28 | * None. |
| 29 | * |
| 30 | * Side effects: |
| 31 | * None. |
| 32 | * |
| 33 | *---------------------------------------------------------------------- |
| 34 | */ |
| 35 | |
| 36 | void |
| 37 | TkGetServerInfo(interp, tkwin) |
| 38 | Tcl_Interp *interp; /* The server information is returned in |
| 39 | * this interpreter's result. */ |
| 40 | Tk_Window tkwin; /* Token for window; this selects a |
| 41 | * particular display and server. */ |
| 42 | { |
| 43 | char buffer[8 + TCL_INTEGER_SPACE * 2]; |
| 44 | char buffer2[TCL_INTEGER_SPACE]; |
| 45 | |
| 46 | sprintf(buffer, "X%dR%d ", ProtocolVersion(Tk_Display(tkwin)), |
| 47 | ProtocolRevision(Tk_Display(tkwin))); |
| 48 | sprintf(buffer2, " %d", VendorRelease(Tk_Display(tkwin))); |
| 49 | Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)), |
| 50 | buffer2, (char *) NULL); |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | *---------------------------------------------------------------------- |
| 55 | * |
| 56 | * TkGetDefaultScreenName -- |
| 57 | * |
| 58 | * Returns the name of the screen that Tk should use during |
| 59 | * initialization. |
| 60 | * |
| 61 | * Results: |
| 62 | * Returns the argument or a string that should not be freed by |
| 63 | * the caller. |
| 64 | * |
| 65 | * Side effects: |
| 66 | * None. |
| 67 | * |
| 68 | *---------------------------------------------------------------------- |
| 69 | */ |
| 70 | |
| 71 | CONST char * |
| 72 | TkGetDefaultScreenName(interp, screenName) |
| 73 | Tcl_Interp *interp; /* Interp used to find environment variables. */ |
| 74 | CONST char *screenName; /* Screen name from command line, or NULL. */ |
| 75 | { |
| 76 | if ((screenName == NULL) || (screenName[0] == '\0')) { |
| 77 | #if 0 |
| 78 | screenName = Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY); |
| 79 | #else |
| 80 | screenName = getenv("DISPLAY"); |
| 81 | #endif |
| 82 | } |
| 83 | return screenName; |
| 84 | } |
| 85 | |
| 86 | /* |
| 87 | *---------------------------------------------------------------------- |
| 88 | * |
| 89 | * Tk_UpdatePointer -- |
| 90 | * |
| 91 | * Unused function in UNIX |
| 92 | * |
| 93 | * Results: |
| 94 | * None. |
| 95 | * |
| 96 | * Side effects: |
| 97 | * None. |
| 98 | * |
| 99 | *---------------------------------------------------------------------- |
| 100 | */ |
| 101 | |
| 102 | void |
| 103 | Tk_UpdatePointer(tkwin, x, y, state) |
| 104 | Tk_Window tkwin; /* Window to which pointer event |
| 105 | * is reported. May be NULL. */ |
| 106 | int x, y; /* Pointer location in root coords. */ |
| 107 | int state; /* Modifier state mask. */ |
| 108 | { |
| 109 | /* |
| 110 | * This function intentionally left blank |
| 111 | */ |
| 112 | } |