Back to index

lightning-sunbird  0.9+nobinonly
Typedefs | Functions | Variables
nsGtkMenu.cpp File Reference
#include <gtk/gtk.h>
#include "nsBrowserWindow.h"
#include "resources.h"
#include "nscore.h"
#include <stdio.h>

Go to the source code of this file.

Typedefs

typedef GtkItemFactoryCallback GIFC

Functions

void gtk_ifactory_cb (nsBrowserWindow *nbw, guint callback_action, GtkWidget *widget)
void CreateViewerMenus (nsIWidget *aParent, gpointer data, GtkWidget **aMenuBarOut)

Variables

GtkItemFactoryEntry menu_items []

Typedef Documentation

typedef GtkItemFactoryCallback GIFC

Definition at line 46 of file nsGtkMenu.cpp.


Function Documentation

void CreateViewerMenus ( nsIWidget aParent,
gpointer  data,
GtkWidget **  aMenuBarOut 
)

Definition at line 161 of file nsGtkMenu.cpp.

{
  NS_ASSERTION(nsnull != aParent,"null parent.");
  NS_ASSERTION(nsnull != aMenuBarOut,"null out param.");

  NS_WARNING("CreateViewerMenus is not implemented yet!\n");

  GtkItemFactory *item_factory;
  GtkWidget *menubar;

  GdkWindow *window;

  window = (GdkWindow *)aParent->GetNativeData(NS_NATIVE_WINDOW);
  
  int nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
  item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", nsnull);

  gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, data);

  menubar = gtk_item_factory_get_widget (item_factory, "<main>");

  // XXX fix this or kill viewer.

  /*
    NS_ASSERTION(GDK_IS_SUPERWIN(gdkSuperWin), "code assumes a gdksuperwin.");
    mozBox = gtk_mozbox_new(gdkSuperWin->bin_window);
     NS_ASSERTION((mozBox != NULL), "failed to create mozBox.");

     gtk_container_add(GTK_CONTAINER(mozBox), menubar);
     gtk_mozbox_set_position(GTK_MOZBOX(mozBox), 0, 0 );
     gtk_widget_show(menubar);
     gtk_widget_show(mozBox);

     *aMenuBarOut = menubar;
   */
}

Here is the call graph for this function:

void gtk_ifactory_cb ( nsBrowserWindow nbw,
guint  callback_action,
GtkWidget *  widget 
)

Definition at line 48 of file nsGtkMenu.cpp.

{
  nbw->DispatchMenuItem(callback_action);
}

Here is the call graph for this function:


Variable Documentation

GtkItemFactoryEntry menu_items[]

Definition at line 55 of file nsGtkMenu.cpp.