Skip to content

Commit

Permalink
flutter: Rename dir flutter to flutter_app
Browse files Browse the repository at this point in the history
  • Loading branch information
calcitem committed Feb 17, 2021
1 parent c43509b commit ac95e9c
Show file tree
Hide file tree
Showing 145 changed files with 1,853 additions and 1,905 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: flutter --version

- name: Install dependencies
run: cd src/ui/flutter; flutter pub get; flutter pub global activate intl_utils; flutter --no-color pub global run intl_utils:generate
run: cd src/ui/flutter_app; flutter pub get; flutter pub global activate intl_utils; flutter --no-color pub global run intl_utils:generate

# Uncomment this step to verify the use of 'dart format' on each commit.
# - name: Verify formatting
Expand All @@ -50,11 +50,11 @@ jobs:

# Build
- name: Build apk
run: cd src/ui/flutter; flutter build apk
run: cd src/ui/flutter_app; flutter build apk

# Archive
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: sanmill-flutter-apk-release
path: src/ui/flutter/build/app/outputs/flutter-apk/app-release.apk
path: src/ui/flutter_app/build/app/outputs/flutter-apk/app-release.apk
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This distribution of Sanmill consists of the following files:

* src, a subdirectory containing the full source code, including a Makefile that can be used to compile Sanmill CUI on Unix-like systems.

* src/ui/flutter, a subdirectory containing a Flutter frontend.
* src/ui/flutter_app, a subdirectory containing a Flutter frontend.

* src/ui/qt, a subdirectory containing a Qt frontend.

Expand Down
2 changes: 1 addition & 1 deletion flutter-init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

cd src/ui/flutter
cd src/ui/flutter_app
flutter pub get
flutter pub global activate intl_utils
flutter --no-color pub global run intl_utils:generate
52 changes: 0 additions & 52 deletions src/ui/flutter/android/app/CMakeLists.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
108 changes: 54 additions & 54 deletions src/ui/flutter/command/base.h → src/ui/flutter_app/command/base.h
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
/*
This file is part of Sanmill.
Copyright (C) 2019-2021 The Sanmill developers (see AUTHORS file)
Sanmill is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Sanmill is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef BASE2_H
#define BASE2_H

#ifdef _WIN32
#include <windows.h>
#else
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#endif
#include <string.h>

#include <android/log.h>

#ifdef _WIN32

inline void Idle(void) {
Sleep(1);
}

#else

inline void Idle(void) {
usleep(1000);
}
#endif

#define LOG_TAG "MillEngine"

#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__)

#endif
/*
This file is part of Sanmill.
Copyright (C) 2019-2021 The Sanmill developers (see AUTHORS file)
Sanmill is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Sanmill is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef BASE2_H
#define BASE2_H

#ifdef _WIN32
#include <windows.h>
#else
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>
#endif
#include <string.h>

#include <android/log.h>

#ifdef _WIN32

inline void Idle(void) {
Sleep(1);
}

#else

inline void Idle(void) {
usleep(1000);
}
#endif

#define LOG_TAG "MillEngine"

#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
#define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__)

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
/*
This file is part of Sanmill.
Copyright (C) 2019-2021 The Sanmill developers (see AUTHORS file)
Sanmill is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Sanmill is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <stdarg.h>
#include <iostream>

#include "base.h"
#include "command_channel.h"

extern int main(int argc, char* argv[]) ;

void println(const char *str, ...) {

va_list args;

va_start(args, str);

char buffer[256] = {0};
vsnprintf(buffer, 256, str, args);

va_end(args);

CommandChannel *channel = CommandChannel::getInstance();

LOGD("println: %s\n", buffer);

while (!channel->pushResponse(buffer)) {
Idle();
}
}

int engineMain(void)
{
return main(1, 0);
}
/*
This file is part of Sanmill.
Copyright (C) 2019-2021 The Sanmill developers (see AUTHORS file)
Sanmill is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Sanmill is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdio.h>
#include <stdarg.h>
#include <iostream>

#include "base.h"
#include "command_channel.h"

extern int main(int argc, char* argv[]) ;

void println(const char *str, ...) {

va_list args;

va_start(args, str);

char buffer[256] = {0};
vsnprintf(buffer, 256, str, args);

va_end(args);

CommandChannel *channel = CommandChannel::getInstance();

LOGD("println: %s\n", buffer);

while (!channel->pushResponse(buffer)) {
Idle();
}
}

int engineMain(void)
{
return main(1, 0);
}
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ac95e9c

Please sign in to comment.