Fix bad includes.

Add very hacky and basic overflow support.
This commit is contained in:
Martín Lucas Golini
2026-05-01 19:06:36 -03:00
parent e765160a44
commit d54fd398f6
12 changed files with 4018 additions and 39 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
#ifndef EEPP_NETWORK_HPP
#define EEPP_NETWORK_HPP
#include <eepp/network/cookiemanager.hpp>
#include <eepp/network/ftp.hpp>
#include <eepp/network/http.hpp>
#include <eepp/network/ipaddress.hpp>

View File

@@ -4,6 +4,7 @@
#include <eepp/ui/abstract/uiabstracttableview.hpp>
#include <eepp/ui/abstract/uiabstractview.hpp>
#include <eepp/ui/base.hpp>
#include <eepp/ui/blocklayouter.hpp>
#include <eepp/ui/border.hpp>
#include <eepp/ui/colorschemepreferences.hpp>
#include <eepp/ui/css/animationdefinition.hpp>
@@ -29,6 +30,7 @@
#include <eepp/ui/css/stylesheetvariable.hpp>
#include <eepp/ui/css/timingfunction.hpp>
#include <eepp/ui/css/transitiondefinition.hpp>
#include <eepp/ui/csslayouttypes.hpp>
#include <eepp/ui/doc/documentview.hpp>
#include <eepp/ui/doc/foldrangeservice.hpp>
#include <eepp/ui/doc/foldrangetype.hpp>
@@ -45,10 +47,8 @@
#include <eepp/ui/doc/textposition.hpp>
#include <eepp/ui/doc/textrange.hpp>
#include <eepp/ui/doc/textundostack.hpp>
#include <eepp/ui/htmlinput.hpp>
#include <eepp/ui/htmltextarea.hpp>
#include <eepp/ui/htmltextinput.hpp>
#include <eepp/ui/iconmanager.hpp>
#include <eepp/ui/inlinelayouter.hpp>
#include <eepp/ui/keyboardshortcut.hpp>
#include <eepp/ui/models/csspropertiesmodel.hpp>
#include <eepp/ui/models/filesystemmodel.hpp>
@@ -64,7 +64,9 @@
#include <eepp/ui/models/variant.hpp>
#include <eepp/ui/models/widgettreemodel.hpp>
#include <eepp/ui/mouseshortcut.hpp>
#include <eepp/ui/nonelayouter.hpp>
#include <eepp/ui/splitdirection.hpp>
#include <eepp/ui/tablelayouter.hpp>
#include <eepp/ui/tools/htmlformatter.hpp>
#include <eepp/ui/tools/textureatlaseditor.hpp>
#include <eepp/ui/tools/uiaudioplayer.hpp>
@@ -91,13 +93,22 @@
#include <eepp/ui/uifontstyleconfig.hpp>
#include <eepp/ui/uigridlayout.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uihtmlform.hpp>
#include <eepp/ui/uihtmlimage.hpp>
#include <eepp/ui/uihtmlinput.hpp>
#include <eepp/ui/uihtmllistitem.hpp>
#include <eepp/ui/uihtmltable.hpp>
#include <eepp/ui/uihtmltextarea.hpp>
#include <eepp/ui/uihtmltextinput.hpp>
#include <eepp/ui/uihtmlwidget.hpp>
#include <eepp/ui/uiicon.hpp>
#include <eepp/ui/uiicontheme.hpp>
#include <eepp/ui/uiiconthememanager.hpp>
#include <eepp/ui/uiimage.hpp>
#include <eepp/ui/uiitemcontainer.hpp>
#include <eepp/ui/uilayout.hpp>
#include <eepp/ui/uilayouter.hpp>
#include <eepp/ui/uilayoutermanager.hpp>
#include <eepp/ui/uilinearlayout.hpp>
#include <eepp/ui/uilistbox.hpp>
#include <eepp/ui/uilistboxitem.hpp>
@@ -140,6 +151,7 @@
#include <eepp/ui/uistackwidget.hpp>
#include <eepp/ui/uistate.hpp>
#include <eepp/ui/uistyle.hpp>
#include <eepp/ui/uisvg.hpp>
#include <eepp/ui/uitab.hpp>
#include <eepp/ui/uitablecell.hpp>
#include <eepp/ui/uitableheadercolumn.hpp>
@@ -148,6 +160,7 @@
#include <eepp/ui/uitabwidget.hpp>
#include <eepp/ui/uitextedit.hpp>
#include <eepp/ui/uitextinput.hpp>
#include <eepp/ui/uitextnode.hpp>
#include <eepp/ui/uitextspan.hpp>
#include <eepp/ui/uitextureregion.hpp>
#include <eepp/ui/uitextview.hpp>

View File

@@ -254,6 +254,7 @@ enum class PropertyId : Uint32 {
Action = String::hash( "action" ),
Method = String::hash( "method" ),
Enctype = String::hash( "enctype" ),
Overflow = String::hash( "overflow" ),
};
enum class PropertyType : Uint32 {

View File

@@ -5,11 +5,11 @@
namespace EE { namespace UI {
class EE_API HTMLTextInput : public UITextInput {
class EE_API UIHTMLTextInput : public UITextInput {
public:
static HTMLTextInput* New();
static UIHTMLTextInput* New();
HTMLTextInput();
UIHTMLTextInput();
virtual Uint32 getType() const;
@@ -33,7 +33,7 @@ class EE_API HTMLTextInput : public UITextInput {
void setHtmlSize( Uint32 size );
protected:
HTMLTextInput( const std::string& tag );
UIHTMLTextInput( const std::string& tag );
Uint32 mHtmlSize{ 20 };
bool mPacking{ false };

View File

@@ -784,13 +784,7 @@ Image::Image( const Uint8* imageData, const unsigned int& imageDataSize,
} else if ( webp_test_from_memory( imageData, imageDataSize ) ) {
webpLoad( imageData, imageDataSize );
} else {
std::string reason = ".";
if ( NULL != stbi_failure_reason() ) {
reason = ", reason: " + std::string( stbi_failure_reason() );
}
Log::error( "Failed to load image from memory. Reason: %s", reason.c_str() );
Log::error( "Failed to load image from memory. Reason: %s", stbi_failure_reason() );
}
}
@@ -1438,7 +1432,7 @@ Graphics::Image* Image::copy() {
}
Graphics::Image& Image::operator=( const Image& right ) {
if (this == &right)
if ( this == &right )
return *this;
mWidth = right.mWidth;

View File

@@ -171,6 +171,11 @@ void StyleSheetSpecification::registerDefaultProperties() {
registerProperty( "layout-to-top-of", "" ).addAlias( "layout_to_top_of" );
registerProperty( "layout-to-bottom-of", "" ).addAlias( "layout_to_bottom_of" );
registerProperty( "clip", "" ).setType( PropertyType::String );
// TODO: layer implement overflow-x and overflow-y properly
registerProperty( "overflow", "visible" )
.addAlias( "overflow-x" )
.addAlias( "overflow-y" )
.setType( PropertyType::String );
registerProperty( "rotation", "" ).addAlias( "rotate" ).setType( PropertyType::NumberFloat );
registerProperty( "scale", "" ).setType( PropertyType::Vector2 );
registerProperty( "rotation-origin-point-x", "50%" )

View File

@@ -1,8 +1,8 @@
#include <eepp/ui/css/propertydefinition.hpp>
#include <eepp/ui/htmltextinput.hpp>
#include <eepp/ui/uicheckbox.hpp>
#include <eepp/ui/uihelper.hpp>
#include <eepp/ui/uihtmlinput.hpp>
#include <eepp/ui/uihtmltextinput.hpp>
#include <eepp/ui/uipushbutton.hpp>
#include <eepp/ui/uiradiobutton.hpp>
#include <eepp/ui/uispinbox.hpp>
@@ -126,11 +126,11 @@ void UIHTMLInput::createChildWidget() {
} else if ( mInputType == "number" ) {
mChildWidget = UISpinBox::New();
} else if ( mInputType == "password" ) {
mChildWidget = HTMLTextInput::New()->setMode( UITextInput::TextInputMode::Password );
mChildWidget = UIHTMLTextInput::New()->setMode( UITextInput::TextInputMode::Password );
} else if ( mInputType == "radio" ) {
mChildWidget = UIRadioButton::New();
} else {
mChildWidget = HTMLTextInput::New();
mChildWidget = UIHTMLTextInput::New();
}
if ( mChildWidget == nullptr )

View File

@@ -1,17 +1,17 @@
#include <eepp/graphics/font.hpp>
#include <eepp/ui/css/propertydefinition.hpp>
#include <eepp/ui/htmltextinput.hpp>
#include <eepp/ui/uihtmltextinput.hpp>
#include <eepp/ui/uistyle.hpp>
namespace EE { namespace UI {
HTMLTextInput* HTMLTextInput::New() {
return eeNew( HTMLTextInput, () );
UIHTMLTextInput* UIHTMLTextInput::New() {
return eeNew( UIHTMLTextInput, () );
}
HTMLTextInput::HTMLTextInput() : HTMLTextInput( "textinput" ) {}
UIHTMLTextInput::UIHTMLTextInput() : UIHTMLTextInput( "textinput" ) {}
HTMLTextInput::HTMLTextInput( const std::string& tag ) : UITextInput( tag ) {
UIHTMLTextInput::UIHTMLTextInput( const std::string& tag ) : UITextInput( tag ) {
mHtmlSize = 20;
mWidthPolicy = SizePolicy::WrapContent;
mHeightPolicy = SizePolicy::WrapContent;
@@ -19,15 +19,15 @@ HTMLTextInput::HTMLTextInput( const std::string& tag ) : UITextInput( tag ) {
onAutoSize();
}
Uint32 HTMLTextInput::getType() const {
Uint32 UIHTMLTextInput::getType() const {
return UI_TYPE_HTML_TEXTINPUT;
}
bool HTMLTextInput::isType( const Uint32& type ) const {
return HTMLTextInput::getType() == type || UITextInput::isType( type );
bool UIHTMLTextInput::isType( const Uint32& type ) const {
return UIHTMLTextInput::getType() == type || UITextInput::isType( type );
}
bool HTMLTextInput::applyProperty( const StyleSheetProperty& attribute ) {
bool UIHTMLTextInput::applyProperty( const StyleSheetProperty& attribute ) {
if ( !attribute.getPropertyDefinition() )
return false;
@@ -42,8 +42,8 @@ bool HTMLTextInput::applyProperty( const StyleSheetProperty& attribute ) {
return UITextInput::applyProperty( attribute );
}
std::string HTMLTextInput::getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& propertyIndex ) const {
std::string UIHTMLTextInput::getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& propertyIndex ) const {
if ( !propertyDef )
return "";
@@ -57,13 +57,13 @@ std::string HTMLTextInput::getPropertyString( const PropertyDefinition* property
return UITextInput::getPropertyString( propertyDef, propertyIndex );
}
std::vector<PropertyId> HTMLTextInput::getPropertiesImplemented() const {
std::vector<PropertyId> UIHTMLTextInput::getPropertiesImplemented() const {
auto props = UITextInput::getPropertiesImplemented();
props.push_back( PropertyId::Size );
return props;
}
Float HTMLTextInput::getMinIntrinsicWidth() const {
Float UIHTMLTextInput::getMinIntrinsicWidth() const {
if ( mHtmlSize > 0 && getFont() ) {
Float advance = getFont()->getGlyph( 'M', getFontSize(), false, false ).advance;
return mHtmlSize * advance + mPaddingPx.Left + mPaddingPx.Right;
@@ -71,11 +71,11 @@ Float HTMLTextInput::getMinIntrinsicWidth() const {
return UITextInput::getMinIntrinsicWidth();
}
Float HTMLTextInput::getMaxIntrinsicWidth() const {
Float UIHTMLTextInput::getMaxIntrinsicWidth() const {
return getMinIntrinsicWidth();
}
void HTMLTextInput::onAutoSize() {
void UIHTMLTextInput::onAutoSize() {
if ( mPacking )
return;
mPacking = true;
@@ -92,11 +92,11 @@ void HTMLTextInput::onAutoSize() {
mPacking = false;
}
Uint32 HTMLTextInput::getHtmlSize() const {
Uint32 UIHTMLTextInput::getHtmlSize() const {
return mHtmlSize;
}
void HTMLTextInput::setHtmlSize( Uint32 size ) {
void UIHTMLTextInput::setHtmlSize( Uint32 size ) {
if ( mHtmlSize != size ) {
mHtmlSize = size;
invalidateIntrinsicSize();

View File

@@ -2213,6 +2213,15 @@ bool UIWidget::applyProperty( const StyleSheetProperty& attribute ) {
case PropertyId::Clip:
setClipType( UIClip::fromString( attribute.asString() ) );
break;
case PropertyId::Overflow: {
std::string val = attribute.asString();
String::toLowerInPlace( val );
if ( val == "hidden" || val == "auto" || val == "scroll" )
setClipType( ClipType::ContentBox );
else
setClipType( ClipType::None );
break;
}
case PropertyId::Rotation:
setRotation( attribute.asFloat() );
break;

View File

@@ -9,13 +9,13 @@
#include <eepp/system/sys.hpp>
#include <eepp/ui/css/stylesheetparser.hpp>
#include <eepp/ui/css/stylesheetspecification.hpp>
#include <eepp/ui/htmltextinput.hpp>
#include <eepp/ui/tools/htmlformatter.hpp>
#include <eepp/ui/tools/uiwidgetinspector.hpp>
#include <eepp/ui/uicheckbox.hpp>
#include <eepp/ui/uihtmlinput.hpp>
#include <eepp/ui/uihtmltable.hpp>
#include <eepp/ui/uihtmltextarea.hpp>
#include <eepp/ui/uihtmltextinput.hpp>
#include <eepp/ui/uiscenenode.hpp>
#include <eepp/ui/uitextspan.hpp>
#include <eepp/ui/uithememanager.hpp>
@@ -401,9 +401,9 @@ UTEST( UIHTMLInput, sizeAttribute ) {
ASSERT_TRUE( cm != nullptr );
ASSERT_TRUE( cc != nullptr );
auto i1 = c1->getChildWidget()->asType<HTMLTextInput>();
auto i2 = c2->getChildWidget()->asType<HTMLTextInput>();
auto i3 = c3->getChildWidget()->asType<HTMLTextInput>();
auto i1 = c1->getChildWidget()->asType<UIHTMLTextInput>();
auto i2 = c2->getChildWidget()->asType<UIHTMLTextInput>();
auto i3 = c3->getChildWidget()->asType<UIHTMLTextInput>();
ASSERT_TRUE( i1 != nullptr );
ASSERT_TRUE( i2 != nullptr );