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

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

Serving Software Downloads in 956 Categories, Downloaded 50.216.436 Times

Tk_CreateItemType 804.027

  Date Added: May 22, 2010  |  Visits: 1.005

Tk_CreateItemType

Report Broken Link
Printer Friendly Version


Product Homepage
Download (91 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
USER REVIEWS
More Reviews or Write Review


TK_CREATEITEMTYPE RELATED
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...
 
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  
Programming  -  FreeBASIC Compiler 0.16 / 0.18.1b
FreeBASIC - as the name suggests - is a free, open-source, 32-bit, MS-QuickBASICs syntax-compatible compiler, that adds new features such as pointers, unsigned data types, inline-assembly and many others.. FreeBASIC compiler official page (a free...
3.1 MB  
Development Tools  -  FreeBASIC 0.18.5b 1.0
FreeBASIC is a  32-bit BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, unsigned data types, inline assembly, object orientation, and many others.Features: - A large number of variable types available...
 
Modules  -  Ubercart Text Based Best Sellers Blocks 1.0
When mouse over occurs on an item an image of the product is displayed form imagecache product_list.It also provides an additional block that scrolls through the top ten sellers.InstallationUnpack in your modules folder (usually...
 
Finance  -  VAT Service Invoice Form 1.10
In UK if a business owner is registered for VAT, then whenever it supplies goods or services to someone else who is also registered for VAT, the supplier must give the customer a VAT invoice. If the business is VAT registered, you can normally...
34.73 KB  
E-Commerce  -  OpenAccountingJ 07.07
OAJ (OpenAccountingJ) is a free, open-source, web-based Accounting/ERP system. Built in Java using the best-of-breed Open Source components, such as Spring Framework, Acegi Security, Hibernate, Jasper Reports, XDoclet it offers a solid,...
 
Modules  -  Like Button for Twitter by Truelike 0.9.4
How is the Like Button for Twitter better? * You get relevant backlinks from Truelike. Your links will be on Twitter, too, but they only give nofollow links. * Truelike offers a Like and a 5-star Rating button for Twitter - not even Facebook has...
92.16 KB  
Web Browser Plug-ins  -  WebPage Captor 1.4
Webpage Captor is a Plugin for Microsoft Internet Explorer that allows you to takes a snapshot of a complete webpage as image This plugin adds a button the the Internet Explorer toolbar and an entry to the Tools menu, once you click on the...
541.11 KB  
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 customize.sh (working with Bash) that will do this job for you. Example usage:: $ tar xzf...
58.37 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.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...
3.88 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