hello world
This commit is contained in:
parent
4fef70020b
commit
6f85110b9b
8 changed files with 63 additions and 37 deletions
BIN
.genio
Normal file
BIN
.genio
Normal file
Binary file not shown.
26
App.cpp
Normal file
26
App.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "App.h"
|
||||
#include <Application.h>
|
||||
#include <Rect.h>
|
||||
#include <Window.h>
|
||||
#include <String.h>
|
||||
#include <StringView.h>
|
||||
|
||||
App::App(void) : BApplication("application/x-vnd.dw-MyFirstApp")
|
||||
{
|
||||
BRect frame(100, 100, 500, 400);
|
||||
BWindow *myWindow = new BWindow(frame, "Hello World!", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE);
|
||||
frame.Set(10,10,11,11);
|
||||
BStringView *label = new BStringView(frame, "hello world", "idk wat dis do");
|
||||
label->SetResizingMode
|
||||
myWindow->AddChild(label);
|
||||
myWindow->Show();
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
App *app = new App();
|
||||
app->Run();
|
||||
|
||||
delete app;
|
||||
return 0;
|
||||
}
|
13
App.h
Normal file
13
App.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef APP_H
|
||||
#define APP_H
|
||||
|
||||
#include <Application.h>
|
||||
|
||||
class App : public BApplication
|
||||
{
|
||||
public:
|
||||
App(void);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
3
Jamfile
3
Jamfile
|
@ -1,3 +0,0 @@
|
|||
Binary = Renga ;
|
||||
Compiler = GCC ;
|
||||
|
9
Makefile
9
Makefile
|
@ -1,16 +1,9 @@
|
|||
BINARY=renga
|
||||
CPP=g++
|
||||
HOST=192.168.122.254
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
$(CPP) src/main.cpp -o $(BINARY)
|
||||
|
||||
run:
|
||||
@echo "tranferring over all files..."
|
||||
@scp -r ./* user@$(HOST):~/dev
|
||||
@echo "executing on remote host..."
|
||||
ssh user@$(HOST) "cd dev;echo '### compiling';make;echo '### running';./renga"
|
||||
$(CPP) App.cpp -o $(BINARY) -lbe
|
||||
|
||||
|
||||
|
|
20
README.md
20
README.md
|
@ -1,22 +1,18 @@
|
|||
# Renga
|
||||
|
||||
Renga, a XMPP client designed for Haiku
|
||||
|
||||
## todo
|
||||
Renga, a XMPP client designed for Haiku
|
||||
## Todo
|
||||
|
||||
- [x] make haiku-os compatible
|
||||
- [ ] everything else
|
||||
## Test Rengo
|
||||
|
||||
## run
|
||||
|
||||
To run on a Linux system, spin up a HaikuOS development VM and get its IP address reachable from the host.
|
||||
Execute the following command on the host:
|
||||
```bash
|
||||
make run HOST=1.1.1.1
|
||||
```
|
||||
|
||||
If you are doing development work on the local system, use:
|
||||
If you are doing development work on a local Haiku system, use:
|
||||
```bash
|
||||
make build
|
||||
./renga
|
||||
```
|
||||
|
||||
## Editor
|
||||
|
||||
My preferred editor is Vim, as such, I have placed an example of a vimrc file you can use to get autocomplete and allat on Haiku working. Just copy it to ~/config/settings/vim.
|
||||
|
|
15
examples/vimrc
Normal file
15
examples/vimrc
Normal file
|
@ -0,0 +1,15 @@
|
|||
" Plugin directory is optional
|
||||
call plug#begin()
|
||||
|
||||
" Declare the list of plugins.
|
||||
Plug 'prabirshrestha/vim-lsp'
|
||||
Plug 'mattn/vim-lsp-settings'
|
||||
|
||||
Plug 'prabirshrestha/asyncomplete.vim'
|
||||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||
|
||||
" List ends here. Plugins become visible to Vim after this call.
|
||||
call plug#end()
|
||||
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
set backspace=2
|
14
src/main.cpp
14
src/main.cpp
|
@ -1,14 +0,0 @@
|
|||
#include "iostream"
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
#include <string>
|
||||
|
||||
int main() {
|
||||
std::string msg = "hello world";
|
||||
for (int i = 0; i < msg.length(); i++) {
|
||||
std::cout << msg[i];
|
||||
if (i != msg.length() - 1 && msg[i+1] != ' ' && msg[i] != ' ')
|
||||
std::cout << '-';
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue