Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
nullplugin.h File Reference
#include <gtk/gtk.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PluginInstance
struct  _MimeTypeElement

Defines

#define TARGET   "_blank"
#define MIME_TYPES_HANDLED   "*:.*:All types"
#define PLUGIN_NAME   "Default Plugin"
#define PLUGIN_DESCRIPTION   "The default plugin handles plugin data for mimetypes and extensions that are not specified and facilitates downloading of new plugins."
#define CLICK_TO_GET   "Click here to get the plugin"
#define CLICK_WHEN_DONE   "Click here after installing the plugin"
#define REFRESH_PLUGIN_LIST   "javascript:navigator.plugins.refresh(true)"
#define PLUGINSPAGE_URL   "http://plugindoc.mozdev.org/winmime.html" /* XXX Branding: make configurable via .properties or prefs */
#define OK_BUTTON   "OK"
#define CANCEL_BUTTON   "CANCEL"
#define JVM_SMARTUPDATE_URL   "http://java.com/download" /* XXX Branding: see above */
#define JVM_MINETYPE   "application/x-java-vm"
#define MESSAGE   "\This page contains information of a type (%s) that can\n\only be viewed with the appropriate Plug-in.\n\\n\Click OK to download Plugin."
#define GET   1
#define REFRESH   2

Typedefs

typedef struct _PluginInstance PluginInstance
typedef struct _MimeTypeElement MimeTypeElement

Functions

void makeWidget (PluginInstance *This)
NPMIMEType dupMimeType (NPMIMEType type)
void destroyWidget (PluginInstance *This)
void makePixmap (PluginInstance *This)
void destroyPixmap ()

Class Documentation

struct _PluginInstance

Definition at line 80 of file nullplugin.h.

Collaboration diagram for _PluginInstance:
Class Members
int action
unsigned int depth
GtkWidget * dialogBox
NPBool exists
uint32 height
NPP instance
char * message
uint16 mode
char * pluginsFileUrl
NPBool pluginsHidden
char * pluginsPageUrl
char * pluginsPrintMessage
NPMIMEType type
uint32 width
uint32 x
uint32 y
struct _MimeTypeElement

Definition at line 109 of file nullplugin.h.

Collaboration diagram for _MimeTypeElement:
Class Members
struct _MimeTypeElement * next
PluginInstance * pinst

Define Documentation

#define CANCEL_BUTTON   "CANCEL"

Definition at line 61 of file nullplugin.h.

#define CLICK_TO_GET   "Click here to get the plugin"

Definition at line 55 of file nullplugin.h.

#define CLICK_WHEN_DONE   "Click here after installing the plugin"

Definition at line 56 of file nullplugin.h.

#define GET   1

Definition at line 76 of file nullplugin.h.

#define JVM_MINETYPE   "application/x-java-vm"

Definition at line 69 of file nullplugin.h.

#define JVM_SMARTUPDATE_URL   "http://java.com/download" /* XXX Branding: see above */

Definition at line 67 of file nullplugin.h.

#define MESSAGE   "\This page contains information of a type (%s) that can\n\only be viewed with the appropriate Plug-in.\n\\n\Click OK to download Plugin."

Definition at line 70 of file nullplugin.h.

#define MIME_TYPES_HANDLED   "*:.*:All types"

Definition at line 52 of file nullplugin.h.

#define OK_BUTTON   "OK"

Definition at line 60 of file nullplugin.h.

#define PLUGIN_DESCRIPTION   "The default plugin handles plugin data for mimetypes and extensions that are not specified and facilitates downloading of new plugins."

Definition at line 54 of file nullplugin.h.

#define PLUGIN_NAME   "Default Plugin"

Definition at line 53 of file nullplugin.h.

#define PLUGINSPAGE_URL   "http://plugindoc.mozdev.org/winmime.html" /* XXX Branding: make configurable via .properties or prefs */

Definition at line 59 of file nullplugin.h.

#define REFRESH   2

Definition at line 77 of file nullplugin.h.

#define REFRESH_PLUGIN_LIST   "javascript:navigator.plugins.refresh(true)"

Definition at line 58 of file nullplugin.h.

#define TARGET   "_blank"

Definition at line 51 of file nullplugin.h.


Typedef Documentation


Function Documentation

Definition at line 74 of file nullplugin.c.

{
    if (This && This->dialogBox)
    {
      gtk_widget_destroy (GTK_WIDGET(This->dialogBox));
    }
}

Here is the caller graph for this function:

Definition at line 191 of file nullplugin.c.

{
    NPMIMEType mimetype = NPN_MemAlloc(strlen(type)+1);
    if (mimetype)
        strcpy(mimetype, type);
    return(mimetype);
}

Definition at line 501 of file nullplugin.c.

{
    createPixmap(This);
    drawPixmap(This);
    setCursor(This);
    addXtEventHandler(This);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 256 of file nullplugin.c.

{
    GtkWidget *dialogWindow;
    GtkWidget *dialogMessage;
    GtkWidget *okButton;
    GtkWidget *cancelButton;
    char message[1024];
    MimeTypeElement *ele;

    if (!This) return;

    /* need to check whether we already pop up a dialog box for previous
       minetype in the same web page. It's require otherwise there will
       be 2 dialog boxes pop if there are 2 plugin in the same web page
    */
    if ((ele = isExist(&head, This->type)))
    {
        if (ele->pinst && ele->pinst->dialogBox)
        {
            GtkWidget *top_window = gtk_widget_get_toplevel(ele->pinst->dialogBox);
            if (top_window && GTK_WIDGET_VISIBLE(top_window))
            {   /* this will raise the toplevel window */
                gdk_window_show(top_window->window);
            }
        }
        return;
    }

    dialogWindow = gtk_dialog_new();
    This->dialogBox = dialogWindow;
    This->exists = TRUE;
    This->dialogBox = dialogWindow;
    addToList(&head, This);
    gtk_window_set_title(GTK_WINDOW(dialogWindow), PLUGIN_NAME);
    gtk_window_set_position(GTK_WINDOW(dialogWindow), GTK_WIN_POS_CENTER);
    gtk_window_set_modal(GTK_WINDOW(dialogWindow), FALSE);
    gtk_container_set_border_width(GTK_CONTAINER(dialogWindow), 20);
    gtk_window_set_policy(GTK_WINDOW(dialogWindow), FALSE, FALSE, TRUE);

    PR_snprintf(message, sizeof(message) - 1, MESSAGE, This->type);
    dialogMessage = AddWidget(gtk_label_new (message), 
                   GTK_DIALOG(dialogWindow)->vbox);

    okButton= AddWidget(gtk_button_new_with_label (OK_BUTTON), 
                   GTK_DIALOG(dialogWindow)->action_area);
    gtk_object_set_data(GTK_OBJECT(okButton), DIALOGID, dialogWindow);

    GTK_WIDGET_SET_FLAGS (okButton, GTK_CAN_DEFAULT);
    gtk_widget_grab_default(okButton);

    cancelButton= AddWidget(gtk_button_new_with_label (CANCEL_BUTTON), 
                   GTK_DIALOG(dialogWindow)->action_area);

    gtk_signal_connect (GTK_OBJECT(okButton),  "clicked",
                        GTK_SIGNAL_FUNC(DialogOKClicked), This);

    gtk_signal_connect (GTK_OBJECT(cancelButton),  "clicked",
                        GTK_SIGNAL_FUNC(DialogCancelClicked), This);

    gtk_signal_connect(GTK_OBJECT(dialogWindow), "key_press_event",
                        GTK_SIGNAL_FUNC (DialogEscapePressed), NULL);

    /* hookup to when the dialog is destroyed */
    gtk_signal_connect(GTK_OBJECT(dialogWindow), "destroy",
                        GTK_SIGNAL_FUNC(onDestroyWidget), This);

    gtk_widget_show_all(dialogWindow);
}

Here is the call graph for this function:

Here is the caller graph for this function: