Skip to content

Commit

Permalink
Update stb_image; add help/about to gtk-ide; update version
Browse files Browse the repository at this point in the history
  • Loading branch information
eantcal committed Jun 29, 2017
1 parent 7143a7a commit d00b444
Show file tree
Hide file tree
Showing 10 changed files with 7,404 additions and 7,126 deletions.
20 changes: 10 additions & 10 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for nubasic 1.47.
# Generated by GNU Autoconf 2.69 for nubasic 1.48.
#
# Report bugs to <acaldmail@gmail.com>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='nubasic'
PACKAGE_TARNAME='nubasic'
PACKAGE_VERSION='1.47'
PACKAGE_STRING='nubasic 1.47'
PACKAGE_VERSION='1.48'
PACKAGE_STRING='nubasic 1.48'
PACKAGE_BUGREPORT='acaldmail@gmail.com'
PACKAGE_URL=''

Expand Down Expand Up @@ -1316,7 +1316,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures nubasic 1.47 to adapt to many kinds of systems.
\`configure' configures nubasic 1.48 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1387,7 +1387,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of nubasic 1.47:";;
short | recursive ) echo "Configuration of nubasic 1.48:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1498,7 +1498,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
nubasic configure 1.47
nubasic configure 1.48
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1959,7 +1959,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by nubasic $as_me 1.47, which was
It was created by nubasic $as_me 1.48, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2822,7 +2822,7 @@ fi
# Define the identity of the package.
PACKAGE='nubasic'
VERSION='1.47'
VERSION='1.48'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -6487,7 +6487,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by nubasic $as_me 1.47, which was
This file was extended by nubasic $as_me 1.48, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -6553,7 +6553,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
nubasic config.status 1.47
nubasic config.status 1.48
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([nubasic], [1.47], [acaldmail@gmail.com])
AC_INIT([nubasic], [1.48], [acaldmail@gmail.com])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([main.cc])
AC_CONFIG_HEADERS([config.h])
Expand Down
105 changes: 104 additions & 1 deletion ide/gtk/nubasicide.cc
Expand Up @@ -28,7 +28,6 @@
#include "nu_terminal_frame.h"
#include "nu_about.h"
#include "nu_builtin_help.h"
#include "nu_builtin_help.h"
#include "nu_exception.h"
#include "nu_interpreter.h"
#include "nu_reserved_keywords.h"
Expand Down Expand Up @@ -852,6 +851,15 @@ struct app_t : public nu::dialog_search_t::observer_t {
toolbar.add_stock_item(GTK_STOCK_FIND_AND_REPLACE, "Replace", window, run_replace_dlg, id++);

toolbar.add_separator( id ++ );

toolbar.add_stock_item(GTK_STOCK_DIALOG_INFO, "Describe", window,
[] { get_instance().show_ctx_help(); }, id++);

toolbar.add_stock_item(GTK_STOCK_DIALOG_QUESTION, "Help-online", window,
[] { get_instance().show_online_help(); }, id++);

toolbar.add_separator( id ++ );

toolbar.add_stock_item(GTK_STOCK_ZOOM_IN, "Zoom in", window,
[]{get_instance().editor().cmd(SCI_ZOOMIN);}, id++);

Expand Down Expand Up @@ -1416,6 +1424,43 @@ struct app_t : public nu::dialog_search_t::observer_t {
}


/* ---------------------------------------------------------------------- */

static void make_help_menu(
nu::window_t & window,
nu::menubar_t & menubar,
nu::accelgroup_t& accelgroup)
{
nu::menu_t menu("Help", menubar, accelgroup);

menu.add_item(
window, "Describe selected keyword",
[](){
get_instance().show_ctx_help();
}, false);

menu.add_separator();

menu.add_stock_item(
window,
GTK_STOCK_HELP, []{ get_instance().show_online_help(); }
);

menu.add_separator();

menu.add_item(
window, "About",
[](){
nu::dialog_about_t dlg(
nu::about::progname,
nu::about::version,
nu::about::author,
nu::about::license,
nu::about::description);
}, false);
}


/* ---------------------------------------------------------------------- */

void stop_debugging() noexcept {
Expand Down Expand Up @@ -2101,6 +2146,63 @@ struct app_t : public nu::dialog_search_t::observer_t {
}


/* -------------------------------------------------------------------------- */

void show_ctx_help() {
auto & ed = editor();
std::string sel = ed.get_selection();

if (sel.empty() || sel[0] == '\0') {
ed.cmd(SCI_ANNOTATIONCLEARALL);
return;
}

if (sel.size() <= 32) {
auto help_text = nu::builtin_help_t::get_instance().help(sel);

if (!help_text.empty()) {
ed.cmd(SCI_ANNOTATIONCLEARALL);
ed.cmd(SCI_ANNOTATIONSETVISIBLE, ANNOTATION_BOXED);
ed.cmd(SCI_ANNOTATIONSETSTYLE, ed.get_current_line() - 1, SCE_B_PREPROCESSOR);
ed.cmd(SCI_ANNOTATIONSETTEXT, ed.get_current_line() - 1, help_text.c_str());
}
}
}


/* -------------------------------------------------------------------------- */

void show_online_help() {
auto & ed = editor();

std::string selection = ed.get_selection();

std::string online_help_url = nu::about::homepage;

// Selection can contain string with '\0' chars ... empty() method
// returns false, but we have to consider selection empty as well
if (strlen(selection.c_str()) > 0) {
online_help_url += "/system/app/pages/search?scope=search-site&q=";
online_help_url += selection.c_str();
}

std::replace(online_help_url.begin(), online_help_url.end(), ' ', '+');
std::replace(online_help_url.begin(), online_help_url.end(), '\t', '+');
std::replace(online_help_url.begin(), online_help_url.end(), '\n', '+');
std::replace(online_help_url.begin(), online_help_url.end(), '\r', '+');

online_help_url = "xdg-open \"" + online_help_url + "\"";

std::cerr << online_help_url << std::endl;

if (0 != system(online_help_url.c_str())) {
const char* msg = "Error loading Interet Browser";

nu::msgbox(mainwin(), msg, "Error");
}
}


/* ---------------------------------------------------------------------- */

app_t(int argc, char* argv[]) {
Expand Down Expand Up @@ -2161,6 +2263,7 @@ struct app_t : public nu::dialog_search_t::observer_t {
make_settings_menu(mainwindow, mb, accelgroup);
_menu_debug_ptr = make_debug_menu(mainwindow, mb, accelgroup);
make_search_menu(mainwindow, mb, accelgroup);
make_help_menu(mainwindow, mb, accelgroup);

make_toolbar(mainwindow, vbox);

Expand Down
6 changes: 3 additions & 3 deletions include/nu_about.h
Expand Up @@ -34,14 +34,14 @@ namespace about {
static const char* const author = "Antonino Calderone";
static const char* const contacts = PACKAGE_BUGREPORT;
static const char* const homepage = "http://www.nubasic.eu";
static const char* const license = "GNU General Public License v2.0";
static const char* const license = "The MIT License (MIT)";
static const char* const version = PACKAGE_VERSION;
static const char* const copyright = "2014-2017";
static const char* const description
= "nuBASIC is a programming language from the BASIC family.\n"
"nuBASIC is developed in C++11 and distributed under GPLv2 License."
"nuBASIC is developed in C++ and distributed under GPLv2 License."
#ifdef TINY_NUBASIC_VER
"\nThis version of nuBASIC is 'lite' and does not include \n"
"\nThis version of nuBASIC does not include \n"
"any graphics, sound, mouse or windows manager support."
#endif
;
Expand Down

0 comments on commit d00b444

Please sign in to comment.