feat:implementacion grafica 2.0

This commit is contained in:
25030248hasel
2026-05-22 18:51:55 -06:00
33 changed files with 851 additions and 0 deletions

View File

@@ -1,10 +1,18 @@
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
<<<<<<< HEAD
project(flutter_application_1 LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "flutter_application_1")
=======
project(recoleccion_residuos LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "recoleccion_residuos")
>>>>>>> ffb5bdb346bb7ba0556931b52a489d47eca0d902
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.

View File

@@ -90,12 +90,21 @@ BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "com.example" "\0"
<<<<<<< HEAD
VALUE "FileDescription", "flutter_application_1" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "flutter_application_1" "\0"
VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "flutter_application_1.exe" "\0"
VALUE "ProductName", "flutter_application_1" "\0"
=======
VALUE "FileDescription", "recoleccion_residuos" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "recoleccion_residuos" "\0"
VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "recoleccion_residuos.exe" "\0"
VALUE "ProductName", "recoleccion_residuos" "\0"
>>>>>>> ffb5bdb346bb7ba0556931b52a489d47eca0d902
VALUE "ProductVersion", VERSION_AS_STRING "\0"
END
END

View File

@@ -27,7 +27,11 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
<<<<<<< HEAD
if (!window.Create(L"flutter_application_1", origin, size)) {
=======
if (!window.Create(L"recoleccion_residuos", origin, size)) {
>>>>>>> ffb5bdb346bb7ba0556931b52a489d47eca0d902
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);

View File

@@ -45,6 +45,7 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
if (utf16_string == nullptr) {
return std::string();
}
<<<<<<< HEAD
unsigned int target_length = ::WideCharToMultiByte(
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
-1, nullptr, 0, nullptr, nullptr)
@@ -52,6 +53,19 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
int input_length = (int)wcslen(utf16_string);
std::string utf8_string;
if (target_length == 0 || target_length > utf8_string.max_size()) {
=======
// First, find the length of the string with a safe upper bound (CWE-126).
// UNICODE_STRING_MAX_CHARS (32767) is the maximum length of a UNICODE_STRING.
int input_length = static_cast<int>(wcsnlen(utf16_string, UNICODE_STRING_MAX_CHARS));
// Now use that bounded length to determine the required buffer size.
// When an explicit length is passed, WideCharToMultiByte does not include
// the null terminator in its returned size.
int target_length = ::WideCharToMultiByte(
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
input_length, nullptr, 0, nullptr, nullptr);
std::string utf8_string;
if (target_length == 0 || static_cast<size_t>(target_length) > utf8_string.max_size()) {
>>>>>>> ffb5bdb346bb7ba0556931b52a489d47eca0d902
return utf8_string;
}
utf8_string.resize(target_length);