1 --- control-center-2.16.1/capplets/font/main.c Thu Nov 2 16:28:24 2006 2 +++ ../SUNWgnome-desktop-prefs-2.16.1/control-center-2.16.1/capplets/font/main.c Thu Nov 2 16:55:48 2006 3 @@ -337,6 +337,102 @@ 4 5 static GSList *font_pairs = NULL; 6 7 +#ifdef FT_CONFIG_ADD_FULL_HINTING 8 +static gboolean 9 +display_full_hinting_dialog (GtkWidget *parent, 10 + FontPair *pair, 11 + const char *key, 12 + const char *value) 13 +{ 14 + gboolean display_dialog = FALSE; 15 + gboolean antialiasing_changed = FALSE; 16 + 17 + if (pair && (pair->antialiasing != ANTIALIAS_NONE) && (pair->hinting == HINT_FULL)) 18 + { 19 + display_dialog = TRUE; 20 + antialiasing_changed = TRUE; 21 + } 22 + 23 + if (key && value) 24 + { 25 + Hinting hinting; 26 + Antialiasing antialiasing; 27 + 28 + if ((strcmp (key, FONT_HINTING_KEY) == 0) && (strcmp (value, "full") == 0)) 29 + { 30 + font_render_get_gconf (&antialiasing, &hinting); 31 + if (antialiasing != ANTIALIAS_NONE) 32 + display_dialog = TRUE; 33 + } 34 + if ((strcmp (key, FONT_ANTIALIASING_KEY) == 0) && (strcmp (value, "none") != 0)) 35 + { /* check if hinting is set to full (monochrome case for example)*/ 36 + font_render_get_gconf (&antialiasing, &hinting); 37 + if (hinting == HINT_FULL && antialiasing == ANTIALIAS_NONE) 38 + { 39 + display_dialog = TRUE; 40 + antialiasing_changed = TRUE; 41 + } 42 + } 43 + } 44 + 45 + if (display_dialog) 46 + { 47 + gint result; 48 + Hinting hinting; 49 + Antialiasing antialiasing; 50 + GtkWidget *dialog; 51 + static gboolean displayed_and_rejected = FALSE; 52 + 53 + 54 + font_render_get_gconf (&antialiasing, &hinting); 55 + 56 + /*if the hinting is already set to FULL don't ask again */ 57 + if (hinting == HINT_FULL && 58 + ((antialiasing == ANTIALIAS_GRAYSCALE) || (antialiasing == ANTIALIAS_RGBA))) 59 + return TRUE; 60 + 61 + if (hinting == HINT_FULL && antialiasing == ANTIALIAS_NONE && !antialiasing_changed) 62 + return TRUE; 63 + 64 + dialog = gtk_message_dialog_new (GTK_WINDOW(gtk_widget_get_toplevel (parent)), 65 + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, 66 + GTK_MESSAGE_QUESTION, 67 + GTK_BUTTONS_OK_CANCEL, 68 + NULL); 69 + 70 + gtk_window_set_title (GTK_WINDOW (dialog), "License Agreement"); 71 + 72 + gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), 73 + "Enabling full hinting may require " 74 + "a license from Apple Computer. " 75 + "If you have obtained such a license or " 76 + "have determined that you do not need " 77 + "one, click Ok to activate full hinting." 78 + "\n\nFurther information available at :\n" 79 + "http://freetype.sourceforge.net/" 80 + "patents.html"); 81 + 82 + 83 + result = gtk_dialog_run (GTK_DIALOG (dialog)); 84 + 85 + gtk_widget_destroy (dialog); 86 + 87 + switch (result) 88 + { 89 + case GTK_RESPONSE_CANCEL: 90 + displayed_and_rejected = TRUE; 91 + return FALSE; 92 + break; 93 + default: 94 + break; 95 + } 96 + } 97 + 98 + return TRUE; 99 +} 100 +#endif 101 + 102 + 103 static void 104 font_render_load (void) 105 { 106 @@ -380,7 +476,12 @@ 107 font_radio_toggled (GtkToggleButton *toggle_button, 108 FontPair *pair) 109 { 110 - if (!in_change) { 111 +#ifdef FT_CONFIG_ADD_FULL_HINTING 112 + if (!in_change && 113 + display_full_hinting_dialog (GTK_WIDGET (toggle_button), pair, NULL, NULL)) { 114 +#else 115 + if (!in_change) { 116 +#endif 117 GConfClient *client = gconf_client_get_default (); 118 119 gconf_client_set_string (client, FONT_ANTIALIASING_KEY, 120 @@ -389,7 +490,6 @@ 121 gconf_client_set_string (client, FONT_HINTING_KEY, 122 gconf_enum_to_string (hint_enums, pair->hinting), 123 NULL); 124 - 125 g_object_unref (client); 126 } 127 128 @@ -699,7 +799,14 @@ 129 { 130 EnumGroup *group = item->group; 131 132 - if (!in_change) { 133 +#ifdef FT_CONFIG_ADD_FULL_HINTING 134 + if (!in_change && 135 + display_full_hinting_dialog (GTK_WIDGET(toggle_button), NULL, 136 + group->gconf_key, 137 + gconf_enum_to_string (group->enums, item->value))) { 138 +#else 139 + if (!in_change) { 140 +#endif 141 gconf_client_set_string (group->client, group->gconf_key, 142 gconf_enum_to_string (group->enums, item->value), 143 NULL); 144