Changeset 211:00180515eb65

Show
Ignore:
Timestamp:
03/19/08 16:36:28 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.3.2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/custom/CCombo.d

    r150 r211  
    5151static import tango.text.Unicode; 
    5252static import tango.text.convert.Format; 
     53import dwt.dwthelper.utils; 
    5354 
    5455/** 
     
    10871088            break; 
    10881089        case DWT.Deactivate: 
    1089             dropDown (false); 
     1090            /* 
     1091             * Bug in GTK. When the arrow button is pressed the popup control receives a 
     1092             * deactivate event and then the arrow button receives a selection event. If 
     1093             * we hide the popup in the deactivate event, the selection event will show 
     1094             * it again. To prevent the popup from showing again, we will let the selection 
     1095             * event of the arrow button hide the popup. 
     1096             */ 
     1097            if ("gtk".equals(DWT.getPlatform())) { 
     1098                Point point = arrow.toControl(getDisplay().getCursorLocation()); 
     1099                Point size = arrow.getSize(); 
     1100                Rectangle rect = new Rectangle(0, 0, size.x, size.y); 
     1101                if (!rect.contains(point)) dropDown (false); 
     1102            } else { 
     1103                dropDown(false); 
     1104            } 
    10901105            break; 
    10911106        default: 
  • dwt/internal/Library.d

    r108 r211  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2007 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    3434     * DWT Minor version number (must be in the range 0..999) 
    3535     */ 
    36     static const int MINOR_VERSION = 346
     36    static const int MINOR_VERSION = 349
    3737 
    3838    /** 
  • dwt/internal/gtk/OS.d

    r166 r211  
    17311731    mixin ForwardGtkOsCFunc!(.gtk_paper_size_get_height); 
    17321732    mixin ForwardGtkOsCFunc!(.gtk_paper_size_is_custom); 
     1733    mixin ForwardGtkOsCFunc!(.gtk_paper_size_free); 
    17331734    mixin ForwardGtkOsCFunc!(.gtk_plug_get_id); 
    17341735    mixin ForwardGtkOsCFunc!(.gtk_plug_new); 
  • dwt/printing/Printer.d

    r200 r211  
    7676    static const char[] GTK_LPR_BACKEND = "GtkPrintBackendLpr"; //$NON-NLS-1$ 
    7777 
     78    static const bool disablePrinting = false;// System.getProperty("dwt.internal.gtk.disablePrinting") !is null; //$NON-NLS-1$ 
     79 
    7880/** 
    7981 * Returns an array of <code>PrinterData</code> objects 
     
    8486public static PrinterData[] getPrinterList() { 
    8587    printerList = new PrinterData [0]; 
    86     if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0)) { 
     88    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) { 
    8789        return printerList; 
    8890    } 
     
    120122public static PrinterData getDefaultPrinterData() { 
    121123    printerList = new PrinterData [1]; 
    122     if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0)) { 
     124    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) { 
    123125        return null; 
    124126    } 
     
    633635protected override void create(DeviceData deviceData) { 
    634636    this.data = cast(PrinterData)deviceData; 
    635     if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0)) DWT.error(DWT.ERROR_NO_HANDLES); 
     637    if (OS.GTK_VERSION < OS.buildVERSION (2, 10, 0) || disablePrinting) DWT.error(DWT.ERROR_NO_HANDLES); 
    636638    printer = gtkPrinterFromPrinterData(); 
    637639    if (printer is null) DWT.error(DWT.ERROR_NO_HANDLES); 
     
    699701        } 
    700702        OS.gtk_page_setup_set_paper_size(pageSetup, paper_size); 
    701         OS.g_free(paper_size); 
     703        OS.gtk_paper_size_free(paper_size); 
    702704    } 
    703705 
  • dwt/widgets/ToolTip.d

    r152 r211  
    678678    if (message.length !is 0) { 
    679679        layoutMessage = OS.gtk_widget_create_pango_layout (handle, toStringz( message )); 
     680        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) { 
     681            OS.pango_layout_set_auto_dir (layoutMessage, false); 
     682        } 
    680683        OS.pango_layout_set_wrap (layoutMessage, OS.PANGO_WRAP_WORD_CHAR); 
    681684    } 
     
    705708    if (text.length !is 0) { 
    706709        layoutText = OS.gtk_widget_create_pango_layout (handle, toStringz(text)); 
     710        if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) { 
     711            OS.pango_layout_set_auto_dir (layoutText, false); 
     712        } 
    707713        auto boldAttr = OS.pango_attr_weight_new (OS.PANGO_WEIGHT_BOLD); 
    708714        boldAttr.start_index = 0; 
  • dwt/widgets/Tree.d

    r200 r211  
    23112311    auto selection = OS.gtk_tree_view_get_selection (handle); 
    23122312    OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED); 
     2313    /* 
     2314    * Bug in GTK.  In version 2.8, when gtk_tree_view_set_model() is called, GTK 
     2315    * does not remove the timer used to show animation when expanding a node. This 
     2316    * can cause two possible crashes. The first one happens when the timer expires and 
     2317    * it accesses the expanding node which has been already destroyed. The second one 
     2318    * happens if a new item is created and destroyed before the timer expires. The fix 
     2319    * is to remove the timer by disposing the first item in the tree. 
     2320    */ 
     2321    if (OS.GTK_VERSION < OS.buildVERSION(2, 10, 0)) { 
     2322        if (OS.gtk_tree_model_iter_n_children (modelHandle, null) !is 0) { 
     2323            GtkTreeIter iter; 
     2324            OS.gtk_tree_model_iter_nth_child (modelHandle, &iter, null, 0); 
     2325            OS.gtk_tree_store_remove (modelHandle, &iter); 
     2326        } 
     2327    } 
    23132328    // TODO verify if true for tree store 
    23142329    //OS.gtk_tree_store_clear (modelHandle);