JNIEXPORT jdouble JNICALL Java_org_gnome_gtk_GtkWindow_gtk_1window_1get_1opacity ( JNIEnv* env, jclass cls, jlong _self ) { gdouble result; jdouble _result; GtkWindow* self; // convert parameter self self = (GtkWindow*) _self; // call function result = gtk_window_get_opacity(self); // cleanup parameter self // translate return value to JNI type _result = (jdouble) result; // and finally return _result; }
double gMainWindow::opacity() { if (isTopLevel()) #if GTK_CHECK_VERSION(3, 8, 0) return gtk_widget_get_opacity(border); #else return gtk_window_get_opacity(GTK_WINDOW(border)); #endif else return 1.0;
/* * cheese_flash_opacity_fade: * @data: the #CheeseFlash * * Fade the flash out. * * Returns: %TRUE if the fade was completed, %FALSE if the flash must continue * to fade */ static gboolean cheese_flash_opacity_fade (gpointer data) { GtkWindow *flash_window = GTK_WINDOW (data); gdouble opacity = gtk_window_get_opacity (flash_window); /* exponentially decrease */ gtk_window_set_opacity (flash_window, opacity * FLASH_FADE_FACTOR); if (opacity <= FLASH_LOW_THRESHOLD) { /* the flasher has finished when we reach the quit value */ gtk_widget_hide (GTK_WIDGET (flash_window)); return G_SOURCE_REMOVE; } return G_SOURCE_CONTINUE; }
static gboolean cheese_flash_opacity_fade (gpointer data) { CheeseFlash *flash = data; CheeseFlashPrivate *flash_priv = CHEESE_FLASH_GET_PRIVATE (flash); GtkWindow *flash_window = flash_priv->window; double opacity = gtk_window_get_opacity (flash_window); /* exponentially decrease */ gtk_window_set_opacity (flash_window, opacity * FLASH_FADE_FACTOR); if (opacity <= FLASH_LOW_THRESHOLD) { /* the flasher has finished when we reach the quit value */ gtk_widget_hide (GTK_WIDGET (flash_window)); return FALSE; } return TRUE; }