Chapter 19 Drag and Drop 433
19.1 Drag and Drop Objects 435
19.2 Registering Drop-sites 436
19.2.1 Adding and Deleting Regions 436
19.2.2 Handling Events 437
19.2.2.1 Preview events 438
19.2.2.2 Event forwarding 438
19.2.2.3 Handling drop and preview events 438
19.3 Sourcing the Drag 439
19.3.1 Initiating the Drop Operation 440
19.3.2 Interaction with the Selection Package 441
19.3.3 Defining the Drag/Accept Cursor 441
19.3.4 Timeout Value 442
19.4 Receiving a Drop 442
19.4.0.1 The move operation 443
19.4.0.2 The done procedure 443
19.5 Sample Program-Sourcing a Drag 444
19.6 Sample Program-Drop Site Item and Destination 450
19.7 Drag and Drop Package Summary 456
Chapter 20 The Notifier 459
20.1 Basic Concepts 459
20.1.1 Mainline Input Handling 459
20.1.2 Event-driven Input Handling 460
20.2 Functions of the Notifier 460
20.3 How the Notifier Works 461
20.3.1 Restrictions 461
20.3.1.1 System calls to avoid 462
20.4 What is a Notifier Client? 463
20.4.1 Types of Interaction 463
20.5 Signal Handling 464
20.5.1 Signals to Avoid 464
20.5.2 A Replacement for signal() 465
20.5.3 Timers 467
20.5.4 Handling SIGTERM 470
20.5.5 Handling SIGCHLD 471
20.5.5.1 Reaping dead processes 472
20.6 Interaction with RPC 473
20.7 Client Events 474
20.7.1 Receiving Client Events 475
20.7.2 Posting Client Events 476
20.7.2.1 Actual delivery time 477
20.7.3 Posting with an Argument 477
20.7.4 Posting Destroy Events 478
20.7.5 Delivery Time of Destroy Events 479
20.8 Reading and Writing Through File Descriptors 479
20.8.1 Reading Files 480
20.8.2 Reading and Writing on Pipes 482
20.8.3 Exception Occurred Events 487
20.8.4 Getting an Event Handler 487
20.9 Interposition 488
20.9.1 Uses of Interposition 489
20.9.2 Interface to Interposition 489
20.9.3 Registering an Interposer 489
20.9.4 Invoking the Next Function 490
20.9.5 Removing an Interposed Function 491
20.9.6 An Interposition Example 491
20.9.7 Interposing on Resize Events 493
20.9.8 Modifying an Object’s Destruction 493
20.9.8.1 Interposing a client destroy handler 495
20.9.8.2 Enabling panel item interposition 497
20.10 Notifier Control 498
20.10.1 Mass Destruction 499
20.10.2 Implicit Dispatching 499
20.10.3 Explicit Dispatching 501
20.11 Emulating a sleep() Call 502
20.12 Advanced Notifier Usage 503
20.12.1 Prioritization 504
20.12.1.1 Providing a prioritizer 504
20.12.1.2 Dispatching events 505
20.12.1.3 Getting the prioritizer 506
20.12.2 Scheduling the Notifier 506
20.12.2.1 Dispatching clients 507
20.12.2.2 Getting the scheduler 507
20.13 Error Codes 507
20.14 Issues 509
Chapter 21 Color 513
21.1 XView Color Model 513
21.1.0.1 What is a colormap segment? 514
21.1.1 Colormap Segment Types 515
21.1.1.1 Static colormap segments 515
21.1.1.2 Dynamic colormap segments 515
21.2 Creating Colormap Segments 516
21.2.0.1 Cms size 516
21.2.1 Specifying Colors 517
21.2.1.1 Specifying colors by name 517
21.2.1.2 Specifying colors by RGB values 517
21.2.2 Cms Name 519
21.3 Color and Pixel Values 519
21.3.0.1 Logical vs. real indices 519
21.3.1 Foreground and Background Colors 520
21.3.1.1 Colors of control objects 521
21.4 The color_logo.c Program 521
21.5 The Control Colormap Segment 524
21.5.1 Coloring Panel Items 525
21.6 Using xv_find() with Colormap Segments 527
21.7 Canvases and Colormaps 528
21.8 Multi-visual Support 528
21.8.1 Using the Visual Attributes 529
21.9 Another Example 529
21.10 Cms Package Summary 534
Chapter 22 Internationalization 537
22.1 Locale Setting 538
22.1.1 Locale Definition 538
22.1.2 Enabling Internationalization 538
22.1.2.1 Setting path of locale-specific files 539
22.1.3 OpenWindows Localization Properties Sheet 539
22.1.4 XView Locale Attributes 540
22.1.5 Command-line Options for Specifying Locale 541
22.1.5.1 XView locale resources 541
22.1.5.2 ANSI-C/POSIX 542
22.1.6 Limits and Restrictions 543
22.2 Localized Text Handling 543
22.2.1 Localized Text Handling - Application Programmer Interface 544
22.2.1.1 gettext() 544
22.2.1.2 dgettext() 545
22.2.1.3 textdomain() 545
22.2.1.4 bindtextdomain() 546
22.2.1.5 Examples 547
22.2.1.6 XV_LOCALE_DIR 547
22.2.2 Creating a Text Domain 547
22.2.3 New and Enhanced XView Attributes for gettext() 549
22.3 Object Layout and Customization 550
22.3.1 Implicit and Explicit 550
22.3.2 Layout and Customization API 550
22.3.2.1 XV_LOCALE_DIR 550
22.3.2.2 XV_USE_DB 551
22.3.2.3 XV_INSTANCE_NAME 551
22.3.3 Command-line Options 552
22.4 Internationalization Attribute Summary 553
Chapter 23 Help Facilities 557
23.1 Using XV_HELP_DATA 558
23.2 HELP Key Binding 558
23.2.1 Attaching Help Data 559
23.2.2 More Help 560
23.2.3 Text Help 561
23.2.4 Displaying Help Manually 561
23.2.5 Help File Installation 562
23.2.5.1 HELPPATH usage with internationalization 563
23.2.5.2 Setting the application name 563
23.3 Help Package Summary 564
Chapter 24 Error Recovery 567
24.1 XView Errors 567
24.2 Simple Error Handling 568
24.2.0.1 Using xv_error_format() 569
24.3 X Error Handling 569
24.4 Advanced Error Handling 570
24.4.0.1 Error types 570
24.4.1 Calling xv_error() 571
24.4.1.1 Error severity 572
24.4.2 Revisiting the Error Handler 572
Chapter 25 XView Internals 579
25.1 Methods 580
25.1.0.1 Static subclassing 580
25.1.1 Order of Methods 581
25.2 Internal Attribute-value Lists 582
25.2.1 Attribute Values 582
25.2.2 Creating Attribute Lists 583
25.2.2.1 Attribute lists within attribute lists 583
25.2.3 Interpreting Attributes 584
25.2.4 Checking for Bad Attributes 586
25.2.4.1 Searching for specific attributes 586
25.2.5 Consuming Attributes 587
25.3 Customizable Attributes 587
25.4 XView Packages 589
25.4.1 The Xv_pkg Type 589
25.4.2 Public and Private Data 590
25.5 The Logo Package 591
25.5.1 Header Files 591
25.5.1.1 The public header file 591
25.5.1.2 The private header file 592
25.5.2 The Implementation File 593
25.5.3 The Package Declaration 594
25.5.4 The Initialize Method 595
25.5.4.1 The logo_redraw() function 598
25.5.5 The Set Method 599
25.5.6 The Get Method 601
25.5.7 The Destroy Method 602
25.6 Example Program Listing 603
25.7 Compiling an Implementation File 604
25.8 The Bitmap Package 605
25.8.1 The Bitmap Initialize Method 606
25.8.2 The Bitmap Set Method 607
25.8.3 The Bitmap Get Method 608
25.8.4 Creating a Bitmap Instance 609
25.9 The Find Method 610
25.9.0.1 To find or not to find 610
25.9.1 Conceptual Implementation 611
25.9.1.1 Scope of list availability 612
25.9.2 Actual Implementation 612
25.10 The Image Package 612
25.10.0.1 The public image header file 613
25.10.0.2 The private image header file 613
25.10.0.3 The image package declaration 614
25.10.1 The Image Initialize Method 614
25.10.2 The Image Set Method 615
25.10.3 The Image Get Method 616
25.10.4 The Image Destroy Method 616
25.10.5 The Image Find Method 617
25.10.6 The Image.c Program 618
25.11 The Wizzy Package-A Panel Item Extension 620
25.11.1 The Public Wizzy Header File 620
25.11.2 The Private Wizzy Header File 620
25.11.3 The Wizzy Package Declaration 621
25.11.4 The Implementation Files 621
25.11.5 The Wizzy Initialize Method 622
25.11.6 The Wizzy Set Method 624
25.11.7 The Wizzy Get Method 625
25.11.8 The Wizzy Destroy Method 626
25.11.9 Panel Item Handler Procedures 626
25.11.9.1 The handle event function 626
25.11.9.2 The begin preview function 627
25.11.9.3 The update preview function 627
25.11.9.4 The cancel preview function 627
25.11.9.5 The accept preview function 627
25.11.9.6 The accept menu function 628
25.11.9.7 The accept key function 628
25.11.9.8 The clear function 628
25.11.9.9 The paint function 628
Get Volume 7A: XView Programming Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.