Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.891.568 Times

Tk_CreateItemType 804.027

  Date Added: May 22, 2010  |  Visits: 582


Report Broken Link
Printer Friendly Version

Product Homepage
Download (70 downloads)

Tk_CreateItemType is a Perl module that define new kind of canvas item. SYNOPSIS #include Tk_CreateItemType(typePtr) Tk_ItemType * Tk_GetItemTypes() ARGUMENTS Tk_ItemType *typePtr (in) Structure that defines the new type of canvas item. INTRODUCTION Tk_CreateItemType is invoked to define a new kind of canvas item described by the typePtr argument. An item type corresponds to a particular value of the type argument to the create method for canvases, and the code that implements a canvas item type is called a type manager. Tk defines several built-in item types, such as rectangle and text and image, but Tk_CreateItemType allows additional item types to be defined. Once Tk_CreateItemType returns, the new item type may be used in new or existing canvas widgets just like the built-in item types. Tk_GetItemTypes returns a pointer to the first in the list of all item types currently defined for canvases. The entries in the list are linked together through their nextPtr fields, with the end of the list marked by a NULL nextPtr. You may find it easier to understand the rest of this manual entry by looking at the code for an existing canvas item type such as bitmap (file tkCanvBmap.c) or text (tkCanvText.c). The easiest way to create a new type manager is to copy the code for an existing type and modify it for the new type. Tk provides a number of utility procedures for the use of canvas type managers, such as Tk_CanvasCoords and Tk_CanvasPsColor; these are described in separate manual entries. DATA STRUCTURES A type manager consists of a collection of procedures that provide a standard set of operations on items of that type. The type manager deals with three kinds of data structures. The first data structure is a Tk_ItemType; it contains information such as the name of the type and pointers to the standard procedures implemented by the type manager: typedef struct Tk_ItemType { char *name; int itemSize; Tk_ItemCreateProc *createProc; Tk_ConfigSpec *configSpecs; Tk_ItemConfigureProc *configProc; Tk_ItemCoordProc *coordProc; Tk_ItemDeleteProc *deleteProc; Tk_ItemDisplayProc *displayProc; int alwaysRedraw; Tk_ItemPointProc *pointProc; Tk_ItemAreaProc *areaProc; Tk_ItemPostscriptProc *postscriptProc; Tk_ItemScaleProc *scaleProc; Tk_ItemTranslateProc *translateProc; Tk_ItemIndexProc *indexProc; Tk_ItemCursorProc *icursorProc; Tk_ItemSelectionProc *selectionProc; Tk_ItemInsertProc *insertProc; Tk_ItemDCharsProc *dCharsProc; Tk_ItemType *nextPtr; } Tk_ItemType; The fields of a Tk_ItemType structure are described in more detail later in this manual entry. When Tk_CreateItemType is called, its typePtr argument must point to a structure with all of the fields initialized except nextPtr, which Tk sets to link all the types together into a list. The structure must be in permanent memory (either statically allocated or dynamically allocated but never freed); Tk retains a pointer to this structure. The second data structure manipulated by a type manager is an item record. For each item in a canvas there exists one item record. All of the items of a given type generally have item records with the same structure, but different types usually have different formats for their item records. The first part of each item record is a header with a standard structure defined by Tk via the type Tk_Item; the rest of the item record is defined by the type manager. A type manager must define its item records with a Tk_Item as the first field. For example, the item record for bitmap items is defined as follows: typedef struct BitmapItem { Tk_Item header; double x, y; Tk_Anchor anchor; Pixmap bitmap; XColor *fgColor; XColor *bgColor; GC gc; } BitmapItem; The header substructure contains information used by Tk to manage the item, such as its identifier, its tags, its type, and its bounding box. The fields starting with x belong to the type manager: Tk will never read or write them. The type manager should not need to read or write any of the fields in the header except for four fields whose names are x1, y1, x2, and y2. These fields give a bounding box for the items using integer canvas coordinates: the item should not cover any pixels with x-coordinate lower than x1 or y-coordinate lower than y1, nor should it cover any pixels with x-coordinate greater than or equal to x2 or y-coordinate greater than or equal to y2. It is up to the type manager to keep the bounding box up to date as the item is moved and reconfigured. Whenever Tk calls a procedure in a type manager it passes in a pointer to an item record. The argument is always passed as a pointer to a Tk_Item; the type manager will typically cast this into a pointer to its own specific type, such as BitmapItem. The third data structure used by type managers has type Tk_Canvas; it serves as an opaque handle for the canvas widget as a whole. Type managers need not know anything about the contents of this structure. A Tk_Canvas handle is typically passed in to the procedures of a type manager, and the type manager can pass the handle back to library procedures such as Tk_CanvasTkwin to fetch information about the canvas. name This section and the ones that follow describe each of the fields in a Tk_ItemType structure in detail. The name field provides a string name for the item type. Once Tk_CreateImageType returns, this name may be used in create methods to create items of the new type. If there already existed an item type by this name then the new item type replaces the old one. itemSize typePtr->itemSize gives the size in bytes of item records of this type, including the Tk_Item header. Tk uses this size to allocate memory space for items of the type. All of the item records for a given type must have the same size. If variable length fields are needed for an item (such as a list of points for a polygon), the type manager can allocate a separate object of variable length and keep a pointer to it in the item record..

Requirements: No special requirements
Platforms: Linux
Keyword: Bitmapitem Canvas Createitemtype Item Item Type Item Types Kind Of Manager New New Kind Such As Tk Tkcreateitemtype Type Type Manager
Users rating: 0/10

License: Freeware Size: 5.7 MB
More Reviews or Write Review

Modules  -  File Force 1.0
Web browsers today are pre-configured to display various types of media when accessed directly, such as text files, media (image, video and audio) files, PDF documents, and Flash movies. After this happens, it's typically possible for a visitor to...
Programming  -  PyGTK 2.10.6
PyGTK provides a convenient wrapper for the GTK+ library for use in Python programs, taking care of many of the boring details such as managing memory and type casting. When combined with PyORBit and gnome-python, it can be used to write full...
2.5 MB  
Input Device Utilities  -  TestDisk 6.9
TestDisk was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally erasing your Partition...
2 MB  
Network & Internet  -  PloneMinimalProduct 2.0Beta1
PloneMinimalProduct provides a skeleton one can use to create new types (instead of starting "from scratch"). There is a script called (working with Bash) that will do this job for you. Example usage:: $ tar xzf...
58.37 KB  
Modules  -  Free Item Handling Fee 1.0
A "free" item is any item that has a regular selling price of $0.00. It does not check for specials, which means if you place an item on sale for free then it does not charge the fee.Example:We set the Free Item Handling Fee to $0.50. A user puts...
Desktop Utilities  -  Create New Template Service Menu 0.2.1
Create New Template Service Menu is a context menu item for KDE and Konqueror that automates adding Create New... menu entries from existing files. It adds a "Create Template" item to the Actions submenu of the context menu. It consists of a...
2.05 KB  
Games  -  High Country Snow Fun Match Puzzle Game- Free Version 1.0
When the timer says go- look at the name typed at the top of the screen and quickly find as many bubbles as you can with the matching picture. -Many levels of game play -Easy and hard challenges -Learn all the item types or take a...
14.1 MB  
Lifestyle  -  The Cooker
It is a mobile application that will help people to cook as a professional cookers in an interesting way , instead of searching on internet for each item wanted to be cooked. It will include a several types of food , such as Oriental ,...
1024 KB  
Libraries  -  Tk_CreateImageType 804.027
Tk_CreateImageType is a Perl module to define new kind of image. SYNOPSIS #include Tk_CreateImageType(typePtr) ClientData Tk_GetImageMasterData(interp, name, typePtrPtr) ARGUMENTS Tk_ImageType *typePtr (in) Structure that...
5.7 MB  
Automation Tools  -  DVFileDateCM 1.8
DVFileDateCM is a contextual menu plugin that allows you to quickly and easily see the recording date and time of a DV file while using the Finder. (No need to open iMovie or any other app)Control-clicking on a DV file will bring up the contextual...
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB