JNIEXPORT jint JNICALL Java_org_gnome_gtk_GtkWindow_gtk_1window_1get_1type_1hint ( JNIEnv* env, jclass cls, jlong _self ) { GdkWindowTypeHint result; jint _result; GtkWindow* self; // convert parameter self self = (GtkWindow*) _self; // call function result = gtk_window_get_type_hint(self); // cleanup parameter self // translate return value to JNI type _result = (jint) result; // and finally return _result; }
//_____________________________________________________ gboolean ArgbHelper::styleSetHook( GSignalInvocationHint*, guint, const GValue* params, gpointer ) { // get widget from params GtkWidget* widget( GTK_WIDGET( g_value_get_object( params ) ) ); // check type if( !GTK_IS_WIDGET( widget ) ) return FALSE; if( !GTK_IS_WINDOW( widget ) ) return TRUE; // make sure widget has not been realized already #if GTK_CHECK_VERSION(2, 20, 0) if( gtk_widget_get_realized( widget ) ) return TRUE; #else if( GTK_WIDGET_REALIZED( widget ) ) return TRUE; #endif // screen GdkScreen* screen = gdk_screen_get_default(); if( !screen ) return TRUE; // colormap GdkColormap* colormap(gdk_screen_get_rgba_colormap( screen ) ); if( !colormap ) return TRUE; // hint GtkWindow* window( GTK_WINDOW( widget ) ); GdkWindowTypeHint hint = gtk_window_get_type_hint( window ); if( hint == GDK_WINDOW_TYPE_HINT_MENU || hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU || hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU || hint == GDK_WINDOW_TYPE_HINT_TOOLTIP || hint == GDK_WINDOW_TYPE_HINT_COMBO ) { #if OXYGEN_DEBUG std::cerr << "Oxygen::ArgbHelper::styleSetHook - " << widget << " (" << G_OBJECT_TYPE_NAME( widget ) << ")" << " hint: " << Gtk::TypeNames::windowTypeHint( hint ) << std::endl; #endif // assign argb colormap to widget gtk_widget_set_colormap( widget, colormap ); } return TRUE; }
static void test_dialog_override_property (void) { GtkWidget *dialog; dialog = g_object_new (GTK_TYPE_DIALOG, "type-hint", GDK_WINDOW_TYPE_HINT_UTILITY, NULL); g_assert (GTK_IS_DIALOG (dialog)); g_assert (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_UTILITY); gtk_widget_destroy (dialog); }
//____________________________________________________________________________________________ gboolean Animations::sizeAllocationHook( GSignalInvocationHint*, guint, const GValue* params, gpointer data ) { // get widget from params GtkWidget* widget( GTK_WIDGET( g_value_get_object( params ) ) ); // check type if( !GTK_IS_WIDGET( widget ) ) return FALSE; // cast data Animations& animations( *static_cast<Animations*>(data) ); // groupbox labels #if ENABLE_GROUPBOX_HACK if( animations.groupBoxLabelEngine().contains( widget ) ) { animations.groupBoxLabelEngine().adjustSize( widget ); return TRUE; } #endif #if ENABLE_COMBOBOX_LIST_RESIZE // comboboxes if( !GTK_IS_WINDOW( widget ) ) return TRUE; GtkWindow* window( GTK_WINDOW( widget ) ); if( gtk_window_get_type_hint( window ) != GDK_WINDOW_TYPE_HINT_COMBO ) return TRUE; GtkWidget* combobox = animations.comboBoxEngine().find( widget ); if( !combobox ) combobox = animations.comboBoxEntryEngine().find( widget ); if( !combobox ) combobox = animations.comboEngine().find( widget ); if( !combobox ) return true; int w, h; gtk_window_get_size( window, &w, &h ); gint targetX, dummy, y; gtk_window_get_position( window, &dummy, &y ); gdk_window_get_origin( gtk_widget_get_window( combobox ), &targetX, &dummy ); const GtkAllocation comboAllocation( Gtk::gtk_widget_get_allocation( combobox ) ); int uglyShadowWidth=!Gtk::gdk_default_screen_is_composited(); gtk_window_move( window, targetX + comboAllocation.x + 3 - uglyShadowWidth, y ); const GtkAllocation widgetAllocation( Gtk::gtk_widget_get_allocation( widget ) ); gtk_widget_set_size_request( widget, comboAllocation.width - 6 + 2*uglyShadowWidth, widgetAllocation.height ); #endif return TRUE; }