From 6be1aad043f5d277fc502aa6e73b6755a46de594 Mon Sep 17 00:00:00 2001 From: Santiago Lema Date: Sun, 29 Sep 2024 17:58:05 -0300 Subject: [PATCH] added some files --- .genio | Bin 0 -> 666 bytes .gitignore | 1 + App.cpp | 52 ++++++++++++++++++++ App.h | 24 ++++++++++ DumBer | Bin 0 -> 38494 bytes MainWindow.cpp | 120 ++++++++++++++++++++++++++++++++++++++++++++++ MainWindow.h | 27 +++++++++++ Makefile | 127 +++++++++++++++++++++++++++++++++++++++++++++++++ Resources.rdef | 39 +++++++++++++++ 9 files changed, 390 insertions(+) create mode 100644 .genio create mode 100644 .gitignore create mode 100644 App.cpp create mode 100644 App.h create mode 100755 DumBer create mode 100644 MainWindow.cpp create mode 100644 MainWindow.h create mode 100644 Makefile create mode 100644 Resources.rdef diff --git a/.genio b/.genio new file mode 100644 index 0000000000000000000000000000000000000000..c6ad6d246dd040669db4ffdecb0eabcfa0c53fd0 GIT binary patch literal 666 zcmZ{g%}#?*5QPWvzcIS-FaE_BaM6uBH`t1cR+6gg8wz8Ca>3j};tTjJK9Y~4XD${M z!XzhQ&V0 + * All rights reserved. Distributed under the terms of the MIT license. + */ + + +#include "App.h" +#include "MainWindow.h" + +#include +#include + +#undef B_TRANSLATION_CONTEXT +#define B_TRANSLATION_CONTEXT "Application" + +const char* kApplicationSignature = "application/x-vnd.SLema-DumBer"; + + +App::App() + : + BApplication(kApplicationSignature) +{ + MainWindow* mainWindow = new MainWindow(); + mainWindow->Show(); +} + + +App::~App() +{ +} + + +void +App::AboutRequested() +{ + BAboutWindow* about + = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME("DumBer"), kApplicationSignature); + about->AddDescription(B_TRANSLATE("Type text in there to feel dumber.")); + about->AddCopyright(2024, "Santiago Lema"); + about->AddText("Ho"); + about->Show(); +} + + +int +main() +{ + App* app = new App(); + app->Run(); + delete app; + return 0; +} diff --git a/App.h b/App.h new file mode 100644 index 0000000..ef868fa --- /dev/null +++ b/App.h @@ -0,0 +1,24 @@ +/* + * Copyright 2024, My Name + * All rights reserved. Distributed under the terms of the MIT license. + */ +#ifndef APP_H +#define APP_H + + +#include + + +class App : public BApplication +{ +public: + App(); + virtual ~App(); + + virtual void AboutRequested(); + +private: +}; + +#endif // APP_H + diff --git a/DumBer b/DumBer new file mode 100755 index 0000000000000000000000000000000000000000..59299f2e99d236f2af8865f03a803e9b8fc88498 GIT binary patch literal 38494 zcmeHw3w%`7x$mAN6ViYrQjv%c0*Hc-G!tIo*-TzcAcTPgj0#SMWb%L{Go4IA@XfA&;qSQyJNG={I>hjg2w!(j1vC^JRdgd^_q*+)nq)rYNei z`(KH*WFgC;YBQgmK5D{-q9jX!n*BAz4q_0lMtlHq2(b@Q>7Rsa3Ktu~32+OWFi_lf3>cXhdFyA&PCE8)%%|qlIGHd16!|Z7 zNSo$>5p;#b3pD8*F5(QX&$jWzUSh*C8J~yiQp8G$oex?fujSGrxYZIPQp2tn>&~kabO41FWGZ90Q_ee@4S6(+txUWKSaGcM*K z(i*f9u?+Dn#7&5oB3_0_VYx}Lk{ZSedHqFDA7U3`zr^m6^g7U65GNqsi5Ng^K|EDx z%{AriGNgNgG1e#~10qObcrXY_zdca>r`bX9e}S>58lN?e$qw4%GKKyFlg&xbTS%sI zM`Y)IR_e?~J|}sy5y`84hWe92hNfLb&~vsi$!L-tl4FV+_hFzp>F+})IpMTUO)$n8 zKT-usJu@}+?9=E!2ZP;dPJE1tIhBj1I^sV^`DEu(TCfpDq@C-a-$~DhkRiM6mUf;l zav8>J+0OD4ggs$rTHFv+zbu0xob>P4^zXwO{1Hui$7u9dYV7=5^w(6(rUz*9A-GLq z9MagoQ)8bSH1%nNKBxX#rRkRgkarr-Q?V#J*=@XN*I472?3b5i{eOqW+ev;NCY}?% zT_gV}7CR^TOig=(8arRAv0I+T&f{P-r*eIodVU)n=Oq6=>_+4KkX%m+qVvY3%$B&HB)$8Mn2X`Sl}>p5tOXf7U3J^IEmnrI|;+ z*VL2FBh#c!IN6~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Vs;)AA@!?NL`+nM*}ssdtK9-#=51ebF+)DC|+7tRlB(Mvc)rUvrMk6gs#d;OsuTL zOwY|MEnmEHab<4ywDM^UCF_^2URqYPFgMHON^0n;q{hTbYRvT9?4{*P8|v0yz$ug`Up212~6 z1)o({BlInukb4%!ey-ulE|@s#nslp?C9aK$u1UA!+T|K! + * All rights reserved. Distributed under the terms of the MIT license. + */ + + +#include "MainWindow.h" + +#include +#include +#include +#include +#include +#include + +#include + +#undef B_TRANSLATION_CONTEXT +#define B_TRANSLATION_CONTEXT "Window" + +static const uint32 kMsgNewFile = 'fnew'; +static const uint32 kMsgOpenFile = 'fopn'; +static const uint32 kMsgSaveFile = 'fsav'; + +static const uint32 kSendPrompt = 'kspt'; + + +MainWindow::MainWindow() + : + BWindow(BRect(100, 100, 500, 400), B_TRANSLATE("BeDumb"), B_TITLED_WINDOW, + B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE) +{ + BMenuBar* menuBar = _BuildMenu(); + + BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + .Add(menuBar) + .AddGlue() + .End(); + +BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + .AddGroup(B_HORIZONTAL, 0) +// .Add(new BTextControl("Input 1", "Label 1", "Default text")) +// .Add(new BButton("Go", new BMessage(kSendPrompt)) + .End() + // .Add(new BTextView("Text View", new BRect(0, 0, 10, 10), B_FOLLOW_ALL_SIDES, B_WILL_DRAW)) + .SetInsets(5, 5, 5, 5) +.End(); + + +} + + +MainWindow::~MainWindow() +{ +} + + +void +MainWindow::MessageReceived(BMessage* message) +{ + switch (message->what) { + case kMsgNewFile: + { + fSaveMenuItem->SetEnabled(false); + printf("New\n"); + } break; + + case kMsgOpenFile: + { + fSaveMenuItem->SetEnabled(true); + printf("Open\n"); + } break; + + case kMsgSaveFile: + { + printf("Save\n"); + } break; + + default: + { + BWindow::MessageReceived(message); + break; + } + } +} + + +BMenuBar* +MainWindow::_BuildMenu() +{ + BMenuBar* menuBar = new BMenuBar("menubar"); + BMenu* menu; + BMenuItem* item; + + // menu 'File' + menu = new BMenu(B_TRANSLATE("File")); + + item = new BMenuItem(B_TRANSLATE("New"), new BMessage(kMsgNewFile), 'N'); + menu->AddItem(item); + + item = new BMenuItem(B_TRANSLATE("Open" B_UTF8_ELLIPSIS), new BMessage(kMsgOpenFile), 'O'); + menu->AddItem(item); + + fSaveMenuItem = new BMenuItem(B_TRANSLATE("Save"), new BMessage(kMsgSaveFile), 'S'); + fSaveMenuItem->SetEnabled(false); + menu->AddItem(fSaveMenuItem); + + menu->AddSeparatorItem(); + + item = new BMenuItem(B_TRANSLATE("About" B_UTF8_ELLIPSIS), new BMessage(B_ABOUT_REQUESTED)); + item->SetTarget(be_app); + menu->AddItem(item); + + item = new BMenuItem(B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED), 'Q'); + menu->AddItem(item); + + menuBar->AddItem(menu); + + return menuBar; +} diff --git a/MainWindow.h b/MainWindow.h new file mode 100644 index 0000000..a775010 --- /dev/null +++ b/MainWindow.h @@ -0,0 +1,27 @@ +/* + * Copyright 2024, My Name + * All rights reserved. Distributed under the terms of the MIT license. + */ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + + +#include +#include + + +class MainWindow : public BWindow +{ +public: + MainWindow(); + virtual ~MainWindow(); + + virtual void MessageReceived(BMessage* msg); + +private: + BMenuBar* _BuildMenu(); + + BMenuItem* fSaveMenuItem; +}; + +#endif diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a67ade3 --- /dev/null +++ b/Makefile @@ -0,0 +1,127 @@ +## Haiku Generic Makefile v2.6 ## + +## Fill in this file to specify the project being created, and the referenced +## Makefile-Engine will do all of the hard work for you. This handles any +## architecture of Haiku. + +# The name of the binary. +NAME = DumBer +TARGET_DIR = . + +# The type of binary, must be one of: +# APP: Application +# SHARED: Shared library or add-on +# STATIC: Static library archive +# DRIVER: Kernel driver +TYPE = APP + +# If you plan to use localization, specify the application's MIME signature. +APP_MIME_SIG = application/x-vnd.SLema-DumBer + +# The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are +# so that Pe and Eddie can fill them in for you. +#%{ +# @src->@ + +# Specify the source files to use. Full paths or paths relative to the +# Makefile can be included. All files, regardless of directory, will have +# their object files created in the common object directory. Note that this +# means this Makefile will not work correctly if two source files with the +# same name (source.c or source.cpp) are included from different directories. +# Also note that spaces in folder names do not work well with this Makefile. +SRCS = App.cpp \ + MainWindow.cpp + +# Specify the resource definition files to use. Full or relative paths can be +# used. +RDEFS = Resources.rdef + +# Specify the resource files to use. Full or relative paths can be used. +# Both RDEFS and RSRCS can be utilized in the same Makefile. +RSRCS = + +# End Pe/Eddie support. +# @<-src@ +#%} + +# Specify libraries to link against. +# There are two acceptable forms of library specifications: +# - if your library follows the naming pattern of libXXX.so or libXXX.a, +# you can simply specify XXX for the library. (e.g. the entry for +# "libtracker.so" would be "tracker") +# +# - for GCC-independent linking of standard C++ libraries, you can use +# $(STDCPPLIBS) instead of the raw "stdc++[.r4] [supc++]" library names. +# +# - if your library does not follow the standard library naming scheme, +# you need to specify the path to the library and it's name. +# (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a") + +LIBS = be localestub $(STDCPPLIBS) + +# Specify additional paths to directories following the standard libXXX.so +# or libXXX.a naming scheme. You can specify full paths or paths relative +# to the Makefile. The paths included are not parsed recursively, so +# include all of the paths where libraries must be found. Directories where +# source files were specified are automatically included. +LIBPATHS = + +# Additional paths to look for system headers. These use the form +# "#include
". Directories that contain the files in SRCS are +# NOT auto-included here. +SYSTEM_INCLUDE_PATHS = $(shell findpaths -e B_FIND_PATH_HEADERS_DIRECTORY private/interface) + +# Additional paths paths to look for local headers. These use the form +# #include "header". Directories that contain the files in SRCS are +# automatically included. +LOCAL_INCLUDE_PATHS = + +# Specify the level of optimization that you want. Specify either NONE (O0), +# SOME (O1), FULL (O2), or leave blank (for the default optimization level). +OPTIMIZE := + +# Specify the codes for languages you are going to support in this +# application. The default "en" one must be provided too. "make catkeys" +# will recreate only the "locales/en.catkeys" file. Use it as a template +# for creating catkeys for other languages. All localization files must be +# placed in the "locales" subdirectory. + +LOCALES = + +# Specify all the preprocessor symbols to be defined. The symbols will not +# have their values set automatically; you must supply the value (if any) to +# use. For example, setting DEFINES to "DEBUG=1" will cause the compiler +# option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass +# "-DDEBUG" on the compiler's command line. +DEFINES = + +# Specify the warning level. Either NONE (suppress all warnings), +# ALL (enable all warnings), or leave blank (enable default warnings). +WARNINGS = + +# With image symbols, stack crawls in the debugger are meaningful. +# If set to "TRUE", symbols will be created. +SYMBOLS := + +# Includes debug information, which allows the binary to be debugged easily. +# If set to "TRUE", debug info will be created. +DEBUGGER := + +# Specify any additional compiler flags to be used. +COMPILER_FLAGS = + +# Specify any additional linker flags to be used. +LINKER_FLAGS = + +# (Only used when "TYPE" is "DRIVER"). Specify the desired driver install +# location in the /dev hierarchy. Example: +# DRIVER_PATH = video/usb +# will instruct the "driverinstall" rule to place a symlink to your driver's +# binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will +# appear at /dev/video/usb when loaded. The default is "misc". +DRIVER_PATH = + +## Include the Makefile-Engine +DEVEL_DIRECTORY := \ + $(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY) +include $(DEVEL_DIRECTORY)/etc/makefile-engine diff --git a/Resources.rdef b/Resources.rdef new file mode 100644 index 0000000..8168d64 --- /dev/null +++ b/Resources.rdef @@ -0,0 +1,39 @@ +resource app_signature "application/x-vnd.MyName-MyApp"; + +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = 1, + middle = 0, + minor = 0, + + /* 0 = development 1 = alpha 2 = beta + 3 = gamma 4 = golden master 5 = final */ + variety = 5, + + internal = 0, + + short_info = "A short description", + long_info = "A little bit longer description of the app." +}; + +resource vector_icon { + $"6E6369660E0500020006023C43C6B9E5E23A85A83CEE414268F44A445900BDE2" + $"B7FF40A63503E86B06020006023B2B47BB18653D0FA53D225148297046CA1900" + $"FFEC4BFFF0A506020006023B3049396B0ABA90833C646E4A101543299500FFFF" + $"FFFFFFF289020006023C71E33A0C78BA15E43C7D2149055549455700D1FACBFF" + $"76CB6803FF9803020006023A1DA6393F04BBB5BC3C6B074AEA3648091100F99B" + $"05FFFCB23D03587C46020006023C0AE63B3927BC611E3D03FF4C25624A1A9600" + $"B03C03FFBB560503BE53050307610203DE6706040174100A08325E395E41564E" + $"5E555E6052584E3E510A06302C303E40454C3C4C2A3C250A04302C303E404540" + $"320A04302C40324C2A3C250A04403240454C3C4C2A0A0338423C4D3C440A0622" + $"422254325C3E513E402E3A0A0422422254325C32490A04224232493E402E3A0A" + $"043249325C3E513E400A063E423E544E5C5A505A3F4A390A06C785BF40C354C2" + $"764E495A3F4A39C391BD6F0A043E42C354C276C785BF40C391BD6F0A054151C0" + $"8BC8834E5C4E49C35DC27A0A053E423E54C08BC8834151C35DC27A0A044E494E" + $"5C5A505A3E120A0D0100000A0001061815FF01178400040A0001061800150117" + $"8600040A010107000A080109000A0B01052020210A050108000A00010A100117" + $"8400040A02010D000A0A010E000A0902040F000A06010B000A0C010C000A0001" + $"011815FF01178400040A00010118001501178600040A030102000A040103000A" + $"07010400" +};