Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsSplashScreenGtk Class Reference
Inheritance diagram for nsSplashScreenGtk:
Inheritance graph
[legend]
Collaboration diagram for nsSplashScreenGtk:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsSplashScreenGtk ()
virtual ~nsSplashScreenGtk ()
NS_IMETHOD Show ()
NS_IMETHOD Hide ()

Private Attributes

GdkWindow * mDialog

Detailed Description

Definition at line 53 of file nsNativeAppSupportGtk.cpp.


Constructor & Destructor Documentation

Definition at line 73 of file nsNativeAppSupportGtk.cpp.

{
}

Definition at line 77 of file nsNativeAppSupportGtk.cpp.

{
  Hide();
}

Here is the call graph for this function:


Member Function Documentation

Implements nsISplashScreen.

Definition at line 136 of file nsNativeAppSupportGtk.cpp.

{
  if (mDialog) {
    gdk_window_destroy(mDialog);
    mDialog = nsnull;
  }
  return NS_OK;
}

Here is the caller graph for this function:

Implements nsISplashScreen.

Definition at line 82 of file nsNativeAppSupportGtk.cpp.

{
#ifdef MOZ_XUL_APP
  if (!splash_xpm[0])
    return NS_OK;
#endif

  nsCAutoString path(PR_GetEnv("MOZILLA_FIVE_HOME"));

  if (path.IsEmpty()) {
    path.Assign("splash.xpm");
  } else {
    path.Append("/splash.xpm");
  }

  /* See if the user has a custom splash screen */
  GdkPixmap* pmap = gdk_pixmap_colormap_create_from_xpm(NULL,
                                                    gdk_colormap_get_system(),
                                                    NULL, NULL, path.get());

  if (!pmap) {
    /* create a pixmap based on xpm data */
    pmap = gdk_pixmap_colormap_create_from_xpm_d(NULL,
                                                    gdk_colormap_get_system(),
                                                    NULL, NULL, splash_xpm);
  }

  if (!pmap) {
    gdk_window_destroy(mDialog);
    mDialog = nsnull;
    return NS_ERROR_FAILURE;
  }

  gint width, height;
  gdk_window_get_size(pmap, &width, &height);

  GdkWindowAttr attr;
  attr.window_type = GDK_WINDOW_TEMP;
  attr.wclass = GDK_INPUT_OUTPUT;
  attr.x = (gdk_screen_width() >> 1) - (width >> 1);
  attr.y = (gdk_screen_height() >> 1) - (height >> 1);
  attr.width = width;
  attr.height = height;
  attr.event_mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK;
  mDialog = gdk_window_new(NULL, &attr, GDK_WA_X | GDK_WA_Y);

  gdk_window_set_back_pixmap(mDialog, pmap, FALSE);
  gdk_pixmap_unref(pmap);

  gdk_window_show(mDialog);

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

GdkWindow* nsSplashScreenGtk::mDialog [private]

Definition at line 64 of file nsNativeAppSupportGtk.cpp.


The documentation for this class was generated from the following file: