BasicInputMethod/BIM.r

/*
    File:    BIM.r
    
    Description: Basic Input Method resources
 
    Author:  SC
 
    Copyright:   © Copyright 2000-2001 Apple Computer, Inc. All rights reserved.
 
    Disclaimer:  IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
                 ("Apple") in consideration of your agreement to the following terms, and your
                 use, installation, modification or redistribution of this Apple software
                 constitutes acceptance of these terms.  If you do not agree with these terms,
                 please do not use, install, modify or redistribute this Apple software.
 
                 In consideration of your agreement to abide by the following terms, and subject
                 to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
                 copyrights in this original Apple software (the "Apple Software"), to use,
                 reproduce, modify and redistribute the Apple Software, with or without
                 modifications, in source and/or binary forms; provided that if you redistribute
                 the Apple Software in its entirety and without modifications, you must retain
                 this notice and the following text and disclaimers in all such redistributions of
                 the Apple Software.  Neither the name, trademarks, service marks or logos of
                 Apple Computer, Inc. may be used to endorse or promote products derived from the
                 Apple Software without specific prior written permission from Apple.  Except as
                 expressly stated in this notice, no other rights or licenses, express or implied,
                 are granted by Apple herein, including but not limited to any patent rights that
                 may be infringed by your derivative works or by other works in which the Apple
                 Software may be incorporated.
 
                 The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
                 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
                 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
                 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
                 COMBINATION WITH YOUR PRODUCTS.
 
                 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
                 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
                 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
                 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
                 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
                 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
    Change History (most recent first):
 
                 2001/04/18 SC  Changed the name of the debug palette menu item
                 2001/03/12 SC  Changed the script system to smRoman
         2000/06/01 SC  Created
 
*/
 
#define UseExtendedThingResource 1
 
#include <Carbon/Carbon.r>
 
#include "BIMScript.h"
 
resource 'thng' (128)
{
    'tsvc',             /* The component type. Must be 'tsvc' (text service). */
    'inpm',             /* The component subtype. Must be 'inpm' (input method). */
    'appl',             /* This must be a unique vendor code. */
    0x8000 + kBIMScript * 0x100 +
    kBIMLanguage,           /* 0x8000 + script code * 256 + language code.
                                           For example, if the text service is Japanese --
                                           smJapanese (1) and langJapanese (14) the value is
                                           0x8000 + 0x0100 + 0x000B = 0x0000810B */
    kAnyComponentFlagsMask,     /* Must be kAnyComponentFlagsMask. */
    'dlle', kBaseResourceID,        /* A reference to our dispatch code. */
    'STR ', kBaseResourceID,
    'STR ', kBaseResourceID,
    'ICON', kBaseResourceID,
    0x00010000,
    componentHasMultiplePlatforms,
    15872 + kBIMScript * 0x200,
    {
        0x8000 + kBIMScript * 0x100 +
        kBIMLanguage,           /* 0x8000 + script code * 256 + language code.
                                           For example, if the text service is Japanese --
                                           smJapanese (1) and langJapanese (14) the value is
                                           0x8000 + 0x0100 + 0x000B = 0x0000810B */
        'dlle', kBaseResourceID, 1000
    }
};
 
resource 'dlle' (kBaseResourceID) {
    "BIMComponentDispatch"
};
 
/*  Pencil Icon Resources - These resources define the icon that is used as our pencil
    menu title. */
 
data 'ics#' (kBaseResourceID + 1) {
    $"0000 0038 0054 00A2 0146 028A 0514 0A28 1450 38A0 4540 4280 4300 6200 7C00 0000"
    $"0000 0038 007C 00FE 01FE 03FE 07FC 0FF8 1FF0 3FE0 7FC0 7F80 7F00 7E00 7C00 0000"
};
 
data 'ics4' (kBaseResourceID + 1) {
    $"0000 0000 0000 0000 0000 0000 00FF F000 0000 0000 0F70 7F00 0000 0000 F707 C7F0"
    $"0000 000F 707C 75F0 0000 00F7 07C7 55F0 0000 0F70 7C75 5F00 0000 F707 C755 F000"
    $"000F 707C 755F 0000 00F7 07C7 55F0 0000 0FC2 CC75 5F00 0000 0F2C 2C55 F000 0000"
    $"0FC2 C25F 0000 0000 0FFC 2CF0 0000 0000 0FFF FF00 0000 0000 0000 0000 0000 0000"
};
 
data 'ics8' (kBaseResourceID + 1) {
    $"0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FF00 0000"
    $"0000 0000 0000 0000 00FF 2A00 54FF 0000 0000 0000 0000 0000 FF2A 0054 5454 FF00"
    $"0000 0000 0000 00FF 2A00 5454 54AB FF00 0000 0000 0000 FF2A 0054 5454 ABAB FF00"
    $"0000 0000 00FF 2A00 5454 54AB ABFF 0000 0000 0000 FF2A 0054 5454 ABAB FF00 0000"
    $"0000 00FF 2A00 5454 54AB ABFF 0000 0000 0000 FF2A 0054 5454 ABAB FF00 0000 0000"
    $"00FF 0808 0854 54AB ABFF 0000 0000 0000 00FF 0808 0808 ABAB FF00 0000 0000 0000"
    $"00FF 0808 0833 ABFF 0000 0000 0000 0000 00FF FF08 3333 FF00 0000 0000 0000 0000"
    $"00FF FFFF FFFF 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000"
};
 
/*  Keyboard Icon Resources - These resources define the icon that is used to represent our
    text service in the keyboard menu, menu bar, and System Preferences. */
 
data 'kcs#' (kBaseResourceID) {
    $"0000 3600 2A01 3403 4605 83FD F0F9 0C72 0C02 0C02 09F3 0A09 0A05 0A05 140A 1C0E"
    $"0000 3600 3E01 3C03 7E07 FFFF FFFF 0FFE 0FFE 0FFE 0FFF 0E0F 0E07 0E07 1C0E 1C0E"
};
 
data 'kcs4' (kBaseResourceID) {
    $"0000 0000 0000 0000 00FF 0FF0 0000 0000 00F0 F0F0 0000 000F 00FF 0F00 0000 00FF"
    $"0F00 0FF0 0000 0F0F F000 00FF FFFF FF0F FFFF D000 FFFF F0DF 0000 FF00 0FFF 00F0"
    $"0000 FF00 0000 00F0 0000 FF00 0000 00F0 0000 FD0F FFFF D0DF 0000 F0F0 0000 FD0F"
    $"0000 F0F0 0000 0F0F 0000 F0F0 0000 0F0F 000F 0F00 0000 F0F0 000F FF00 0000 FFF0"
};
 
data 'kcs8' (kBaseResourceID) {
    $"0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF 00FF FF00 0000 0000 0000 0000"
    $"0000 FF00 FF00 FF00 0000 0000 0000 00FF 0000 FFFF 00FF 0000 0000 0000 0000 FFFF"
    $"00FF 0000 00FF FF00 0000 0000 00FF 00FF FF00 0000 0000 FFFF FFFF FFFF FFFF 00FF"
    $"FFFF FFFF F900 0000 FFFF FFFF FF00 F9FF 0000 0000 FFFF 0000 00FF FFFF 0000 FF00"
    $"0000 0000 FFFF 0000 0000 0000 0000 FF00 0000 0000 FFFF 0000 0000 0000 0000 FF00"
    $"0000 0000 FFF9 00FF FFFF FFFF F900 F9FF 0000 0000 FF00 FF00 0000 0000 FFF9 00FF"
    $"0000 0000 FF00 FF00 0000 0000 00FF 00FF 0000 0000 FF00 FF00 0000 0000 00FF 00FF"
    $"0000 00FF 00FF 0000 0000 0000 FF00 FF00 0000 00FF FFFF 0000 0000 0000 FFFF FF00"
};
 
resource 'MENU' (kBaseResourceID + 1)
{
    kBaseResourceID,
    textMenuProc,
    allEnabled,
    enabled,
    "00000",
    {
        "Show Keyboard Palette", noIcon, "K", noMark, plain,
        "Show Send Event Palette", noIcon, "D", noMark, plain,
        "-", noIcon, noKey, noMark, plain,
        "Convert To Lowercase", noIcon, "L", noMark, plain,
        "Convert To Uppercase", noIcon, "U", noMark, plain
    }
};
 
resource 'xmnu' (kBaseResourceID + 1)
{
    versionZero
    {
        {
            dataItem {'SHKP', kMenuShiftModifier + kMenuControlModifier + kMenuNoCommandModifier,
                      currScript, 0, 0, noHierID, sysFont, naturalGlyph},
            dataItem {'SHDP', kMenuShiftModifier + kMenuControlModifier + kMenuNoCommandModifier,
                      currScript, 0, 0, noHierID, sysFont, naturalGlyph},
            skipItem {},
            dataItem {'CLOW', kMenuShiftModifier + kMenuControlModifier + kMenuNoCommandModifier,
                      currScript, 0, 0, noHierID, sysFont, naturalGlyph},
            dataItem {'CUPP', kMenuShiftModifier + kMenuControlModifier + kMenuNoCommandModifier,
                      currScript, 0, 0, noHierID, sysFont, naturalGlyph}
        }
    }
};
 
resource 'STR ' (kBaseResourceID)
{
    "Basic Input Method"
};
 
resource 'STR#' (kBaseResourceID + 1)
{
    {
    "Show Keyboard Palette",
        "Hide Keyboard Palette",
    "Show Send Event Palette",
        "Hide Send Event Palette"
    }
};