Changeset 58:a5c274fa5af9

Show
Ignore:
Timestamp:
01/12/08 01:02:08 (9 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

extended helloworld crashing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dsss.conf

    r55 r58  
    33 
    44[helloworld.d] 
     5 
    56buildflags+=-L-lgtk-x11-2.0 
    67buildflags+=-L-lgdk-x11-2.0 
     
    2930buildflags+=-L-lcairo 
    3031buildflags+=-I/home/frank/jive 
    31 buildflags+=-g -gc 
     32#buildflags+=-g -gc 
    3233 
    3334 
     35 
     36[structs.d] 
  • dwt/SWT.d

    r55 r58  
    34323432public static char[] getMessage(char[] key) { 
    34333433    // PORTING_FIXME: Implement 
    3434     return null
     3434    return "msg not found"
    34353435    //return Compatibility.getMessage(key); 
    34363436} 
  • dwt/widgets/Button.d

    r55 r58  
    142142} 
    143143 
    144 public Point computeSize (int wHint, int hHint, bool changed) { 
     144override public Point computeSize (int wHint, int hHint, bool changed) { 
    145145    checkWidget (); 
    146146    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0; 
     
    164164    if (wHint !is SWT.DEFAULT || hHint !is SWT.DEFAULT) { 
    165165        if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_CAN_DEFAULT) !is 0) { 
    166             GtkBorder* border = new GtkBorder ()
     166            GtkBorder border
    167167            GtkBorder* buffer; 
    168168            OS.gtk_widget_style_get1 (handle, OS.default_border.ptr, cast(int*)&buffer ); 
    169169            if (buffer !is null) { 
    170                 border = buffer; 
     170                border = *buffer; 
    171171            } else { 
    172172                /* Use the GTK+ default value of 1 for each. */ 
     
    180180} 
    181181 
    182 void createHandle (int index) { 
     182override void createHandle (int index) { 
    183183    state |= HANDLE; 
    184184    if ((style & SWT.PUSH) is 0) state |= THEME_BACKGROUND; 
     
    248248    OS.gtk_container_add (cast(GtkContainer*)fixedHandle, handle); 
    249249 
    250    if ((style & SWT.ARROW) !is 0) return; 
     250    if ((style & SWT.ARROW) !is 0) return; 
    251251    _setAlignment (style & (SWT.LEFT | SWT.CENTER | SWT.RIGHT)); 
    252252} 
    253253 
    254 void createWidget (int index) { 
     254override void createWidget (int index) { 
    255255    super.createWidget (index); 
    256256    text = ""; 
    257257} 
    258258 
    259 void deregister () { 
     259override void deregister () { 
    260260    super.deregister (); 
    261261    if (boxHandle !is null) display.removeWidget (boxHandle); 
     
    317317} 
    318318 
    319 char[] getNameText () { 
     319override char[] getNameText () { 
    320320    return getText (); 
    321321} 
     
    411411} 
    412412 
    413 void hookEvents () { 
     413override void hookEvents () { 
    414414    super.hookEvents(); 
    415415    OS.g_signal_connect_closure (handle, OS.clicked.ptr, display.closures [CLICKED], false); 
     
    419419} 
    420420 
    421 bool isDescribedByLabel () { 
     421override bool isDescribedByLabel () { 
    422422    return false; 
    423423} 
    424424 
    425425alias Control.mnemonicHit mnemonicHit; 
    426 bool mnemonicHit (char key) { 
     426override bool mnemonicHit (char key) { 
    427427    if (labelHandle is null) return false; 
    428428    bool result = super.mnemonicHit (labelHandle, key); 
     
    432432 
    433433alias Control.mnemonicMatch mnemonicMatch; 
    434 bool mnemonicMatch (char key) { 
     434override bool mnemonicMatch (char key) { 
    435435    if (labelHandle is null) return false; 
    436436    return mnemonicMatch (labelHandle, key); 
    437437} 
    438438 
    439 void register () { 
     439override void register () { 
    440440    super.register (); 
    441441    if (boxHandle !is null) display.addWidget (boxHandle, this); 
     
    445445} 
    446446 
    447 void releaseHandle () { 
     447override void releaseHandle () { 
    448448    super.releaseHandle (); 
    449449    boxHandle = imageHandle = labelHandle = arrowHandle = null; 
    450450} 
    451451 
    452 void releaseWidget () { 
     452override void releaseWidget () { 
    453453    super.releaseWidget (); 
    454454    if (groupHandle !is null) OS.g_object_unref (groupHandle); 
     
    485485} 
    486486 
    487 void resizeHandle (int width, int height) { 
     487override void resizeHandle (int width, int height) { 
    488488    super.resizeHandle (width, height); 
    489489    /* 
     
    613613} 
    614614 
    615 void setFontDescription (PangoFontDescription* font) { 
     615override void setFontDescription (PangoFontDescription* font) { 
    616616    super.setFontDescription (font); 
    617617    if (labelHandle !is null) OS.gtk_widget_modify_font (labelHandle, font); 
     
    619619} 
    620620 
    621 bool setRadioSelection (bool value) { 
     621override bool setRadioSelection (bool value) { 
    622622    if ((style & SWT.RADIO) is 0) return false; 
    623623    if (getSelection () !is value) { 
     
    677677} 
    678678 
    679 void setOrientation () { 
     679override void setOrientation () { 
    680680    super.setOrientation (); 
    681681    if ((style & SWT.RIGHT_TO_LEFT) !is 0) { 
     
    760760} 
    761761 
    762 void showWidget () { 
     762override void showWidget () { 
    763763    super.showWidget (); 
    764764    if (boxHandle !is null) OS.gtk_widget_show (boxHandle); 
  • dwt/widgets/Canvas.d

    r37 r58  
    128128} 
    129129 
    130 Point getIMCaretPos () { 
     130override Point getIMCaretPos () { 
    131131    if (caret is null) return super.getIMCaretPos (); 
    132132    return new Point (caret.x, caret.y); 
     
    154154} 
    155155 
    156 void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) { 
     156override void redrawWidget (int x, int y, int width, int height, bool redrawAll, bool all, bool trim) { 
    157157    bool isFocus = caret !is null && caret.isFocusCaret (); 
    158158    if (isFocus) caret.killFocus (); 
     
    161161} 
    162162 
    163 void releaseChildren (bool destroy) { 
     163override void releaseChildren (bool destroy) { 
    164164    if (caret !is null) { 
    165165        caret.release (false); 
     
    277277} 
    278278 
    279 int setBounds (int x, int y, int width, int height, bool move, bool resize) { 
     279override int setBounds (int x, int y, int width, int height, bool move, bool resize) { 
    280280    bool isFocus = caret !is null && caret.isFocusCaret (); 
    281281    if (isFocus) caret.killFocus (); 
     
    319319} 
    320320 
    321 public void setFont (Font font) { 
     321override public void setFont (Font font) { 
    322322    checkWidget(); 
    323323    if (caret !is null) caret.setFont (font); 
  • dwt/widgets/Composite.d

    r55 r58  
    2929import dwt.internal.gtk.OS; 
    3030import dwt.graphics.Rectangle; 
     31 
     32import tango.io.Stdout; 
    3133 
    3234/** 
     
    199201} 
    200202 
    201 void checkBuffered () { 
     203override void checkBuffered () { 
    202204    if ((style & SWT.DOUBLE_BUFFERED) is 0 && (style & SWT.NO_BACKGROUND) !is 0) { 
    203205        return; 
     
    206208} 
    207209 
    208 protected void checkSubclass () { 
     210override protected void checkSubclass () { 
    209211    /* Do nothing - Subclassing is allowed */ 
    210212} 
    211213 
    212 GtkStyle* childStyle () { 
     214override GtkStyle* childStyle () { 
    213215    if (scrolledHandle !is null) return null; 
    214216    return super.childStyle (); 
    215217} 
    216218 
    217 public Point computeSize (int wHint, int hHint, bool changed) { 
     219override public Point computeSize (int wHint, int hHint, bool changed) { 
    218220    checkWidget (); 
    219221    if (wHint !is SWT.DEFAULT && wHint < 0) wHint = 0; 
     
    239241} 
    240242 
    241 Control [] computeTabList () { 
     243override Control [] computeTabList () { 
    242244    Control result [] = super.computeTabList (); 
    243245    if (result.length is 0) return result; 
     
    256258} 
    257259 
    258 void createHandle (int index) { 
     260override void createHandle (int index) { 
    259261    state |= HANDLE | CANVAS; 
    260262    bool scrolled = (style & (SWT.H_SCROLL | SWT.V_SCROLL)) !is 0; 
     
    331333} 
    332334 
    333 void deregister () { 
     335override void deregister () { 
    334336    super.deregister (); 
    335337    if (socketHandle !is null) display.removeWidget (cast(GtkWidget*)socketHandle); 
     
    394396} 
    395397 
    396 void enableWidget (bool enabled) { 
     398override void enableWidget (bool enabled) { 
    397399    if ((state & CANVAS) !is 0) return; 
    398400    super.enableWidget (enabled); 
     
    403405} 
    404406 
    405 Menu [] findMenus (Control control) { 
     407override Menu [] findMenus (Control control) { 
    406408    if (control is this) return new Menu [0]; 
    407409    Menu result [] = super.findMenus (control); 
     
    420422} 
    421423 
    422 void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) { 
     424override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) { 
    423425    super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus); 
    424426    Control [] children = _getChildren (); 
     
    429431 
    430432alias Scrollable.fixStyle fixStyle; 
    431 void fixStyle () { 
     433override void fixStyle () { 
    432434    super.fixStyle (); 
    433435    if (scrolledHandle is null) fixStyle (handle); 
     
    460462 
    461463void fixZOrder () { 
     464        Stdout.formatln( "{}: parent.fixZOrder gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     465        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
    462466    if ((state & CANVAS) !is 0) return; 
    463467    auto parentHandle = parentingHandle (); 
     
    480484        OS.g_list_free (windowList); 
    481485    } 
    482 
    483  
    484 GtkWidget* focusHandle () { 
     486        Stdout.formatln( "{}: parent.fixZOrder gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     487        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
     488
     489 
     490override GtkWidget* focusHandle () { 
    485491    if (socketHandle !is null) return socketHandle; 
    486492    return super.focusHandle (); 
    487493} 
    488494 
    489 bool forceFocus (GtkWidget* focusHandle) { 
     495override bool forceFocus (GtkWidget* focusHandle) { 
    490496    if (socketHandle !is null) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); 
    491497    bool result = super.forceFocus (focusHandle); 
     
    555561} 
    556562 
    557 public Rectangle getClientArea () { 
     563override public Rectangle getClientArea () { 
    558564    checkWidget(); 
    559565    if ((state & CANVAS) !is 0) { 
     
    758764} 
    759765 
    760 void hookEvents () { 
     766override void hookEvents () { 
    761767    super.hookEvents (); 
    762768    if ((state & CANVAS) !is 0) { 
     
    772778} 
    773779 
    774 GtkIMContext* imHandle () { 
     780override GtkIMContext* imHandle () { 
    775781    return imHandle_; 
    776782} 
     
    799805} 
    800806 
    801 bool isTabGroup() { 
     807override bool isTabGroup() { 
    802808    if ((state & CANVAS) !is 0) return true; 
    803809    return super.isTabGroup(); 
     
    977983} 
    978984 
    979 void markLayout (bool changed, bool all) { 
     985override void markLayout (bool changed, bool all) { 
    980986    if (layout_ !is null) { 
    981987        state |= LAYOUT_NEEDED; 
     
    990996} 
    991997 
     998alias Scrollable.moveAbove moveAbove; 
    992999void moveAbove (GtkWidget* child, GtkWidget* sibling) { 
    9931000    if (child is sibling) return; 
    9941001    auto parentHandle = parentingHandle (); 
    9951002    auto fixed = cast(GtkFixed*)parentHandle; 
    996     auto children = fixed.children; 
     1003    GList* children = fixed.children; 
    9971004    if (children is null) return; 
    998     GList* data; 
     1005    void* data; 
    9991006    GtkWidget* widget; 
    1000     GList* childData, childLink, siblingLink; 
     1007    void* childData; 
     1008    GList* childLink, siblingLink; 
    10011009    GList* temp = children; 
    10021010    while (temp !is null) { 
    1003         data = temp
    1004         widget = cast(GtkWidget*) data; 
     1011        data = temp.data
     1012        widget = *cast(GtkWidget**) data; 
    10051013        if (child is widget) { 
    10061014            childLink = temp; 
     
    10271035} 
    10281036 
     1037alias Scrollable.moveBelow moveBelow; 
    10291038void moveBelow (GtkWidget* child, GtkWidget* sibling) { 
    10301039    if (child is sibling) return; 
     
    10351044    } 
    10361045    auto fixed = cast(GtkFixed*)parentHandle; 
    1037     auto children = fixed.children; 
     1046    GList* children = fixed.children; 
    10381047    if (children is null) return; 
    1039     GList* data; 
     1048    void* data; 
    10401049    GtkWidget* widget; 
    1041     GList* childData, childLink, siblingLink, temp = children; 
     1050    void* childData; 
     1051    GList* childLink, siblingLink, temp = children; 
     1052    Stdout.formatln( "{}: before loop child={} sibling={}", __LINE__, child, sibling ); 
     1053            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     1054            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
    10421055    while (temp !is null) { 
    1043         data = temp; 
     1056        Stdout.formatln( "{}: loop start {}->{}", __LINE__, temp, cast(void*)temp.data ); 
     1057        data = (*temp).data; 
    10441058        widget = cast(GtkWidget*) data; 
    10451059        if (child is widget) { 
     1060            Stdout.formatln( "{}: child is widget", __LINE__ ); 
    10461061            childLink = temp; 
    10471062            childData = data; 
    10481063        } else if (sibling is widget) { 
     1064            Stdout.formatln( "{}: sibling is widget", __LINE__ ); 
    10491065            siblingLink = temp; 
    10501066        } 
    10511067        if (childData !is null && (sibling is null || siblingLink !is null)) break; 
    1052         temp = temp.next; 
    1053     } 
     1068        temp = OS.g_list_next(temp); 
     1069        Stdout.formatln( "{}: loop end", __LINE__ ); 
     1070    } 
     1071    Stdout.formatln( "{}: after loop childLink={}", __LINE__, childLink ); 
    10541072    children = OS.g_list_remove_link (children, childLink); 
    1055     if (siblingLink is null || siblingLink.next is null) { 
     1073    if (siblingLink is null || OS.g_list_next(siblingLink) is null) { 
    10561074        OS.g_list_free_1 (childLink); 
     1075            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     1076            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
     1077            Stdout.formatln( " {} {}", children, childData ); 
    10571078        children = OS.g_list_append (children, childData); 
     1079            Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     1080            Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
    10581081    } else { 
    1059         temp = siblingLink.next; 
    1060         childLink.next = temp; 
    1061         temp.prev = childLink; 
    1062         childLink.prev = siblingLink; 
    1063         siblingLink.next =  childLink; 
     1082        Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     1083        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
     1084        temp = OS.g_list_next( siblingLink ); 
     1085        OS.g_list_set_next (childLink, temp); 
     1086        OS.g_list_set_previous (temp, childLink); 
     1087        OS.g_list_set_previous (childLink, siblingLink); 
     1088        OS.g_list_set_next (siblingLink, childLink); 
    10641089    } 
    10651090    fixed.children = children; 
    10661091    parentHandle = cast(GtkWidget*)fixed; 
     1092        Stdout.formatln( "{}: parent.moveBelow gtk_container_get_children {:x}", __LINE__, parentingHandle() ); 
     1093        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentingHandle()) ); 
    10671094} 
    10681095 
     
    10831110} 
    10841111 
    1085 void redrawChildren () { 
     1112override void redrawChildren () { 
    10861113    super.redrawChildren (); 
    10871114    Control [] children = _getChildren (); 
     
    10951122} 
    10961123 
    1097 void register () { 
     1124override void register () { 
    10981125    super.register (); 
    10991126    if (socketHandle !is null) display.addWidget (socketHandle, this); 
    11001127} 
    11011128 
    1102 void releaseChildren (bool destroy) { 
     1129override void releaseChildren (bool destroy) { 
    11031130    Control [] children = _getChildren (); 
    11041131    for (int i=0; i<children.length; i++) { 
     
    11111138} 
    11121139 
    1113 void releaseHandle () { 
     1140override void releaseHandle () { 
    11141141    super.releaseHandle (); 
    11151142    socketHandle = null; 
     
    11171144} 
    11181145 
    1119 void releaseWidget () { 
     1146override void releaseWidget () { 
    11201147    super.releaseWidget (); 
    11211148    if (imHandle_ !is null) OS.g_object_unref (imHandle_); 
     
    11291156} 
    11301157 
    1131 void resizeHandle (int width, int height) { 
     1158override void resizeHandle (int width, int height) { 
    11321159    super.resizeHandle (width, height); 
    11331160    if (socketHandle !is null) OS.gtk_widget_set_size_request (socketHandle, width, height); 
     
    11601187} 
    11611188 
    1162 int setBounds (int x, int y, int width, int height, bool move, bool resize) { 
     1189alias Scrollable.setBounds setBounds; 
     1190override int setBounds (int x, int y, int width, int height, bool move, bool resize) { 
    11631191    int result = super.setBounds (x, y, width, height, move, resize); 
    11641192    if ((result & RESIZED) !is 0 && layout_ !is null) { 
     
    11691197} 
    11701198 
    1171 public bool setFocus () { 
     1199override public bool setFocus () { 
    11721200    checkWidget(); 
    11731201    Control [] children = _getChildren (); 
     
    12291257} 
    12301258 
    1231 bool setScrollBarVisible (ScrollBar bar, bool visible) { 
     1259override bool setScrollBarVisible (ScrollBar bar, bool visible) { 
    12321260    bool changed = super.setScrollBarVisible (bar, visible); 
    12331261    if (changed && layout_ !is null) { 
     
    12381266} 
    12391267 
    1240 bool setTabGroupFocus (bool next) { 
     1268override bool setTabGroupFocus (bool next) { 
    12411269    if (isTabItem ()) return setTabItemFocus (next); 
    12421270    bool takeFocus = (style & SWT.NO_FOCUS) is 0; 
     
    12521280} 
    12531281 
    1254 bool setTabItemFocus (bool next) { 
     1282override bool setTabItemFocus (bool next) { 
    12551283    if (!super.setTabItemFocus (next)) return false; 
    12561284    if (socketHandle !is null) { 
     
    12941322} 
    12951323 
    1296 void showWidget () { 
     1324override void showWidget () { 
    12971325    super.showWidget (); 
    12981326    if (socketHandle !is null) { 
     
    13031331} 
    13041332 
    1305 bool translateMnemonic (Event event, Control control) { 
     1333override bool translateMnemonic (Event event, Control control) { 
    13061334    if (super.translateMnemonic (event, control)) return true; 
    13071335    if (control !is null) { 
     
    13151343} 
    13161344 
    1317 int traversalCode(int key, GdkEventKey* event) { 
     1345override int traversalCode(int key, GdkEventKey* event) { 
    13181346    if ((state & CANVAS) !is 0) { 
    13191347        if ((style & SWT.NO_FOCUS) !is 0) return 0; 
     
    13231351} 
    13241352 
    1325 bool translateTraversal (GdkEventKey* keyEvent) { 
     1353override bool translateTraversal (GdkEventKey* keyEvent) { 
    13261354    if (socketHandle !is null) return false; 
    13271355    return super.translateTraversal (keyEvent); 
  • dwt/widgets/Control.d

    r55 r58  
    5353 
    5454import Math = tango.math.Math; 
    55 import tango.stdc.string; 
    5655import tango.stdc.stringz; 
    5756import tango.core.Thread; 
     
    132131} 
    133132 
    134 void deregister () { 
     133override void deregister () { 
    135134    super.deregister (); 
    136135    if (fixedHandle !is null) display.removeWidget (fixedHandle); 
     
    180179} 
    181180 
    182 void fixStyle () { 
     181public void fixStyle () { 
    183182    if (fixedHandle !is null) fixStyle (fixedHandle); 
    184183} 
     
    199198    auto childStyle = parent.childStyle (); 
    200199    if (childStyle !is null) { 
    201         GdkColor* color = new GdkColor()
    202         OS.gtk_style_get_bg (childStyle, 0, color); 
    203         OS.gtk_widget_modify_bg (handle, 0, color); 
     200        GdkColor color
     201        OS.gtk_style_get_bg (childStyle, 0, &color); 
     202        OS.gtk_widget_modify_bg (handle, 0, &color); 
    204203    } 
    205204} 
     
    217216} 
    218217 
    219 void hookEvents () { 
     218override void hookEvents () { 
    220219    /* Connect the keyboard signals */ 
    221220    auto focusHandle = focusHandle (); 
     
    291290} 
    292291 
    293 int /*long*/ hoverProc (int /*long*/ widget) { 
     292override int /*long*/ hoverProc (GtkWidget* widget) { 
    294293    int x, y; 
    295294    int mask; 
     
    300299} 
    301300 
    302 GtkWidget* topHandle() { 
     301override GtkWidget* topHandle() { 
    303302    if (fixedHandle !is null) return fixedHandle; 
    304303    return super.topHandle (); 
     
    315314} 
    316315 
    317 GdkWindow* paintWindow () { 
     316override GdkWindow* paintWindow () { 
    318317    auto paintHandle = paintHandle (); 
    319318    OS.gtk_widget_realize (paintHandle); 
     
    418417} 
    419418 
    420 void createWidget (int index) { 
     419override void createWidget (int index) { 
    421420    state |= DRAG_DETECT; 
    422421    checkOrientation (parent); 
     
    476475    int width = wHint, height = hHint; 
    477476    if (wHint is SWT.DEFAULT && hHint is SWT.DEFAULT) { 
    478         GtkRequisition* requisition = new GtkRequisition ()
    479         gtk_widget_size_request (h, requisition); 
     477        GtkRequisition requisition
     478        gtk_widget_size_request (h, &requisition); 
    480479        width = OS.GTK_WIDGET_REQUISITION_WIDTH (h); 
    481480        height = OS.GTK_WIDGET_REQUISITION_HEIGHT (h); 
     
    484483        OS.gtk_widget_get_size_request (h, &reqWidth, &reqHeight); 
    485484        OS.gtk_widget_set_size_request (h, wHint, hHint); 
    486         GtkRequisition* requisition = new GtkRequisition ()
    487         gtk_widget_size_request (h, requisition); 
     485        GtkRequisition requisition
     486        gtk_widget_size_request (h, &requisition); 
    488487        OS.gtk_widget_set_size_request (h, reqWidth, reqHeight); 
    489488        width = wHint is SWT.DEFAULT ? requisition.width : wHint; 
     
    500499    */ 
    501500    auto topHandle = topHandle (); 
    502     GtkRequisition* requisition = new GtkRequisition ()
    503     gtk_widget_size_request (topHandle, requisition); 
    504     GtkAllocation* allocation = new GtkAllocation ()
     501    GtkRequisition requisition
     502    gtk_widget_size_request (topHandle, &requisition); 
     503    GtkAllocation allocation
    505504    allocation.x = OS.GTK_WIDGET_X (topHandle); 
    506505    allocation.y = OS.GTK_WIDGET_Y (topHandle); 
    507506    allocation.width = OS.GTK_WIDGET_WIDTH (topHandle); 
    508507    allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle); 
    509     OS.gtk_widget_size_allocate (topHandle, allocation); 
     508    OS.gtk_widget_size_allocate (topHandle, &allocation); 
    510509} 
    511510 
     
    675674        * a call to gtk_widget_size_request(). 
    676675        */ 
    677         GtkRequisition* requisition = new GtkRequisition ()
    678         gtk_widget_size_request (topHandle, requisition); 
    679         GtkAllocation* allocation = new GtkAllocation ()
     676        GtkRequisition requisition
     677        gtk_widget_size_request (topHandle, &requisition); 
     678        GtkAllocation allocation
    680679        if (move) { 
    681680            allocation.x = x; 
     
    692691            allocation.height = OS.GTK_WIDGET_HEIGHT (topHandle); 
    693692        } 
    694         OS.gtk_widget_size_allocate (topHandle, allocation); 
     693        OS.gtk_widget_size_allocate (topHandle, &allocation); 
    695694    } 
    696695    /* 
     
    842841 
    843842    Stdout.formatln( "setRelations {:x}", cast(uint)parentHandle ); 
     843        Stdout.formatln( "showWidget gtk_container_get_children {:x}", parentHandle ); 
     844        Stdout.formatln( "=> {}", OS.gtk_container_get_children (cast(GtkContainer*)parentHandle) ); 
    844845    auto list = OS.gtk_container_get_children (cast(GtkContainer*)parentHandle); 
    845846    if (list is null) return; 
     
    18401841} 
    18411842 
    1842 bool dragDetect (int x, int y, bool filter, bool [] consume) { 
     1843bool dragDetect (int x, int y, bool filter, bool* consume) { 
    18431844    bool quit = false, dragging = false; 
    18441845    while (!quit) { 
     
    18491850                break; 
    18501851            } else { 
    1851                 try {Thread.sleep(50);} catch (Exception ex) {} 
     1852                try {Thread.sleep(0.050);} catch (Exception ex) {} 
    18521853            } 
    18531854        } 
    18541855        switch (cast(int)OS.GDK_EVENT_TYPE (eventPtr)) { 
    18551856            case OS.GDK_MOTION_NOTIFY: { 
    1856                 GdkEventMotion* gdkMotionEvent = new GdkEventMotion (); 
    1857                 memmove (gdkMotionEvent, eventPtr, GdkEventMotion.sizeof); 
     1857                GdkEventMotion* gdkMotionEvent = cast(GdkEventMotion*)eventPtr; 
    18581858                if ((gdkMotionEvent.state & OS.GDK_BUTTON1_MASK) !is 0) { 
    18591859                    if (OS.gtk_drag_check_threshold (handle, x, y, cast(int) gdkMotionEvent.x, cast(int) gdkMotionEvent.y)) { 
     
    18701870            case OS.GDK_KEY_PRESS: 
    18711871            case OS.GDK_KEY_RELEASE: { 
    1872                 GdkEventKey* gdkEvent = new GdkEventKey (); 
    1873                 memmove (gdkEvent, eventPtr, GdkEventKey.sizeof); 
     1872                GdkEventKey* gdkEvent = cast(GdkEventKey*)eventPtr; 
    18741873                if (gdkEvent.keyval is OS.GDK_Escape) quit = true; 
    18751874                break; 
     
    19141913} 
    19151914 
    1916 int /*long*/ fixedMapProc (GtkWidget* widget) { 
     1915override int /*long*/ fixedMapProc (GtkWidget* widget) { 
    19171916    OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); 
    19181917    auto widgetList = OS.gtk_container_get_children (cast(GtkContainer*)widget); 
     
    22122211    if (screen !is null) { 
    22132212        int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, paintWindow ()); 
    2214         GdkRectangle* dest = new GdkRectangle ()
    2215         OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest); 
     2213        GdkRectangle dest
     2214        OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, &dest); 
    22162215        monitor = new dwt.widgets.Monitor.Monitor (); 
    22172216        monitor.handle = monitorNumber; 
     
    23342333} 
    23352334 
    2336 override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) { 
    2337     GdkEventButton* gdkEvent = new GdkEventButton (); 
    2338     memmove (gdkEvent, event, GdkEventButton.sizeof); 
     2335override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* gdkEvent) { 
    23392336    if (gdkEvent.type is OS.GDK_3BUTTON_PRESS) return 0; 
    23402337    /* 
     
    23612358        if ((state & DRAG_DETECT) !is 0 && hooks (SWT.DragDetect)) { 
    23622359            if (gdkEvent.button is 1) { 
    2363                 bool [] consume = new bool [1]
    2364                 if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, consume)) { 
     2360                bool consume = false
     2361                if (dragDetect (cast(int) gdkEvent.x, cast(int) gdkEvent.y, true, &consume)) { 
    23652362                    dragging = true; 
    2366                     if (consume [0]) result = 1; 
     2363                    if (consume ) result = 1; 
    23672364                } 
    23682365                if (isDisposed ()) return 1; 
     
    23982395} 
    23992396 
    2400 override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* event) { 
    2401     GdkEventButton* gdkEvent = new GdkEventButton (); 
    2402     memmove (gdkEvent, event, GdkEventButton.sizeof); 
     2397override int /*long*/ gtk_button_release_event (GtkWidget* widget, GdkEventButton* gdkEvent) { 
    24032398    /* 
    24042399    * Feature in GTK.  When button 4, 5, 6, or 7 is released, GTK 
     
    24252420} 
    24262421 
    2427 override int /*long*/ gtk_enter_notify_event (GtkWidget*  widget, GdkEventCrossing* event) { 
     2422override int /*long*/ gtk_enter_notify_event (GtkWidget*  widget, GdkEventCrossing* gdkEvent) { 
    24282423    if (display.currentControl is this) return 0; 
    2429     GdkEventCrossing* gdkEvent = new GdkEventCrossing (); 
    2430     memmove (gdkEvent, event, GdkEventCrossing.sizeof); 
    24312424    if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0; 
    24322425    if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0; 
     
    24432436 
    24442437override int /*long*/ gtk_event_after (GtkWidget*  widget, GdkEvent* gdkEvent) { 
    2445     GdkEvent* event = new GdkEvent (); 
    2446     memmove (event, gdkEvent, GdkEvent.sizeof); 
    2447     switch (cast(int)event.type) { 
     2438    switch (cast(int)gdkEvent.type) { 
    24482439        case OS.GDK_BUTTON_PRESS: { 
    24492440            if (widget !is eventHandle ()) break; 
     
    24542445            */ 
    24552446            if ((state & MENU) is 0) { 
    2456                 GdkEventButton* gdkEventButton = new GdkEventButton (); 
    2457                 memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof); 
     2447                GdkEventButton* gdkEventButton = cast(GdkEventButton*)gdkEvent; 
    24582448                if (gdkEventButton.button is 3) { 
    24592449                    showMenu (cast(int) gdkEventButton.x_root, cast(int) gdkEventButton.y_root); 
     
    24642454        case OS.GDK_FOCUS_CHANGE: { 
    24652455            if (widget !is focusHandle ()) break; 
    2466             GdkEventFocus* gdkEventFocus = new GdkEventFocus (); 
    2467             memmove (gdkEventFocus, gdkEvent, GdkEventFocus.sizeof); 
     2456            GdkEventFocus* gdkEventFocus = cast(GdkEventFocus*)gdkEvent; 
    24682457 
    24692458            /* 
     
    24992488} 
    25002489 
    2501 override int /*long*/ gtk_expose_event (GtkWidget*  widget, GdkEventExpose* eventPtr) { 
     2490override int /*long*/ gtk_expose_event (GtkWidget*  widget, GdkEventExpose* gdkEvent) { 
    25022491    if ((state & OBSCURED) !is 0) return 0; 
    25032492    if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return 0; 
    2504     GdkEventExpose* gdkEvent = new GdkEventExpose (); 
    2505     memmove(gdkEvent, eventPtr, GdkEventExpose.sizeof); 
    25062493    Event event = new Event (); 
    25072494    event.count = gdkEvent.count; 
     
    25562543} 
    25572544 
    2558 override int /*long*/ gtk_key_press_event (GtkWidget*  widget, GdkEventKey* event) { 
     2545override int /*long*/ gtk_key_press_event (GtkWidget*  widget, GdkEventKey* gdkEvent) { 
    25592546    if (!hasFocus ()) return 0; 
    2560     GdkEventKey* gdkEvent = new GdkEventKey (); 
    2561     memmove (gdkEvent, event, GdkEventKey.sizeof); 
    25622547 
    25632548    if (translateMnemonic (gdkEvent.keyval, gdkEvent)) return 1; 
     
    25652550    if (isDisposed ()) return 0; 
    25662551 
    2567     if (filterKey (gdkEvent.keyval, event)) return 1; 
     2552    if (filterKey (gdkEvent.keyval, gdkEvent)) return 1; 
    25682553    // widget could be disposed at this point 
    25692554    if (isDisposed ()) return 0; 
     
    25722557    // widget could be disposed at this point 
    25732558    if (isDisposed ()) return 0; 
    2574     return super.gtk_key_press_event (widget, event); 
     2559    return super.gtk_key_press_event (widget, gdkEvent); 
    25752560} 
    25762561 
     
    25842569} 
    25852570 
    2586 override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* event) { 
     2571override int /*long*/ gtk_leave_notify_event (GtkWidget* widget, GdkEventCrossing* gdkEvent) { 
    25872572    if (display.currentControl !is this) return 0; 
    25882573    display.removeMouseHoverTimeout (handle); 
    25892574    int result = 0; 
    25902575    if (sendLeaveNotify () || display.getCursorControl () is null) { 
    2591         GdkEventCrossing* gdkEvent = new GdkEventCrossing (); 
    2592         memmove (gdkEvent, event, GdkEventCrossing.sizeof); 
    25932576        if (gdkEvent.mode !is OS.GDK_CROSSING_NORMAL && gdkEvent.mode !is OS.GDK_CROSSING_UNGRAB) return 0; 
    25942577        if ((gdkEvent.state & (OS.GDK_BUTTON1_MASK | OS.GDK_BUTTON2_MASK | OS.GDK_BUTTON3_MASK)) !is 0) return 0; 
     
    26032586    auto eventPtr = OS.gtk_get_current_event (); 
    26042587    if (eventPtr !is null) { 
    2605         GdkEventKey* keyEvent = new GdkEventKey (); 
    2606         memmove (keyEvent, eventPtr, GdkEventKey.sizeof); 
     2588        GdkEventKey* keyEvent = cast(GdkEventKey*)eventPtr; 
    26072589        if (keyEvent.type is OS.GDK_KEY_PRESS) { 
    26082590            Control focusControl = display.getFocusControl (); 
     
    26202602} 
    26212603 
    2622 override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* event) { 
    2623     GdkEventMotion* gdkEvent = new GdkEventMotion (); 
    2624     memmove (gdkEvent, event, GdkEventMotion.sizeof); 
     2604override int /*long*/ gtk_motion_notify_event (GtkWidget* widget, GdkEventMotion* gdkEvent) { 
    26252605    if (this is display.currentControl && (hooks (SWT.MouseHover) || filters (SWT.MouseHover))) { 
    26262606        display.addMouseHoverTimeout (handle); 
     
    26662646} 
    26672647 
    2668 override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* eventPtr) { 
    2669     GdkEventScroll* gdkEvent = new GdkEventScroll (); 
    2670     memmove (gdkEvent, eventPtr, GdkEventScroll.sizeof); 
     2648override int /*long*/ gtk_scroll_event (GtkWidget* widget, GdkEventScroll* gdkEvent) { 
    26712649    switch (cast(int)gdkEvent.direction) { 
    26722650        case OS.GDK_SCROLL_UP: 
     
    27012679} 
    27022680 
    2703 override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* event) { 
    2704     GdkEventVisibility* gdkEvent = new GdkEventVisibility (); 
    2705     memmove (gdkEvent, event, GdkEventVisibility.sizeof); 
     2681override int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, GdkEventVisibility* gdkEvent) { 
    27062682    auto paintWindow = paintWindow(); 
    27072683    auto window = gdkEvent.window; 
     
    27132689                int width, height; 
    27142690                OS.gdk_drawable_get_size (cast(GdkDrawable*)window, &width, &height); 
    2715                 GdkRectangle* rect = new GdkRectangle ()
     2691                GdkRectangle rect
    27162692                rect.width = width; 
    27172693                rect.height = height; 
    2718                 OS.gdk_window_invalidate_rect (window, rect, false); 
     2694                OS.gdk_window_invalidate_rect (window, &rect, false); 
    27192695            } 
    27202696            state &= ~OBSCURED; 
     
    29192895} 
    29202896 
    2921 void register () { 
     2897override void register () { 
    29222898    super.register (); 
    29232899    if (fixedHandle !is null) display.addWidget (fixedHandle, this); 
     
    29982974    if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) is 0) return; 
    29992975    auto window = paintWindow (); 
    3000     GdkRectangle* rect = new GdkRectangle ()
     2976    GdkRectangle rect
    30012977    if (redrawAll) { 
    30022978        int w, h; 
     
    30102986        rect.height = height; 
    30112987    } 
    3012     OS.gdk_window_invalidate_rect (window, rect, all); 
    3013 } 
    3014  
    3015 void release (bool destroy) { 
     2988    OS.gdk_window_invalidate_rect (window, &rect, all); 
     2989} 
     2990 
     2991override void release (bool destroy) { 
    30162992    Control next = null, previous = null; 
    30172993    if (destroy && parent !is null) { 
     
    30333009} 
    30343010 
    3035 void releaseHandle () { 
     3011override void releaseHandle () { 
    30363012    super.releaseHandle (); 
    30373013    fixedHandle = null; 
     
    30393015} 
    30403016 
    3041 void releaseParent () { 
     3017override void releaseParent () { 
    30423018    parent.removeControl (this); 
    30433019} 
    30443020 
    3045 void releaseWidget () { 
     3021override void releaseWidget () { 
    30463022    super.releaseWidget (); 
    30473023    if (display.currentControl is this) display.currentControl = null; 
     
    32193195    if (ptr !is null) OS.g_free (ptr); 
    32203196    char[] name = color is null ? "<parent>" : "<none>" ; 
    3221     char* pname = toStringz( name ); 
    32223197    ptr = cast(char*)OS.g_malloc (name.length+1); 
    3223     memmove (ptr, pname, name.length+1); 
     3198    ptr[ 0 .. name.length ] = name; 
     3199    ptr[ name.length ] = '\0'; 
    32243200    OS.gtk_rc_style_set_bg_pixmap_name (style, index, ptr); 
    32253201    OS.gtk_rc_style_set_bg (style, index, color); 
     
    34023378        auto window = OS.GTK_WIDGET_WINDOW (parentHandle); 
    34033379        Rectangle rect = getBounds (); 
    3404         GdkWindowAttr* attributes = new GdkWindowAttr ()
     3380        GdkWindow