Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.sao.ru/cats/~satr/JS/plugin/abtpg.htm
Дата изменения: Wed Jan 15 23:14:54 1997
Дата индексирования: Tue Oct 2 06:00:45 2012
Кодировка:

Поисковые слова: п п п п п п п п п п
About This Guide [Contents] [Previous] [Next] [Index]

About This Guide

The Plug-in Guide is your introduction to using Netscape's Plug-in Application Programming Interface (API) to develop plug-ins for Communicator 4.0.

Netscape Communicator provides an impressive set of capabilities for accessing and displaying information from the World Wide Web or company intranets. Plug-ins extend Communicator to include a wide range of interactive and multimedia capabilities, while blending seamlessly into the Communicator interface.

The Plug-in Guide presents the information you need to write a plug-in for the Navigator component of Communicator 4.0. It describes plug-in architecture, the issues to consider when designing a plug-in, the use of HTML to invoke plug-ins in the browser, and the steps in creating and building a plug-in.

The Plug-in Guide is the guide for writing C code for C/C++ plug-ins. If you decide to use Netscape's LiveConnect to allow your plug-in to communicate with Java and JavaScript, your next step after reading this guide is LiveConnecting Plug-ins with Java.

This guide includes the following information:

This chapter contains the following sections:

[Top]


Who Should Read This Guide?

The Plug-in Guide is designed for the C or C++ developer who wants to extend the capabilities of Netscape Communicator.

[Top]


What's in This Guide

This is the guide to read if you want to write the C/C++ code for plug-ins for Netscape Communicator. The chapters in this guide provide three kinds of information: overview (Chapters 1 and 2), programming instructions (Chapters 3 through 8), and a reference to plug-in functions and data structures (Chapter 9).

Read Chapters 1 and 2 for basic information that you should know before you read the rest of the guide. Read Chapters 3 through 8 to focus on the key tasks you need most often as you write plug-ins. Chapter 9 is a reference to the methods and structures of the Plug-in API. The reference is organized by task and parallels the organization of Chapters 3 through 8.

Finding Information

If you want to do this: See this chapter:
Learn more about the Plug-in API, from both the user's and developer's points of view

Chapter 1, "Plug-in Basics"

Get an overview of Plug-in API methods

"Overview of Plug-in Structure in Chapter 1, "Plug-in Basics"

Find out about the basic procedures involved in developing plug-ins

Chapter 2, "Development Overview"

Initialize, create, destroy, and shut down plug-in instances

Chapter 3, "Initialization and Destruction"

Define and draw windowed and windowless plug-ins, and handle window-related events

Chapter 4, "Drawing and Event Handling"

Create and handle streams produced by the plug-in or Communicator

Chapter 5, "Streams"

Use URLs to get data from and post data to the network

Chapter 6, "URLs"

Manage plug-in memory.

Chapter 7, "Memory"

Retrieve program and system information and display messages in the Communicator status line

Chapter 8, "Version, UI, and Status Information"

Use a newly installed plug-in without restarting Communicator

Chapter 8, "Version, UI, and Status Information"

Find the Plug-in API function you need

Chapter 9, "Plug-in API Reference"

Find the Plug-in API function you need, listed by Netscape or Plug-in API group

"API Organization: Netscape and Plug-in Methods" in Chapter 9, "Plug-in API Reference"

Find the Plug-in API function you need, listed by functional group

"Quick Reference to Functional Groups" in Chapter 9, "Plug-in API Reference"

Understand the data structures that Plug-in API functions operate on

"Structures" in Chapter 9, "Plug-in API Reference"

[Top] [What's in This Guide]


Conventions Used in This Guide

This guide uses the following conventions to indicate some types of information. In general, text and format conventions conform to Netscape documentation standards.

Fonts. All program code listings, URLs, and other program names appear in Courier, a monospace font. Placeholders, which you replace with your own value, are in italicized Courier font.

Note Formats. This guide emphasizes information with several types of note formats:

NOTE: Information of interest to the developer but not essential to understanding the surrounding topic. §
WARNING: Information that can affect the development decisions you make or the development environment you choose. Don't miss these notes. §
Platform-specific information. This information is preceded by the platform name:

[Top] [Conventions Used in This Guide]


The Plug-in Software Development Kit

The Plug-in Software Development Kit (SDK), written in C++, provides everything you need to start developing plug-ins. This page describes what you'll find in the SDK: the directory structure, templates, and examples.

NOTE: To download the SDK, see the Plug-in SDK download page. §
This table shows the contents of the sdk directory and its subdirectories:

Directory Location Contents
PluginSDK/bin
Platform-specific binaries and tools

PluginSDK/include/
Header files, including npapi.h, npupp.h, and header files for Java support

PluginSDK/common/
Glue files for each platform: npunix.c, npwin.cpp, and npmac.cpp, which the developer does not need to change

PluginSDK/classes/
Zip file containing Java classes that support LiveConnect; do not unzip this file

PluginSDK/examples/
Example plug-ins, platform-specific makefiles, Template directory containing a plug-in template for your platform

PluginSDK/examples/
Framework/
A set of C++ classes to help with plug-in development

ReleaseNotes.htm
Current developer information that may be more up to date than this guide

ReadMe.htm
Contains a link to this guide

Templates are empty examples with project files or, for Unix, makefiles, that you can use as a basis for your own plug-ins. Each is a complete plug-in with minimum functionality. You can start from a template or construct your own project. Look for the template for your platform in the examples directory.

You'll find these examples in the SDK. The ReadMe file for each sample includes directions for building and using it.

Example Description
Simple

"Hello world" plug-in that uses LiveConnect to interact with Java and JavaScript. The sample displays "Hello world" in a rectangle; it also writes messages to the Java console and to stdout to tell how the plug-in is progressing. It contains #ifdef clauses so that it can be compiled on all platforms supported by Netscape Navigator. You can examine the plug-in to compare the ways its implementation differs for each platform.

CharFlipper

Mac OS and MS Windows: Plug-in that reads characters from a stream, displaying them one at a time as an animation. This plug-in demonstrates many aspects of plug-in development, including LiveConnect, HTML EMBED tag parameters, cross-platform development with maximal code reuse, stream dispatching, and animation. This example includes TimeMediaPlugin, a reusable Java class with a standard interface for plug-ins that deal with time-media (animation, video, audio). Compare the implementations of this plug-in for different platforms.

LivePict

Mac OS: Displays Mac OS PICT images.

NPAvi

MS Windows: Displays AVI movies, and can be controlled with JavaScript using LiveConnect. You build this plug-in using a command line makefile, which goes through the entire process of creating the Java interfaces and compiling the DLL.

PPViewText

Mac OS: Displays text using Metrowerks PowerPlant.

NOTE: Simple and CharFlipper samples: LiveConnect does not function with 68K Mac OS plug-ins. §
[Top] [The Plug-in Software Development Kit]


Where to Find Developer Information

For general Netscape developer information, see the Netscape DevEdge site.

To get information about plug-in development, including links to a variety of plug-in sources, see the Plug-in Developer Central page on DevEdge.

You'll find useful information and projects in these books:

If you want to use LiveConnect to achieve interobject communication between Java, plug-ins, and JavaScript. Read the introduction and instructions in LiveConnecting Plug-ins with Java.

[Top]


[Contents] [Previous] [Next] [Index]

Last Updated: 01/15/97 16:35:49


Copyright © 1997 Netscape Communications Corporation