[Git][wxwidgets/wxwidgets][master] 7 commits: CMake: Fix installing webp libraries in static build

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
May 24, 2025, 1:12:42 PMMay 24
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 632ee641
    by Maarten Bent at 2025-05-22T21:24:54+02:00
    CMake: Fix installing webp libraries in static build
    
    Fixes #25439
    
  • 55131146
    by Maarten Bent at 2025-05-22T21:27:17+02:00
    CMake: Create all mswu include directories when installing
    
    Create both mswu and mswud directories, so CMake can be used when only one of them in installed.
    
    Fixes #25440
    
  • 1dc73348
    by Maarten Bent at 2025-05-23T19:38:00+02:00
    CMake: Fix monolithic build with static wxWebviewEdge
    
  • b28cdcf1
    by Kerim Demirkaynak at 2025-05-24T18:01:57+02:00
    Update Turkish translations
    
    Closes #25445.
    
  • 41ef3e8f
    by ali kettab at 2025-05-24T18:41:13+02:00
    Add RTL support to wxGCDC when using GDI+ backend
    
    Closes #25427.
    
    Closes #25431.
    
  • 436c1613
    by Vadim Zeitlin at 2025-05-24T18:44:30+02:00
    Merge branch 'cmake-webp-fixes' of github.com:MaartenBent/wxWidgets
    
    Fix CMake webp installation and missing mswu include directory.
    
    See #25442.
    
  • d137d1e1
    by Blake-Madden at 2025-05-24T18:47:45+02:00
    Add wxGraphicsContext overloads taking wx{Rect,Point}2DDouble
    
    Also, add missing documentation for ClearRectangle().
    
    Closes #25444.
    

9 changed files:

Changes:

  • build/cmake/functions.cmake
    ... ... @@ -542,6 +542,21 @@ macro(wx_lib_link_libraries name)
    542 542
         endif()
    
    543 543
     endmacro()
    
    544 544
     
    
    545
    +# wx_lib_link_directories(name [])
    
    546
    +# Forwards everything to target_link_directories() except for monolithic
    
    547
    +# build where it collects all directories for linking with the mono lib
    
    548
    +macro(wx_lib_link_directories name)
    
    549
    +    if(wxBUILD_MONOLITHIC)
    
    550
    +        cmake_parse_arguments(_DIR_LINK "" "" "PUBLIC;PRIVATE" ${ARGN})
    
    551
    +        list(APPEND wxMONO_DIRS_PUBLIC ${_DIR_LINK_PUBLIC})
    
    552
    +        list(APPEND wxMONO_DIRS_PRIVATE ${_DIR_LINK_PRIVATE})
    
    553
    +        set(wxMONO_DIRS_PUBLIC ${wxMONO_DIRS_PUBLIC} PARENT_SCOPE)
    
    554
    +        set(wxMONO_DIRS_PRIVATE ${wxMONO_DIRS_PRIVATE} PARENT_SCOPE)
    
    555
    +    else()
    
    556
    +        target_link_directories(${name};${ARGN})
    
    557
    +    endif()
    
    558
    +endmacro()
    
    559
    +
    
    545 560
     # wx_exe_link_libraries(target libs...)
    
    546 561
     # Link wx libraries to executable
    
    547 562
     macro(wx_exe_link_libraries name)
    

  • build/cmake/install.cmake
    ... ... @@ -38,6 +38,13 @@ endif()
    38 38
     
    
    39 39
     # setup header and wx-config
    
    40 40
     if(WIN32_MSVC_NAMING)
    
    41
    +    # create both Debug and Release directories, so CMake doesn't complain about
    
    42
    +    # non-existent path when only Release or Debug build has been installed
    
    43
    +    set(lib_unicode "u")
    
    44
    +    install(DIRECTORY
    
    45
    +        DESTINATION "lib/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode}")
    
    46
    +    install(DIRECTORY
    
    47
    +        DESTINATION "lib/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode}d")
    
    41 48
         install(
    
    42 49
             DIRECTORY "${wxSETUP_HEADER_PATH}"
    
    43 50
             DESTINATION "lib/${wxPLATFORM_LIB_DIR}")
    

  • build/cmake/lib/CMakeLists.txt
    ... ... @@ -12,6 +12,8 @@ if(wxBUILD_MONOLITHIC)
    12 12
         set(wxMONO_SRC_FILES)
    
    13 13
         set(wxMONO_LIBS_PRIVATE)
    
    14 14
         set(wxMONO_LIBS_PUBLIC)
    
    15
    +    set(wxMONO_DIRS_PRIVATE)
    
    16
    +    set(wxMONO_DIRS_PUBLIC)
    
    15 17
         set(wxMONO_INCLUDE_DIRS)
    
    16 18
         set(wxMONO_DEFINITIONS)
    
    17 19
         set(wxMONO_NONCOMPILED_CPP_FILES)
    
    ... ... @@ -90,6 +92,9 @@ if(wxBUILD_MONOLITHIC)
    90 92
     
    
    91 93
                 target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}})
    
    92 94
             endif()
    
    95
    +        if(wxMONO_DIRS_${vis})
    
    96
    +            target_link_directories(wxmono ${vis} ${wxMONO_DIRS_${vis}})
    
    97
    +        endif()
    
    93 98
         endforeach()
    
    94 99
         if(wxMONO_INCLUDE_DIRS)
    
    95 100
             target_include_directories(wxmono BEFORE PRIVATE ${wxMONO_INCLUDE_DIRS})
    

  • build/cmake/lib/webp.cmake
    ... ... @@ -45,11 +45,19 @@ if(wxUSE_LIBWEBP STREQUAL "builtin")
    45 45
         foreach(target_name IN LISTS webpTargets)
    
    46 46
             set_target_properties(${target_name} PROPERTIES
    
    47 47
                 FOLDER "Third Party Libraries/WebP"
    
    48
    -            OUTPUT_NAME "${target_name}"
    
    48
    +            PREFIX  ""
    
    49
    +            OUTPUT_NAME "wx${target_name}"
    
    50
    +            PUBLIC_HEADER ""
    
    49 51
             )
    
    50 52
         endforeach()
    
    51 53
     
    
    52
    -    set(WebP_LIBRARIES webp webpdemux)
    
    54
    +    set(WebP_LIBRARIES webp webpdemux sharpyuv)
    
    55
    +    if(NOT wxBUILD_SHARED)
    
    56
    +        wx_install(TARGETS ${WebP_LIBRARIES}
    
    57
    +            EXPORT wxWidgetsTargets
    
    58
    +            ARCHIVE DESTINATION "lib${GEN_EXPR_DIR}${wxPLATFORM_LIB_DIR}"
    
    59
    +        )
    
    60
    +    endif()
    
    53 61
     
    
    54 62
     elseif(wxUSE_LIBWEBP)
    
    55 63
         find_package(WebP REQUIRED)
    

  • build/cmake/lib/webview/CMakeLists.txt
    ... ... @@ -81,7 +81,7 @@ elseif(WXMSW)
    81 81
             endif()
    
    82 82
     
    
    83 83
             if (wxUSE_WEBVIEW_EDGE_STATIC)
    
    84
    -            target_link_directories(wxwebview PUBLIC
    
    84
    +            wx_lib_link_directories(wxwebview PUBLIC
    
    85 85
                     $<BUILD_INTERFACE:${WEBVIEW2_PACKAGE_DIR}/build/native/$(LibrariesArchitecture)/>
    
    86 86
                 )
    
    87 87
             else()
    

  • include/wx/graphics.h
    ... ... @@ -516,21 +516,37 @@ public:
    516 516
     
    
    517 517
         // adds a quadratic Bezier curve from the current point, using a control point and an end point
    
    518 518
         virtual void AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y );
    
    519
    +    void AddQuadCurveToPoint(const wxPoint2DDouble& cp, const wxPoint2DDouble& e)
    
    520
    +    {
    
    521
    +        AddQuadCurveToPoint(cp.m_x, cp.m_y, e.m_x, e.m_y);
    
    522
    +    }
    
    519 523
     
    
    520 524
         // appends a rectangle as a new closed subpath
    
    521 525
         virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h );
    
    526
    +    virtual void AddRectangle(const wxRect2DDouble& rect)
    
    527
    +    {
    
    528
    +        AddRectangle(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    529
    +    }
    
    522 530
     
    
    523 531
         // appends an ellipsis as a new closed subpath fitting the passed rectangle
    
    524 532
         virtual void AddCircle( wxDouble x, wxDouble y, wxDouble r );
    
    525 533
     
    
    526
    -    // appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)
    
    534
    +    // appends an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)
    
    527 535
         virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r );
    
    528 536
     
    
    529 537
         // appends an ellipse
    
    530 538
         virtual void AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    539
    +    void AddEllipse(const wxRect2DDouble& rect)
    
    540
    +    {
    
    541
    +        AddEllipse(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    542
    +    }
    
    531 543
     
    
    532 544
         // appends a rounded rectangle
    
    533 545
         virtual void AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
    
    546
    +    void AddRoundedRectangle(const wxRect2DDouble& rect, wxDouble radius)
    
    547
    +    {
    
    548
    +        AddRoundedRectangle(rect.m_x, rect.m_y, rect.m_width, rect.m_height, radius);
    
    549
    +    }
    
    534 550
     
    
    535 551
         // returns the native path
    
    536 552
         virtual void * GetNativePath() const;
    
    ... ... @@ -699,12 +715,24 @@ public:
    699 715
         // clips drawings to the rect intersected with the current clipping region
    
    700 716
         virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
    
    701 717
     
    
    718
    +    void Clip(const wxRect2DDouble& rect)
    
    719
    +    {
    
    720
    +        Clip(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    721
    +    }
    
    722
    +
    
    702 723
         // resets the clipping to original extent
    
    703 724
         virtual void ResetClip() = 0;
    
    704 725
     
    
    705 726
         // returns bounding box of the clipping region
    
    706 727
         virtual void GetClipBox(wxDouble* x, wxDouble* y, wxDouble* w, wxDouble* h) = 0;
    
    707 728
     
    
    729
    +    wxNODISCARD wxRect2DDouble GetClipBox()
    
    730
    +    {
    
    731
    +        wxDouble x, y, w, h;
    
    732
    +        GetClipBox(&x, &y, &w, &h);
    
    733
    +        return wxRect2DDouble{ x, y, w, h };
    
    734
    +    }
    
    735
    +
    
    708 736
         // returns the native context
    
    709 737
         virtual void * GetNativeContext() = 0;
    
    710 738
     
    
    ... ... @@ -782,6 +810,11 @@ public:
    782 810
         // translate
    
    783 811
         virtual void Translate( wxDouble dx , wxDouble dy ) = 0;
    
    784 812
     
    
    813
    +    void Translate(const wxPoint2DDouble& pt)
    
    814
    +    {
    
    815
    +        Translate(pt.m_x, pt.m_y);
    
    816
    +    }
    
    817
    +
    
    785 818
         // scale
    
    786 819
         virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0;
    
    787 820
     
    
    ... ... @@ -828,6 +861,11 @@ public:
    828 861
         // paints a transparent rectangle (only useful for bitmaps or windows)
    
    829 862
         virtual void ClearRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    830 863
     
    
    864
    +    void ClearRectangle(const wxRect2DDouble& rect)
    
    865
    +    {
    
    866
    +        ClearRectangle(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    867
    +    }
    
    868
    +
    
    831 869
         //
    
    832 870
         // text
    
    833 871
         //
    
    ... ... @@ -835,6 +873,9 @@ public:
    835 873
         void DrawText( const wxString &str, wxDouble x, wxDouble y )
    
    836 874
             { DoDrawText(str, x, y); }
    
    837 875
     
    
    876
    +    void DrawText( const wxString &str, const wxPoint2DDouble& pt)
    
    877
    +        { DoDrawText(str, pt.m_x, pt.m_y); }
    
    878
    +
    
    838 879
         void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle )
    
    839 880
             { DoDrawRotatedText(str, x, y, angle); }
    
    840 881
     
    
    ... ... @@ -858,10 +899,20 @@ public:
    858 899
     
    
    859 900
         virtual void DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
    
    860 901
     
    
    902
    +    void DrawBitmap(const wxGraphicsBitmap& bmp, const wxRect2DDouble& rect)
    
    903
    +    {
    
    904
    +        DrawBitmap(bmp, rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    905
    +    }
    
    906
    +
    
    861 907
         virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
    
    862 908
     
    
    863 909
         virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0;
    
    864 910
     
    
    911
    +    void DrawIcon(const wxIcon& icon, const wxRect2DDouble& rect)
    
    912
    +    {
    
    913
    +        DrawIcon(icon, rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    914
    +    }
    
    915
    +
    
    865 916
         //
    
    866 917
         // convenience methods
    
    867 918
         //
    
    ... ... @@ -869,6 +920,11 @@ public:
    869 920
         // strokes a single line
    
    870 921
         virtual void StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2);
    
    871 922
     
    
    923
    +    void StrokeLine(const wxPoint2DDouble& pt1, const wxPoint2DDouble& pt2)
    
    924
    +    {
    
    925
    +        StrokeLine(pt1.m_x, pt1.m_y, pt2.m_x, pt2.m_y);
    
    926
    +    }
    
    927
    +
    
    872 928
         // stroke lines connecting each of the points
    
    873 929
         virtual void StrokeLines( size_t n, const wxPoint2DDouble *points);
    
    874 930
     
    
    ... ... @@ -881,13 +937,26 @@ public:
    881 937
         // draws a rectangle
    
    882 938
         virtual void DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    883 939
     
    
    940
    +    void DrawRectangle(const wxRect2DDouble& rect)
    
    941
    +    {
    
    942
    +        DrawRectangle(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    943
    +    }
    
    944
    +
    
    884 945
         // draws an ellipse
    
    885 946
         virtual void DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    886 947
     
    
    948
    +    void DrawEllipse(const wxRect2DDouble& rect)
    
    949
    +    {
    
    950
    +        DrawEllipse(rect.m_x, rect.m_y, rect.m_width, rect.m_height);
    
    951
    +    }
    
    952
    +
    
    887 953
         // draws a rounded rectangle
    
    888 954
         virtual void DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius);
    
    889 955
     
    
    890
    -     // wrappers using wxPoint2DDouble TODO
    
    956
    +    void DrawRoundedRectangle(const wxRect2DDouble& rect, wxDouble radius)
    
    957
    +    {
    
    958
    +        DrawRoundedRectangle(rect.m_x, rect.m_y, rect.m_width, rect.m_height, radius);
    
    959
    +    }
    
    891 960
     
    
    892 961
         // helper to determine if a 0.5 offset should be applied for the drawing operation
    
    893 962
         virtual bool ShouldOffset() const { return false; }
    

  • interface/wx/graphics.h
    ... ... @@ -126,6 +126,13 @@ public:
    126 126
         */
    
    127 127
         virtual void AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    128 128
     
    
    129
    +    /**
    
    130
    +        @overload
    
    131
    +
    
    132
    +        @since 3.3.0
    
    133
    +    */
    
    134
    +    void AddEllipse(const wxRect2DDouble& rect);
    
    135
    +
    
    129 136
         /**
    
    130 137
             Adds a straight line from the current point to (@a x,@a y).
    
    131 138
             If current point is not yet set before the call to AddLineToPoint(),
    
    ... ... @@ -170,12 +177,26 @@ public:
    170 177
         virtual void AddQuadCurveToPoint(wxDouble cx, wxDouble cy,
    
    171 178
                                          wxDouble x, wxDouble y);
    
    172 179
     
    
    180
    +    /**
    
    181
    +        @overload
    
    182
    +
    
    183
    +        @since 3.3.0
    
    184
    +    */
    
    185
    +    void AddQuadCurveToPoint(const wxPoint2DDouble& cp, const wxPoint2DDouble& e);
    
    186
    +
    
    173 187
         /**
    
    174 188
             Appends a rectangle as a new closed subpath. After this call
    
    175 189
             the current point will be at (@a x, @a y).
    
    176 190
         */
    
    177 191
         virtual void AddRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    178 192
     
    
    193
    +    /**
    
    194
    +        @overload
    
    195
    +
    
    196
    +        @since 3.3.0
    
    197
    +    */
    
    198
    +    void AddRectangle(const wxRect2DDouble& rect);
    
    199
    +
    
    179 200
         /**
    
    180 201
             Appends a rounded rectangle as a new closed subpath.
    
    181 202
             If @a radius equals 0, then this function will behave as AddRectangle();
    
    ... ... @@ -185,6 +206,13 @@ public:
    185 206
         virtual void AddRoundedRectangle(wxDouble x, wxDouble y, wxDouble w,
    
    186 207
                                          wxDouble h, wxDouble radius);
    
    187 208
     
    
    209
    +    /**
    
    210
    +        @overload
    
    211
    +
    
    212
    +        @since 3.3.0
    
    213
    +    */
    
    214
    +    void AddRoundedRectangle(const wxRect2DDouble& rect, wxDouble radius);
    
    215
    +
    
    188 216
         /**
    
    189 217
             Closes the current sub-path. After this call, the current point will be
    
    190 218
             at the joined end point of the sub-path.
    
    ... ... @@ -623,6 +651,13 @@ public:
    623 651
         */
    
    624 652
         virtual void Clip(wxDouble x, wxDouble y, wxDouble w, wxDouble h) = 0;
    
    625 653
     
    
    654
    +    /**
    
    655
    +        @overload
    
    656
    +
    
    657
    +        @since 3.3.0
    
    658
    +    */
    
    659
    +    void Clip(const wxRect2DDouble& rect);
    
    660
    +
    
    626 661
         /**
    
    627 662
             Returns a bounding box of the current clipping region.
    
    628 663
     
    
    ... ... @@ -646,6 +681,13 @@ public:
    646 681
         */
    
    647 682
         virtual void GetClipBox(wxDouble* x, wxDouble* y, wxDouble* w, wxDouble* h) = 0;
    
    648 683
     
    
    684
    +    /**
    
    685
    +        @overload
    
    686
    +
    
    687
    +        @since 3.3.0
    
    688
    +    */
    
    689
    +    wxRect2DDouble GetClipBox();
    
    690
    +
    
    649 691
         /** @}
    
    650 692
         */
    
    651 693
     
    
    ... ... @@ -842,17 +884,38 @@ public:
    842 884
                                 wxDouble x, wxDouble y,
    
    843 885
                                 wxDouble w, wxDouble h) = 0;
    
    844 886
     
    
    887
    +    /**
    
    888
    +        @overload
    
    889
    +
    
    890
    +        @since 3.3.0
    
    891
    +    */
    
    892
    +    void DrawBitmap(const wxGraphicsBitmap& bmp, const wxRect2DDouble& rect);
    
    893
    +
    
    845 894
         /**
    
    846 895
             Draws an ellipse.
    
    847 896
         */
    
    848 897
         virtual void DrawEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    849 898
     
    
    899
    +    /**
    
    900
    +        @overload
    
    901
    +
    
    902
    +        @since 3.3.0
    
    903
    +    */
    
    904
    +    void DrawEllipse(const wxRect2DDouble& rect);
    
    905
    +
    
    850 906
         /**
    
    851 907
             Draws the icon.
    
    852 908
         */
    
    853 909
         virtual void DrawIcon(const wxIcon& icon, wxDouble x, wxDouble y,
    
    854 910
                               wxDouble w, wxDouble h) = 0;
    
    855 911
     
    
    912
    +    /**
    
    913
    +        @overload
    
    914
    +
    
    915
    +        @since 3.3.0
    
    916
    +    */
    
    917
    +    void DrawIcon(const wxIcon& icon, const wxRect2DDouble& rect);
    
    918
    +
    
    856 919
         /**
    
    857 920
             Draws a polygon.
    
    858 921
         */
    
    ... ... @@ -870,17 +933,38 @@ public:
    870 933
         */
    
    871 934
         virtual void DrawRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    872 935
     
    
    936
    +    /**
    
    937
    +        @overload
    
    938
    +
    
    939
    +        @since 3.3.0
    
    940
    +    */
    
    941
    +    void DrawRectangle(const wxRect2DDouble& rect);
    
    942
    +
    
    873 943
         /**
    
    874 944
             Draws a rounded rectangle.
    
    875 945
         */
    
    876 946
         virtual void DrawRoundedRectangle(wxDouble x, wxDouble y, wxDouble w,
    
    877 947
                                           wxDouble h, wxDouble radius);
    
    878 948
     
    
    949
    +    /**
    
    950
    +        @overload
    
    951
    +
    
    952
    +        @since 3.3.0
    
    953
    +    */
    
    954
    +    void DrawRoundedRectangle(const wxRect2DDouble& rect, wxDouble radius);
    
    955
    +
    
    879 956
         /**
    
    880 957
             Draws text at the defined position.
    
    881 958
         */
    
    882 959
         void DrawText(const wxString& str, wxDouble x, wxDouble y);
    
    883 960
     
    
    961
    +    /**
    
    962
    +        @overload
    
    963
    +
    
    964
    +        @since 3.3.0
    
    965
    +    */
    
    966
    +    void DrawText(const wxString& str, const wxPoint2DDouble& pt);
    
    967
    +
    
    884 968
         /**
    
    885 969
             Draws text at the defined position.
    
    886 970
     
    
    ... ... @@ -928,6 +1012,18 @@ public:
    928 1012
         void DrawText(const wxString& str, wxDouble x, wxDouble y,
    
    929 1013
                       wxDouble angle, const wxGraphicsBrush& backgroundBrush);
    
    930 1014
     
    
    1015
    +    /**
    
    1016
    +        Paints a transparent rectangle (only useful for bitmaps or windows).
    
    1017
    +    */
    
    1018
    +    virtual void ClearRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h);
    
    1019
    +
    
    1020
    +    /**
    
    1021
    +        @overload
    
    1022
    +
    
    1023
    +        @since 3.3.0
    
    1024
    +    */
    
    1025
    +    void ClearRectangle(const wxRect2DDouble& rect);
    
    1026
    +
    
    931 1027
         /**
    
    932 1028
             Creates a native graphics path which is initially empty.
    
    933 1029
         */
    
    ... ... @@ -944,6 +1040,13 @@ public:
    944 1040
         */
    
    945 1041
         virtual void StrokeLine(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2);
    
    946 1042
     
    
    1043
    +    /**
    
    1044
    +        @overload
    
    1045
    +
    
    1046
    +        @since 3.3.0
    
    1047
    +    */
    
    1048
    +    void StrokeLine(const wxPoint2DDouble& pt1, const wxPoint2DDouble& pt2);
    
    1049
    +
    
    947 1050
         /**
    
    948 1051
             Stroke disconnected lines from begin to end points, using the
    
    949 1052
             fastest method available.
    
    ... ... @@ -2161,6 +2264,13 @@ public:
    2161 2264
             Translates this matrix.
    
    2162 2265
         */
    
    2163 2266
         virtual void Translate(wxDouble dx, wxDouble dy);
    
    2267
    +
    
    2268
    +    /**
    
    2269
    +        @overload
    
    2270
    +
    
    2271
    +        @since 3.3.0
    
    2272
    +    */
    
    2273
    +    void Translate(const wxPoint2DDouble& pt);
    
    2164 2274
     };
    
    2165 2275
     
    
    2166 2276
     /// An empty wxGraphicsPen object.
    

  • locale/tr.po
    ... ... @@ -10,7 +10,7 @@ msgstr ""
    10 10
     "Project-Id-Version: wxWidgets\n"
    
    11 11
     "Report-Msgid-Bugs-To: \n"
    
    12 12
     "POT-Creation-Date: 2025-05-14 20:23+0200\n"
    
    13
    -"PO-Revision-Date: 2025-03-24 02:03+0300\n"
    
    13
    +"PO-Revision-Date: 2025-05-24 02:24+0300\n"
    
    14 14
     "Last-Translator: Kerim Demirkaynak <ke...@post.com>\n"
    
    15 15
     "Language-Team: Turkish (Turkey) (http://www.transifex.com/klyok/wxwidgets/"
    
    16 16
     "language/tr_TR/)\n"
    
    ... ... @@ -723,7 +723,6 @@ msgid "SPECIAL"
    723 723
     msgstr "SPECIAL"
    
    724 724
     
    
    725 725
     #: ../src/common/accelcmn.cpp:373
    
    726
    -#, fuzzy
    
    727 726
     msgid "Ctrl"
    
    728 727
     msgstr "Ctrl"
    
    729 728
     
    
    ... ... @@ -2216,7 +2215,7 @@ msgstr "DIB başlık bilgisi: Kodlama, bit derinliğine uymuyor."
    2216 2215
     #: ../src/common/imagbmp.cpp:1180
    
    2217 2216
     #, c-format
    
    2218 2217
     msgid "BMP Header: Invalid number of colors (%d)."
    
    2219
    -msgstr ""
    
    2218
    +msgstr "BMP Başlığı: Geçersiz renk sayısı (%d)."
    
    2220 2219
     
    
    2221 2220
     #: ../src/common/imagbmp.cpp:1273
    
    2222 2221
     msgid "Error in reading image DIB."
    
    ... ... @@ -2453,37 +2452,35 @@ msgstr "TIFF: Veri boşaltma hatası."
    2453 2452
     
    
    2454 2453
     #: ../src/common/imagwebp.cpp:56
    
    2455 2454
     msgid "WebP: Invalid data (failed to get features)."
    
    2456
    -msgstr ""
    
    2455
    +msgstr "WebP: Geçersiz veri (özellikler alınamadı)."
    
    2457 2456
     
    
    2458 2457
     #: ../src/common/imagwebp.cpp:65
    
    2459 2458
     msgid "WebP: Allocating image memory failed."
    
    2460
    -msgstr ""
    
    2459
    +msgstr "WebP: Görüntü belleği ayrılamadı."
    
    2461 2460
     
    
    2462 2461
     #: ../src/common/imagwebp.cpp:82
    
    2463 2462
     msgid "WebP: Decoding RGBA image data failed."
    
    2464
    -msgstr ""
    
    2463
    +msgstr "WebP: RGBA görüntü verisi çözülemedi."
    
    2465 2464
     
    
    2466 2465
     #: ../src/common/imagwebp.cpp:98
    
    2467 2466
     msgid "WebP: Decoding RGB image data failed."
    
    2468
    -msgstr ""
    
    2467
    +msgstr "WebP: RGB görüntü verisi çözülemedi."
    
    2469 2468
     
    
    2470 2469
     #: ../src/common/imagwebp.cpp:113 ../src/common/imagwebp.cpp:201
    
    2471 2470
     msgid "WebP: Allocating stream buffer failed."
    
    2472
    -msgstr ""
    
    2471
    +msgstr "WebP: Akış arabelleği ayrılamadı."
    
    2473 2472
     
    
    2474 2473
     #: ../src/common/imagwebp.cpp:131
    
    2475
    -#, fuzzy
    
    2476 2474
     msgid "WebP: Failed to parse container data."
    
    2477
    -msgstr "Pano verisi ayarlanamadı."
    
    2475
    +msgstr "WebP: Konteyner verisi çözümlenemedi."
    
    2478 2476
     
    
    2479 2477
     #: ../src/common/imagwebp.cpp:222
    
    2480
    -#, fuzzy
    
    2481 2478
     msgid "WebP: Error decoding animation."
    
    2482
    -msgstr "Ayarlar okunurken sorun çıktı."
    
    2479
    +msgstr "WebP: Animasyonun çözülmesinde hata oluştu."
    
    2483 2480
     
    
    2484 2481
     #: ../src/common/imagwebp.cpp:240
    
    2485 2482
     msgid "WebP: Error getting next animation frame."
    
    2486
    -msgstr ""
    
    2483
    +msgstr "WebP: Sonraki animasyon karesi alınırken hata oluştu."
    
    2487 2484
     
    
    2488 2485
     #: ../src/common/init.cpp:172
    
    2489 2486
     #, c-format
    
    ... ... @@ -3990,14 +3987,12 @@ msgid "Failed to set proxy \"%s\": %s"
    3990 3987
     msgstr "\"%s\" proxy'si ayarlanamadı: %s"
    
    3991 3988
     
    
    3992 3989
     #: ../src/common/webview_chromium.cpp:989
    
    3993
    -#, fuzzy
    
    3994 3990
     msgid ""
    
    3995 3991
     "Chromium can't be used because libcef.so wasn't loaded early enough; please "
    
    3996 3992
     "relink the application or use LD_PRELOAD to load it earlier."
    
    3997 3993
     msgstr ""
    
    3998
    -"Chromium, libcef.so dosyası yeterince erken yüklenmediği için kullanılamaz; "
    
    3999
    -"lütfen uygulamayı yeniden bağlayın veya LD_PRELOAD kullanarak daha erken "
    
    4000
    -"yüklenmesini sağlayın."
    
    3994
    +"Chromium kullanılamıyor çünkü libcef.so yeterince erken yüklenemedi; lütfen "
    
    3995
    +"uygulamayı yeniden bağlayın ya da LD_PRELOAD kullanarak daha erken yükleyin."
    
    4001 3996
     
    
    4002 3997
     #: ../src/common/webview_chromium.cpp:1108
    
    4003 3998
     msgid "Could not initialize Chromium"
    
    ... ... @@ -5256,31 +5251,30 @@ msgid "MDI child"
    5256 5251
     msgstr "MDI alt"
    
    5257 5252
     
    
    5258 5253
     #: ../src/gtk/power.cpp:188
    
    5259
    -#, fuzzy, c-format
    
    5254
    +#, c-format
    
    5260 5255
     msgid "Failed to open D-Bus connection to the login manager: %s"
    
    5261
    -msgstr "'%s' sunucusuna '%s' konusundan bağlantı kurulamadı"
    
    5256
    +msgstr "Giriş yöneticisine D-Bus bağlantısı açılamadı: %s"
    
    5262 5257
     
    
    5263 5258
     #: ../src/gtk/power.cpp:214
    
    5264
    -#, fuzzy
    
    5265 5259
     msgid "wxWidgets application"
    
    5266
    -msgstr "Uygulamayı gizle"
    
    5260
    +msgstr "wxWidgets uygulaması"
    
    5267 5261
     
    
    5268 5262
     #: ../src/gtk/power.cpp:226
    
    5269 5263
     msgid "Application needs to keep running"
    
    5270
    -msgstr ""
    
    5264
    +msgstr "Uygulamanın çalışmaya devam etmesi gerekiyor."
    
    5271 5265
     
    
    5272 5266
     #: ../src/gtk/power.cpp:233
    
    5273 5267
     msgid "Clean up before suspend"
    
    5274
    -msgstr ""
    
    5268
    +msgstr "Kapanmadan önce temizle"
    
    5275 5269
     
    
    5276 5270
     #: ../src/gtk/power.cpp:259
    
    5277
    -#, fuzzy, c-format
    
    5271
    +#, c-format
    
    5278 5272
     msgid "Failed to inhibit sleep: %s"
    
    5279
    -msgstr "Çevirmeli bağlantı başlatılamadı: %s"
    
    5273
    +msgstr "Uyku engellenemedi: %s"
    
    5280 5274
     
    
    5281 5275
     #: ../src/gtk/power.cpp:265
    
    5282 5276
     msgid "Unexpected response to D-Bus \"Inhibit\" request."
    
    5283
    -msgstr ""
    
    5277
    +msgstr "D-Bus ‘Inhibit’ isteğine beklenmeyen yanıt alındı."
    
    5284 5278
     
    
    5285 5279
     #: ../src/gtk/print.cpp:218
    
    5286 5280
     msgid "Custom size"
    
    ... ... @@ -7070,7 +7064,7 @@ msgstr "Bir dosya seçin"
    7070 7064
     
    
    7071 7065
     #: ../src/qt/mdi.cpp:254
    
    7072 7066
     msgid "&Tile"
    
    7073
    -msgstr ""
    
    7067
    +msgstr "&Döşeme"
    
    7074 7068
     
    
    7075 7069
     #: ../src/richtext/richtextbackgroundpage.cpp:147
    
    7076 7070
     #: ../src/richtext/richtextformatdlg.cpp:376
    

  • src/msw/graphics.cpp
    ... ... @@ -92,7 +92,7 @@ StringFormat* gs_drawTextStringFormat = nullptr;
    92 92
     // Get the string format used for the text drawing and measuring functions:
    
    93 93
     // notice that it must be the same one for all of them, otherwise the drawn
    
    94 94
     // text might be of different size than what measuring it returned.
    
    95
    -inline StringFormat* GetDrawTextStringFormat()
    
    95
    +inline StringFormat* GetDrawTextStringFormat(wxLayoutDirection dir = wxLayout_Default)
    
    96 96
     {
    
    97 97
         if ( !gs_drawTextStringFormat )
    
    98 98
         {
    
    ... ... @@ -100,11 +100,13 @@ inline StringFormat* GetDrawTextStringFormat()
    100 100
     
    
    101 101
             // This doesn't make any difference for DrawText() actually but we want
    
    102 102
             // this behaviour when measuring text.
    
    103
    -        gs_drawTextStringFormat->SetFormatFlags
    
    104
    -        (
    
    105
    -            gs_drawTextStringFormat->GetFormatFlags()
    
    106
    -                | StringFormatFlagsMeasureTrailingSpaces
    
    107
    -        );
    
    103
    +        auto flags = gs_drawTextStringFormat->GetFormatFlags()
    
    104
    +                   | StringFormatFlagsMeasureTrailingSpaces;
    
    105
    +
    
    106
    +        if ( dir == wxLayout_RightToLeft )
    
    107
    +            flags |= StringFormatFlagsDirectionRightToLeft;
    
    108
    +
    
    109
    +        gs_drawTextStringFormat->SetFormatFlags(flags);
    
    108 110
         }
    
    109 111
     
    
    110 112
         return gs_drawTextStringFormat;
    
    ... ... @@ -481,6 +483,8 @@ public:
    481 483
     
    
    482 484
         Graphics* GetGraphics() const { return m_context; }
    
    483 485
     
    
    486
    +    bool IsRTL() const { return m_layoutDir == wxLayout_RightToLeft; }
    
    487
    +
    
    484 488
         virtual WXHDC GetNativeHDC() override;
    
    485 489
         virtual void ReleaseNativeHDC(WXHDC hdc) override;
    
    486 490
     
    
    ... ... @@ -501,6 +505,7 @@ private:
    501 505
         GraphicsState m_state2;
    
    502 506
         Matrix* m_internalTransform;
    
    503 507
         Matrix* m_internalTransformInv;
    
    508
    +    wxLayoutDirection m_layoutDir = wxLayout_Default;
    
    504 509
     
    
    505 510
         wxDECLARE_NO_COPY_CLASS(wxGDIPlusContext);
    
    506 511
     };
    
    ... ... @@ -566,6 +571,36 @@ public:
    566 571
         void GetDPI(wxDouble* dpiX, wxDouble* dpiY) const override;
    
    567 572
     };
    
    568 573
     
    
    574
    +// Helper class to disable mirroring the DC in RTL layout for correct
    
    575
    +// rendering, e.g. text shouldn't be mirrored.
    
    576
    +class wxDCMirrorDisabler
    
    577
    +{
    
    578
    +public:
    
    579
    +    wxDCMirrorDisabler(wxGDIPlusContext* ctx, wxDouble x)
    
    580
    +        : m_ctx(ctx)
    
    581
    +    {
    
    582
    +        if ( m_ctx->IsRTL() )
    
    583
    +        {
    
    584
    +            m_ctx->PushState();
    
    585
    +            m_ctx->Translate(2*x, 0);
    
    586
    +            m_ctx->Scale(-1, 1);
    
    587
    +        }
    
    588
    +    }
    
    589
    +
    
    590
    +    ~wxDCMirrorDisabler()
    
    591
    +    {
    
    592
    +        if ( m_ctx->IsRTL() )
    
    593
    +        {
    
    594
    +            m_ctx->PopState();
    
    595
    +        }
    
    596
    +    }
    
    597
    +
    
    598
    +private:
    
    599
    +    wxGDIPlusContext* const m_ctx;
    
    600
    +
    
    601
    +    wxDECLARE_NO_COPY_CLASS(wxDCMirrorDisabler);
    
    602
    +};
    
    603
    +
    
    569 604
     //-----------------------------------------------------------------------------
    
    570 605
     // wxGDIPlusRenderer declaration
    
    571 606
     //-----------------------------------------------------------------------------
    
    ... ... @@ -1868,12 +1903,14 @@ public :
    1868 1903
     
    
    1869 1904
     wxGDIPlusContext::wxGDIPlusContext( wxGraphicsRenderer* renderer, HDC hdc, wxDouble width, wxDouble height   )
    
    1870 1905
         : wxGraphicsContext(renderer)
    
    1906
    +    , m_layoutDir((::GetLayout(hdc) & LAYOUT_RTL) ? wxLayout_RightToLeft : wxLayout_LeftToRight)
    
    1871 1907
     {
    
    1872 1908
         Init(new Graphics(hdc), width, height);
    
    1873 1909
     }
    
    1874 1910
     
    
    1875 1911
     wxGDIPlusContext::wxGDIPlusContext( wxGraphicsRenderer* renderer, const wxDC& dc )
    
    1876 1912
         : wxGraphicsContext(renderer, dc.GetWindow())
    
    1913
    +    , m_layoutDir(dc.GetLayoutDirection())
    
    1877 1914
     {
    
    1878 1915
         HDC hdc = (HDC) dc.GetHDC();
    
    1879 1916
         wxSize sz = dc.GetSize();
    
    ... ... @@ -1900,6 +1937,8 @@ wxGDIPlusContext::wxGDIPlusContext( wxGraphicsRenderer* renderer,
    1900 1937
                                         HWND hwnd,
    
    1901 1938
                                         wxWindow* window )
    
    1902 1939
         : wxGraphicsContext(renderer, window)
    
    1940
    +    , m_layoutDir((::GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL) ? wxLayout_RightToLeft
    
    1941
    +                                                                         : wxLayout_LeftToRight)
    
    1903 1942
     {
    
    1904 1943
         RECT rect = wxGetWindowRect(hwnd);
    
    1905 1944
         Init(new Graphics(hwnd), rect.right - rect.left, rect.bottom - rect.top);
    
    ... ... @@ -1929,6 +1968,12 @@ void wxGDIPlusContext::Init(Graphics* graphics, int width, int height, const Mat
    1929 1968
         m_height = height;
    
    1930 1969
         m_internalTransform = new Matrix();
    
    1931 1970
     
    
    1971
    +    if ( m_layoutDir == wxLayout_RightToLeft )
    
    1972
    +    {
    
    1973
    +        m_context->ScaleTransform(-1, 1);
    
    1974
    +        m_context->TranslateTransform(-width, 0);
    
    1975
    +    }
    
    1976
    +
    
    1932 1977
         m_context->SetTextRenderingHint(TextRenderingHintSystemDefault);
    
    1933 1978
         m_context->SetPixelOffsetMode(PixelOffsetModeHalf);
    
    1934 1979
         m_context->SetSmoothingMode(SmoothingModeHighQuality);
    
    ... ... @@ -2353,13 +2398,17 @@ void wxGDIPlusContext::DoDrawText(const wxString& str,
    2353 2398
         wxGDIPlusFontData * const
    
    2354 2399
             fontData = (wxGDIPlusFontData *)m_font.GetRefData();
    
    2355 2400
     
    
    2401
    +
    
    2402
    +    // Text is not mirrored in RTL layout
    
    2403
    +    wxDCMirrorDisabler disableMirror(this, x);
    
    2404
    +
    
    2356 2405
         m_context->DrawString
    
    2357 2406
                    (
    
    2358 2407
                         str.wc_str(),           // string to draw, always Unicode
    
    2359 2408
                         -1,                     // length: string is NUL-terminated
    
    2360 2409
                         fontData->GetGDIPlusFont(),
    
    2361 2410
                         PointF(x, y),
    
    2362
    -                    GetDrawTextStringFormat(),
    
    2411
    +                    GetDrawTextStringFormat(m_layoutDir),
    
    2363 2412
                         fontData->GetGDIPlusBrush()
    
    2364 2413
                    );
    
    2365 2414
     }
    
    ... ... @@ -2424,7 +2473,8 @@ void wxGDIPlusContext::GetTextExtent( const wxString &str, wxDouble *width, wxDo
    2424 2473
             RectF layoutRect(0,0, 100000.0f, 100000.0f);
    
    2425 2474
     
    
    2426 2475
             RectF bounds ;
    
    2427
    -        m_context->MeasureString((const wchar_t *) s , wcslen(s) , f, layoutRect, GetDrawTextStringFormat(), &bounds ) ;
    
    2476
    +        m_context->MeasureString((const wchar_t *) s , wcslen(s) , f, layoutRect,
    
    2477
    +            GetDrawTextStringFormat(m_layoutDir), &bounds ) ;
    
    2428 2478
             if ( width )
    
    2429 2479
                 *width = bounds.Width;
    
    2430 2480
             if ( height )
    
    ... ... @@ -2448,7 +2498,7 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble
    2448 2498
         wxASSERT_MSG(text.length() == len , wxT("GetPartialTextExtents not yet implemented for multichar situations"));
    
    2449 2499
     
    
    2450 2500
         RectF layoutRect(0,0, 100000.0f, 100000.0f);
    
    2451
    -    StringFormat strFormat( GetDrawTextStringFormat() );
    
    2501
    +    StringFormat strFormat( GetDrawTextStringFormat(m_layoutDir) );
    
    2452 2502
     
    
    2453 2503
         size_t startPosition = 0;
    
    2454 2504
         size_t remainder = len;
    

Reply all
Reply to author
Forward
0 new messages