Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
anjuta
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
anjuta
Commits
655dc05b
Commit
655dc05b
authored
Sep 28, 2009
by
Maxim Ermilov
Committed by
Johannes Schmid
Dec 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add JavaScript support.
parent
81718042
Changes
96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
96 changed files
with
20180 additions
and
1489 deletions
+20180
-1489
configure.in
configure.in
+12
-0
plugins/Makefile.am
plugins/Makefile.am
+3
-1
plugins/js-debugger/Makefile.am
plugins/js-debugger/Makefile.am
+48
-0
plugins/js-debugger/debugger-js.c
plugins/js-debugger/debugger-js.c
+797
-0
plugins/js-debugger/debugger-js.h
plugins/js-debugger/debugger-js.h
+73
-0
plugins/js-debugger/debugger-server.c
plugins/js-debugger/debugger-server.c
+276
-0
plugins/js-debugger/debugger-server.h
plugins/js-debugger/debugger-server.h
+60
-0
plugins/js-debugger/js_debugger.plugin.in
plugins/js-debugger/js_debugger.plugin.in
+10
-0
plugins/js-debugger/js_debugger.png
plugins/js-debugger/js_debugger.png
+0
-0
plugins/js-debugger/plugin.c
plugins/js-debugger/plugin.c
+672
-0
plugins/js-debugger/plugin.h
plugins/js-debugger/plugin.h
+40
-0
plugins/language-manager/languages.xml
plugins/language-manager/languages.xml
+1
-0
plugins/language-support-js/Makefile.am
plugins/language-support-js/Makefile.am
+67
-0
plugins/language-support-js/anjuta-language-javascript.ui
plugins/language-support-js/anjuta-language-javascript.ui
+218
-0
plugins/language-support-js/anjuta-language-javascript.xml
plugins/language-support-js/anjuta-language-javascript.xml
+10
-0
plugins/language-support-js/code-completion.c
plugins/language-support-js/code-completion.c
+241
-0
plugins/language-support-js/code-completion.h
plugins/language-support-js/code-completion.h
+32
-0
plugins/language-support-js/database-symbol.c
plugins/language-support-js/database-symbol.c
+294
-0
plugins/language-support-js/database-symbol.h
plugins/language-support-js/database-symbol.h
+57
-0
plugins/language-support-js/db-anjuta-symbol.c
plugins/language-support-js/db-anjuta-symbol.c
+237
-0
plugins/language-support-js/db-anjuta-symbol.h
plugins/language-support-js/db-anjuta-symbol.h
+54
-0
plugins/language-support-js/dir-symbol.c
plugins/language-support-js/dir-symbol.c
+294
-0
plugins/language-support-js/dir-symbol.h
plugins/language-support-js/dir-symbol.h
+55
-0
plugins/language-support-js/gi-symbol.c
plugins/language-support-js/gi-symbol.c
+222
-0
plugins/language-support-js/gi-symbol.h
plugins/language-support-js/gi-symbol.h
+53
-0
plugins/language-support-js/gir-symbol.c
plugins/language-support-js/gir-symbol.c
+368
-0
plugins/language-support-js/gir-symbol.h
plugins/language-support-js/gir-symbol.h
+53
-0
plugins/language-support-js/ijs-symbol.c
plugins/language-support-js/ijs-symbol.c
+206
-0
plugins/language-support-js/ijs-symbol.h
plugins/language-support-js/ijs-symbol.h
+70
-0
plugins/language-support-js/import-symbol.c
plugins/language-support-js/import-symbol.c
+226
-0
plugins/language-support-js/import-symbol.h
plugins/language-support-js/import-symbol.h
+54
-0
plugins/language-support-js/js-context.c
plugins/language-support-js/js-context.c
+1
-0
plugins/language-support-js/js-context.h
plugins/language-support-js/js-context.h
+1
-0
plugins/language-support-js/js-node.c
plugins/language-support-js/js-node.c
+1
-0
plugins/language-support-js/js-node.h
plugins/language-support-js/js-node.h
+1
-0
plugins/language-support-js/js_support_plugin.plugin.in
plugins/language-support-js/js_support_plugin.plugin.in
+7
-0
plugins/language-support-js/js_support_plugin.png
plugins/language-support-js/js_support_plugin.png
+0
-0
plugins/language-support-js/jsparse.c
plugins/language-support-js/jsparse.c
+1
-0
plugins/language-support-js/jsparse.h
plugins/language-support-js/jsparse.h
+1
-0
plugins/language-support-js/jstypes.h
plugins/language-support-js/jstypes.h
+1
-0
plugins/language-support-js/lex.yy.c
plugins/language-support-js/lex.yy.c
+1
-0
plugins/language-support-js/lex.yy.h
plugins/language-support-js/lex.yy.h
+1
-0
plugins/language-support-js/local-symbol.c
plugins/language-support-js/local-symbol.c
+227
-0
plugins/language-support-js/local-symbol.h
plugins/language-support-js/local-symbol.h
+54
-0
plugins/language-support-js/node-symbol.c
plugins/language-support-js/node-symbol.c
+240
-0
plugins/language-support-js/node-symbol.h
plugins/language-support-js/node-symbol.h
+54
-0
plugins/language-support-js/plugin.c
plugins/language-support-js/plugin.c
+625
-0
plugins/language-support-js/plugin.h
plugins/language-support-js/plugin.h
+48
-0
plugins/language-support-js/simple-symbol.c
plugins/language-support-js/simple-symbol.c
+157
-0
plugins/language-support-js/simple-symbol.h
plugins/language-support-js/simple-symbol.h
+60
-0
plugins/language-support-js/std-symbol.c
plugins/language-support-js/std-symbol.c
+243
-0
plugins/language-support-js/std-symbol.h
plugins/language-support-js/std-symbol.h
+54
-0
plugins/language-support-js/unit_test/Makefile.am
plugins/language-support-js/unit_test/Makefile.am
+15
-0
plugins/language-support-js/unit_test/Makefile.decl
plugins/language-support-js/unit_test/Makefile.decl
+61
-0
plugins/language-support-js/unit_test/test.c
plugins/language-support-js/unit_test/test.c
+179
-0
plugins/language-support-js/unit_test/u1.js
plugins/language-support-js/unit_test/u1.js
+31
-0
plugins/language-support-js/unit_test/u2.js
plugins/language-support-js/unit_test/u2.js
+13
-0
plugins/language-support-js/unit_test/u3.js
plugins/language-support-js/unit_test/u3.js
+14
-0
plugins/language-support-js/unit_test/u4.js
plugins/language-support-js/unit_test/u4.js
+8
-0
plugins/language-support-js/unit_test/u5.js
plugins/language-support-js/unit_test/u5.js
+5
-0
plugins/language-support-js/unit_test/u6.js
plugins/language-support-js/unit_test/u6.js
+8
-0
plugins/language-support-js/util.c
plugins/language-support-js/util.c
+258
-0
plugins/language-support-js/util.h
plugins/language-support-js/util.h
+55
-0
plugins/language-support-js/y.tab.c
plugins/language-support-js/y.tab.c
+1
-0
plugins/language-support-js/y.tab.h
plugins/language-support-js/y.tab.h
+1
-0
plugins/project-wizard/templates/Makefile.am
plugins/project-wizard/templates/Makefile.am
+2
-1
plugins/project-wizard/templates/js.wiz
plugins/project-wizard/templates/js.wiz
+56
-0
plugins/project-wizard/templates/js_minimal/Makefile.am
plugins/project-wizard/templates/js_minimal/Makefile.am
+10
-0
plugins/project-wizard/templates/js_minimal/Makefile.am.tpl
plugins/project-wizard/templates/js_minimal/Makefile.am.tpl
+9
-0
plugins/project-wizard/templates/js_minimal/autogen.sh
plugins/project-wizard/templates/js_minimal/autogen.sh
+160
-0
plugins/project-wizard/templates/js_minimal/configure.ac.tpl
plugins/project-wizard/templates/js_minimal/configure.ac.tpl
+62
-0
plugins/project-wizard/templates/js_minimal/project.anjuta
plugins/project-wizard/templates/js_minimal/project.anjuta
+37
-0
plugins/project-wizard/templates/js_minimal/src/Makefile.am
plugins/project-wizard/templates/js_minimal/src/Makefile.am
+3
-0
plugins/project-wizard/templates/js_minimal/src/Makefile.am.tpl
...s/project-wizard/templates/js_minimal/src/Makefile.am.tpl
+38
-0
plugins/project-wizard/templates/js_minimal/src/debug.c
plugins/project-wizard/templates/js_minimal/src/debug.c
+521
-0
plugins/project-wizard/templates/js_minimal/src/debug.h
plugins/project-wizard/templates/js_minimal/src/debug.h
+22
-0
plugins/project-wizard/templates/js_minimal/src/main.c
plugins/project-wizard/templates/js_minimal/src/main.c
+46
-0
plugins/project-wizard/templates/js_minimal/src/main.js
plugins/project-wizard/templates/js_minimal/src/main.js
+5
-0
plugins/project-wizard/templates/translatable-strings.h
plugins/project-wizard/templates/translatable-strings.h
+8
-0
plugins/symbol-db/anjuta-tags/Makefile.am
plugins/symbol-db/anjuta-tags/Makefile.am
+32
-5
plugins/symbol-db/anjuta-tags/gir.c
plugins/symbol-db/anjuta-tags/gir.c
+234
-0
plugins/symbol-db/anjuta-tags/jscript.c
plugins/symbol-db/anjuta-tags/jscript.c
+256
-1482
plugins/symbol-db/anjuta-tags/parser/Grammar.y
plugins/symbol-db/anjuta-tags/parser/Grammar.y
+1193
-0
plugins/symbol-db/anjuta-tags/parser/js-context.c
plugins/symbol-db/anjuta-tags/parser/js-context.c
+626
-0
plugins/symbol-db/anjuta-tags/parser/js-context.h
plugins/symbol-db/anjuta-tags/parser/js-context.h
+92
-0
plugins/symbol-db/anjuta-tags/parser/js-node.c
plugins/symbol-db/anjuta-tags/parser/js-node.c
+199
-0
plugins/symbol-db/anjuta-tags/parser/js-node.h
plugins/symbol-db/anjuta-tags/parser/js-node.h
+90
-0
plugins/symbol-db/anjuta-tags/parser/jsparse.c
plugins/symbol-db/anjuta-tags/parser/jsparse.c
+147
-0
plugins/symbol-db/anjuta-tags/parser/jsparse.h
plugins/symbol-db/anjuta-tags/parser/jsparse.h
+13
-0
plugins/symbol-db/anjuta-tags/parser/jstypes.h
plugins/symbol-db/anjuta-tags/parser/jstypes.h
+114
-0
plugins/symbol-db/anjuta-tags/parser/lex.l
plugins/symbol-db/anjuta-tags/parser/lex.l
+126
-0
plugins/symbol-db/anjuta-tags/parser/lex.yy.c
plugins/symbol-db/anjuta-tags/parser/lex.yy.c
+3698
-0
plugins/symbol-db/anjuta-tags/parser/lex.yy.h
plugins/symbol-db/anjuta-tags/parser/lex.yy.h
+339
-0
plugins/symbol-db/anjuta-tags/parser/y.tab.c
plugins/symbol-db/anjuta-tags/parser/y.tab.c
+4643
-0
plugins/symbol-db/anjuta-tags/parser/y.tab.h
plugins/symbol-db/anjuta-tags/parser/y.tab.h
+168
-0
plugins/symbol-db/anjuta-tags/parsers.h
plugins/symbol-db/anjuta-tags/parsers.h
+1
-0
No files found.
configure.in
View file @
655dc05b
...
...
@@ -118,6 +118,14 @@ dnl ***************************************************************************
AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2
dnl ***************************************************************************
dnl Set gjsdir && girdir
dnl ***************************************************************************
girdir=`pkg-config --variable=girdir gobject-introspection-1.0`
gjsdir=`pkg-config --variable=jsdir gjs-1.0`
AC_SUBST(girdir)
AC_SUBST(gjsdir)
dnl ***************************************************************************
dnl Check for pkgconfig
dnl ***************************************************************************
...
...
@@ -763,6 +771,7 @@ plugins/debug-manager/Makefile
plugins/debug-manager/images/Makefile
plugins/devhelp/Makefile
plugins/glade/Makefile
plugins/js-debugger/Makefile
plugins/file-manager/Makefile
plugins/file-loader/Makefile
plugins/file-wizard/Makefile
...
...
@@ -795,6 +804,8 @@ plugins/project-wizard/templates/mkfile/Makefile
plugins/project-wizard/templates/mkfile/src/Makefile
plugins/project-wizard/templates/mkfile/po/Makefile
plugins/project-wizard/templates/minimal/Makefile
plugins/project-wizard/templates/js_minimal/Makefile
plugins/project-wizard/templates/js_minimal/src/Makefile
plugins/project-wizard/templates/terminal/Makefile
plugins/project-wizard/templates/terminal/src/Makefile
plugins/project-wizard/templates/terminal/po/Makefile
...
...
@@ -842,6 +853,7 @@ plugins/language-support-cpp-java/Makefile
plugins/language-support-cpp-java/cxxparser/Makefile
plugins/run-program/Makefile
plugins/starter/Makefile
plugins/language-support-js/Makefile
anjuta.desktop.in
manuals/Makefile
manuals/reference/Makefile
...
...
plugins/Makefile.am
View file @
655dc05b
...
...
@@ -31,6 +31,8 @@ SUBDIRS = . \
run-program
\
gbf-am
\
gbf-mkfile
\
starter
starter
\
js-debugger
\
language-support-js
-include
$(top_srcdir)/git.mk
plugins/js-debugger/Makefile.am
0 → 100644
View file @
655dc05b
# Plugin Icon file
js_debugger_pixmapsdir
=
$(anjuta_image_dir)
js_debugger_pixmaps_DATA
=
js_debugger.png
# Plugin description file
plugin_in_files
=
js_debugger.plugin.in
%.plugin
:
%.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
js_debugger_plugindir
=
$(anjuta_plugin_dir)
js_debugger_plugin_DATA
=
$(plugin_in_files:.plugin.in=.plugin)
# NOTE :
# The naming convention is very intentional
# We are forced to use the prefix 'lib' by automake and libtool
# There is probably a way to avoid it but it is not worth to effort
# to find out.
# The 'anjuta_' prfix is a safety measure to avoid conflicts where the
# plugin 'libpython.so' needs to link with the real 'libpython.so'
# Include paths
AM_CPPFLAGS
=
\
-Werror
\
-DPACKAGE_LOCALE_DIR
=
\"
"
$(prefix)
/
$(DATADIRNAME)
/locale"
\"
\
-DANJUTA_DATA_DIR
=
\"
$(anjuta_data_dir)
\"
\
-DANJUTA_PLUGIN_DIR
=
\"
$(anjuta_plugin_dir)
\"
\
-DANJUTA_IMAGE_DIR
=
\"
$(anjuta_image_dir)
\"
\
-DANJUTA_GLADE_DIR
=
\"
$(anjuta_glade_dir)
\"
\
-DANJUTA_UI_DIR
=
\"
$(anjuta_ui_dir)
\"
\
-DPACKAGE_SRC_DIR
=
\"
$(srcdir)
\"
\
$(LIBANJUTA_CFLAGS)
# Where to install the plugin
plugindir
=
$(anjuta_plugin_dir)
# The plugin
plugin_LTLIBRARIES
=
libjs_debugger.la
# Plugin sources
libjs_debugger_la_SOURCES
=
debugger-js.c debugger-js.h debugger-server.c debugger-server.h plugin.c plugin.h
# Plugin dependencies
libjs_debugger_la_LIBADD
=
\
$(LIBANJUTA_LIBS)
EXTRA_DIST
=
\
$(plugin_in_files)
\
$(js_debugger_plugin_DATA)
\
$(js_debugger_pixmaps_DATA)
plugins/js-debugger/debugger-js.c
0 → 100644
View file @
655dc05b
This diff is collapsed.
Click to expand it.
plugins/js-debugger/debugger-js.h
0 → 100644
View file @
655dc05b
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
Copyright (C) 2009 Maxim Ermilov <zaspire@rambler.ru>
This program 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 2 of the License, or
(at your option) any later version.
This program 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _DEBUGGER_JS_H_
#define _DEBUGGER_JS_H_
#include <glib-object.h>
G_BEGIN_DECLS
#define DEBUGGER_TYPE_JS (debugger_js_get_type ())
#define DEBUGGER_JS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEBUGGER_TYPE_JS, DebuggerJs))
#define DEBUGGER_JS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEBUGGER_TYPE_JS, DebuggerJsClass))
#define DEBUGGER_IS_JS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEBUGGER_TYPE_JS))
#define DEBUGGER_IS_JS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEBUGGER_TYPE_JS))
#define DEBUGGER_JS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEBUGGER_TYPE_JS, DebuggerJsClass))
typedef
struct
_DebuggerJsClass
DebuggerJsClass
;
typedef
struct
_DebuggerJs
DebuggerJs
;
struct
_DebuggerJsClass
{
GObjectClass
parent_class
;
/* Signals */
void
(
*
DebuggerError
)
(
DebuggerJs
*
self
,
const
gchar
*
text
);
};
struct
_DebuggerJs
{
GObject
parent_instance
;
};
GType
debugger_js_get_type
(
void
)
G_GNUC_CONST
;
DebuggerJs
*
debugger_js_new
(
int
port
,
const
gchar
*
filename
,
IAnjutaDebugger
*
data
);
IAnjutaDebuggerState
debugger_js_get_state
(
DebuggerJs
*
object
);
void
debugger_js_set_work_dir
(
DebuggerJs
*
object
,
const
gchar
*
work_dir
);
void
debugger_js_start_remote
(
DebuggerJs
*
object
);
void
debugger_js_start
(
DebuggerJs
*
object
,
const
gchar
*
arguments
);
void
debugger_js_continue
(
DebuggerJs
*
object
);
void
debugger_js_stepin
(
DebuggerJs
*
object
);
void
debugger_js_stepover
(
DebuggerJs
*
object
);
void
debugger_js_stepout
(
DebuggerJs
*
object
);
void
debugger_js_stop
(
DebuggerJs
*
object
);
void
debugger_js_add_breakpoint
(
DebuggerJs
*
object
,
const
gchar
*
file
,
guint
line
);
void
debugger_js_breakpoint_list
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gpointer
user_data
);
void
debugger_js_variable_list_children
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
const
gchar
*
name
,
gpointer
user_data
);
void
debugger_js_signal
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gpointer
user_data
);
void
debugger_js_list_local
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gpointer
user_data
);
void
debugger_js_list_thread
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gpointer
user_data
);
void
debugger_js_list_frame
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gpointer
user_data
);
void
debugger_js_info_thread
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
gint
thread
,
gpointer
user_data
);
void
debugger_js_variable_create
(
DebuggerJs
*
object
,
IAnjutaDebuggerCallback
callback
,
const
gchar
*
name
,
gpointer
user_data
);
G_END_DECLS
#endif
/* _DEBUGGER_JS_H_ */
plugins/js-debugger/debugger-server.c
0 → 100644
View file @
655dc05b
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
Copyright (C) 2009 Maxim Ermilov <zaspire@rambler.ru>
This program 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 2 of the License, or
(at your option) any later version.
This program 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <unistd.h>
#include <string.h>
#include "debugger-server.h"
typedef
struct
_DebuggerServerPrivate
DebuggerServerPrivate
;
struct
_DebuggerServerPrivate
{
GList
*
in
;
GList
*
out
;
int
server_socket
;
int
socket
;
gboolean
work
;
};
#define DEBUGGER_SERVER_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DEBUGGER_TYPE_SERVER, DebuggerServerPrivate))
enum
{
DATA_ARRIVED
,
ERROR_SIGNAL
,
LAST_SIGNAL
};
static
guint
server_signals
[
LAST_SIGNAL
]
=
{
0
};
G_DEFINE_TYPE
(
DebuggerServer
,
debugger_server
,
G_TYPE_OBJECT
);
static
void
debugger_server_init
(
DebuggerServer
*
object
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
priv
->
in
=
NULL
;
priv
->
out
=
NULL
;
priv
->
server_socket
=
0
;
priv
->
socket
=
0
;
priv
->
work
=
TRUE
;
}
static
void
debugger_server_finalize
(
GObject
*
object
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
g_assert
(
priv
);
g_list_foreach
(
priv
->
in
,
(
GFunc
)
g_free
,
NULL
);
g_list_free
(
priv
->
in
);
g_list_foreach
(
priv
->
out
,
(
GFunc
)
g_free
,
NULL
);
g_list_free
(
priv
->
out
);
G_OBJECT_CLASS
(
debugger_server_parent_class
)
->
finalize
(
object
);
}
static
void
debugger_server_data_arrived
(
DebuggerServer
*
self
)
{
}
static
void
debugger_server_error_signal
(
DebuggerServer
*
self
,
const
gchar
*
text
)
{
}
static
void
debugger_server_class_init
(
DebuggerServerClass
*
klass
)
{
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
g_type_class_add_private
(
klass
,
sizeof
(
DebuggerServerPrivate
));
object_class
->
finalize
=
debugger_server_finalize
;
klass
->
data_arrived
=
debugger_server_data_arrived
;
klass
->
error
=
debugger_server_error_signal
;
server_signals
[
DATA_ARRIVED
]
=
g_signal_new
(
"data-arrived"
,
G_OBJECT_CLASS_TYPE
(
klass
),
G_SIGNAL_RUN_FIRST
,
G_STRUCT_OFFSET
(
DebuggerServerClass
,
data_arrived
),
NULL
,
NULL
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
server_signals
[
DATA_ARRIVED
]
=
g_signal_new
(
"error"
,
G_OBJECT_CLASS_TYPE
(
klass
),
G_SIGNAL_RUN_FIRST
,
G_STRUCT_OFFSET
(
DebuggerServerClass
,
error
),
NULL
,
NULL
,
g_cclosure_marshal_VOID__POINTER
,
G_TYPE_NONE
,
1
,
G_TYPE_POINTER
);
}
static
gboolean
SourceFunc
(
gpointer
d
)
{
DebuggerServer
*
object
=
DEBUGGER_SERVER
(
d
);
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
gint
size
;
if
(
priv
->
socket
==
0
)
{
fd_set
accept_fd
;
struct
timeval
timeo
;
struct
sockaddr
*
cp
=
NULL
;
socklen_t
sz
;
FD_ZERO
(
&
accept_fd
);
FD_SET
(
priv
->
server_socket
,
&
accept_fd
);
timeo
.
tv_sec
=
0
;
timeo
.
tv_usec
=
1
;
if
(
select
(
priv
->
server_socket
+
1
,
&
accept_fd
,
NULL
,
NULL
,
&
timeo
)
>
0
)
{
if
(
FD_ISSET
(
priv
->
server_socket
,
&
accept_fd
))
{
if
((
priv
->
socket
=
accept
(
priv
->
server_socket
,
cp
,
&
sz
))
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Can not accept."
,
G_TYPE_NONE
);
}
close
(
priv
->
server_socket
);
}
}
}
else
{
int
len
;
if
(
ioctl
(
priv
->
socket
,
FIONREAD
,
&
len
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Error in ioctl call."
,
G_TYPE_NONE
);
}
if
(
len
>
4
)
{
int
in
;
gchar
*
buf
;
if
(
recv
(
priv
->
socket
,
&
len
,
4
,
0
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Can not recv."
,
G_TYPE_NONE
);
}
if
(
len
<=
0
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Incorrect data recived."
,
G_TYPE_NONE
);
}
buf
=
g_new
(
char
,
len
+
1
);
do
{
if
(
ioctl
(
priv
->
socket
,
FIONREAD
,
&
in
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Error in ioctl call."
,
G_TYPE_NONE
);
}
if
(
in
<
len
)
usleep
(
20
);
}
while
(
in
<
len
);
if
(
recv
(
priv
->
socket
,
buf
,
len
,
0
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Can not recv."
,
G_TYPE_NONE
);
}
buf
[
len
]
=
'\0'
;
priv
->
in
=
g_list_append
(
priv
->
in
,
buf
);
g_signal_emit_by_name
(
object
,
"data-arrived"
,
G_TYPE_NONE
);
}
while
(
priv
->
out
!=
NULL
)
{
size
=
strlen
((
gchar
*
)
priv
->
out
->
data
)
+
1
;
if
(
send
(
priv
->
socket
,
&
size
,
4
,
0
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Can not send."
,
G_TYPE_NONE
);
}
if
(
send
(
priv
->
socket
,
priv
->
out
->
data
,
size
,
0
)
==
-
1
)
{
g_signal_emit_by_name
(
object
,
"error"
,
"Can not send."
,
G_TYPE_NONE
);
}
g_free
(
priv
->
out
->
data
);
priv
->
out
=
g_list_delete_link
(
priv
->
out
,
priv
->
out
);
}
g_signal_emit_by_name
(
object
,
"data-arrived"
,
G_TYPE_NONE
);
//TODO:FIX
}
if
(
!
priv
->
work
)
{
close
(
priv
->
socket
);
}
return
priv
->
work
;
}
DebuggerServer
*
debugger_server_new
(
gint
port
)
{
DebuggerServer
*
object
=
g_object_new
(
DEBUGGER_TYPE_SERVER
,
NULL
);
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
struct
sockaddr_in
serverAddr
;
int
flag
=
1
;
priv
->
server_socket
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
priv
->
server_socket
==
-
1
)
return
NULL
;
serverAddr
.
sin_family
=
AF_INET
;
serverAddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
serverAddr
.
sin_port
=
htons
(
port
);
setsockopt
(
priv
->
server_socket
,
IPPROTO_TCP
,
TCP_NODELAY
,
(
char
*
)
&
flag
,
sizeof
(
int
));
if
(
bind
(
priv
->
server_socket
,
((
struct
sockaddr
*
)
&
serverAddr
),
sizeof
(
serverAddr
))
==
-
1
)
return
NULL
;
listen
(
priv
->
server_socket
,
5
);
g_timeout_add
(
2
,
(
GSourceFunc
)
SourceFunc
,
object
);
return
object
;
}
void
debugger_server_send_line
(
DebuggerServer
*
object
,
const
gchar
*
line
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
g_assert
(
line
!=
NULL
);
priv
->
out
=
g_list_append
(
priv
->
out
,
g_strdup
(
line
));
}
void
debugger_server_stop
(
DebuggerServer
*
object
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
priv
->
work
=
FALSE
;
}
gchar
*
debugger_server_get_line
(
DebuggerServer
*
object
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
gchar
*
ret
=
NULL
;
g_assert
(
priv
->
in
!=
NULL
);
g_assert
(
priv
->
in
->
data
!=
NULL
);
ret
=
g_strdup
((
gchar
*
)
priv
->
in
->
data
);
priv
->
in
=
g_list_delete_link
(
priv
->
in
,
priv
->
in
);
return
ret
;
}
gint
debugger_server_get_line_col
(
DebuggerServer
*
object
)
{
DebuggerServerPrivate
*
priv
=
DEBUGGER_SERVER_PRIVATE
(
object
);
return
g_list_length
(
priv
->
in
);
}
plugins/js-debugger/debugger-server.h
0 → 100644
View file @
655dc05b
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
Copyright (C) 2009 Maxim Ermilov <zaspire@rambler.ru>
This program 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 2 of the License, or
(at your option) any later version.
This program 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _DEBUGGER_SERVER_H_
#define _DEBUGGER_SERVER_H_
#include <glib-object.h>
G_BEGIN_DECLS
#define DEBUGGER_TYPE_SERVER (debugger_server_get_type ())
#define DEBUGGER_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEBUGGER_TYPE_SERVER, DebuggerServer))
#define DEBUGGER_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEBUGGER_TYPE_SERVER, DebuggerServerClass))
#define DEBUGGER_IS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEBUGGER_TYPE_SERVER))
#define DEBUGGER_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEBUGGER_TYPE_SERVER))
#define DEBUGGER_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEBUGGER_TYPE_SERVER, DebuggerServerClass))
typedef
struct
_DebuggerServerClass
DebuggerServerClass
;
typedef
struct
_DebuggerServer
DebuggerServer
;
struct
_DebuggerServerClass
{
GObjectClass
parent_class
;
/* Signals */
void
(
*
data_arrived
)
(
DebuggerServer
*
self
);
void
(
*
error
)
(
DebuggerServer
*
self
,
const
gchar
*
error
);
};
struct
_DebuggerServer
{
GObject
parent_instance
;
};
GType
debugger_server_get_type
(
void
)
G_GNUC_CONST
;
DebuggerServer
*
debugger_server_new
(
gint
port
);
void
debugger_server_send_line
(
DebuggerServer
*
object
,
const
gchar
*
line
);
void
debugger_server_stop
(
DebuggerServer
*
object
);
gchar
*
debugger_server_get_line
(
DebuggerServer
*
object
);
gint
debugger_server_get_line_col
(
DebuggerServer
*
object
);
G_END_DECLS
#endif
/* _DEBUGGER_SERVER_H_ */
plugins/js-debugger/js_debugger.plugin.in
0 → 100644
View file @
655dc05b
[Anjuta Plugin]
Location=js_debugger:JSDbg
Icon=js_debugger.png
_Name=Anjuta JS Debugger Plugin
_Description=Anjuta JS Debugger Plugin
UserActivatable=yes
Interfaces=IAnjutaDebugger, IAnjutaDebuggerInstruction, IAnjutaDebuggerBreakpoint, IAnjutaDebuggerVariable
[File Loader]
SupportedMimeTypes=application/x-executable,application/octet-stream,application/x-core,application/x-shellscript
plugins/js-debugger/js_debugger.png
0 → 100644
View file @
655dc05b
2.94 KB
plugins/js-debugger/plugin.c
0 → 100644
View file @
655dc05b
This diff is collapsed.
Click to expand it.
plugins/js-debugger/plugin.h
0 → 100644
View file @
655dc05b
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
Copyright (C) 2009 Maxim Ermilov <zaspire@rambler.ru>
This program 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 2 of the License, or
(at your option) any later version.
This program 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _JS_DEBUGGER_H_
#define _JS_DEBUGGER_H_
#include <glib.h>
#include <libanjuta/anjuta-plugin.h>
G_BEGIN_DECLS
extern
GType
js_debugger_get_type
(
GTypeModule
*
module
);
#define ANJUTA_TYPE_PLUGIN_JSDBG (js_debugger_get_type (NULL))
#define ANJUTA_PLUGIN_JSDBG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PLUGIN_JSDBG, JSDbg))
#define ANJUTA_PLUGIN_JSDBG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), ANJUTA_TYPE_PLUGIN_JSDBG, JSDbgClass))
#define ANJUTA_IS_PLUGIN_JSDBG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_JSDbg))
#define ANJUTA_IS_PLUGIN_JSDBG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PLUGIN_JSDBG))
#define ANJUTA_PLUGIN_JSDBG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ANJUTA_TYPE_PLUGIN_JSDBG, JSDbgClass))
typedef
struct
_JSDbg
JSDbg
;
typedef
struct
_JSDbgClass
JSDbgClass
;
G_END_DECLS
#endif
plugins/language-manager/languages.xml
View file @
655dc05b
...
...
@@ -8,4 +8,5 @@
<language
id=
"4"
name=
"Python"
strings=
"python"
mime-types=
"text/x-python"
/>
<language
id=
"5"
name=
"C#"
strings=
"c#,csharp"
mime-types=
"text/x-csharp"
/>
<language
id=
"6"
name=
"Vala"
strings=
"vala"
mime-types=
"text/x-vala"
/>
<language
id=
"7"
name=
"JavaScript"
strings=
"js,javascript"
mime-types=
"application/javascript"
/>
</languages>
plugins/language-support-js/Makefile.am
0 → 100644
View file @
655dc05b
# Sample Makefile for a anjuta plugin.
#SUBDIRS = unit_test
js_support_plugin_gladedir
=
$(anjuta_glade_dir)
js_support_plugin_glade_DATA
=
anjuta-language-javascript.ui
js_support_plugin_uidir
=
$(anjuta_ui_dir)
js_support_plugin_ui_DATA
=
anjuta-language-javascript.xml
# Plugin Icon file
js_support_plugin_pixmapsdir
=
$(anjuta_image_dir)
js_support_plugin_pixmaps_DATA
=
js_support_plugin.png
# Plugin description file
plugin_in_files
=
js_support_plugin.plugin.in
%.plugin
:
%.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
js_support_plugin_plugindir
=
$(anjuta_plugin_dir)
js_support_plugin_plugin_DATA
=
$(plugin_in_files:.plugin.in=.plugin)
# NOTE :
# The naming convention is very intentional
# We are forced to use the prefix 'lib' by automake and libtool
# There is probably a way to avoid it but it is not worth to effort
# to find out.
# The 'anjuta_' prfix is a safety measure to avoid conflicts where the
# plugin 'libpython.so' needs to link with the real 'libpython.so'
# Include paths
AM_CPPFLAGS
=
\
-Wall
\
-Werror
\
-DPACKAGE_LOCALE_DIR
=
\"
"
$(prefix)
/
$(DATADIRNAME)
/locale"
\"
\
-DANJUTA_DATA_DIR
=
\"
$(anjuta_data_dir)
\"
\
-DANJUTA_PLUGIN_DIR
=
\"
$(anjuta_plugin_dir)
\"
\
-DANJUTA_IMAGE_DIR
=
\"
$(anjuta_image_dir)
\"
\
-DANJUTA_GLADE_DIR
=
\"
$(anjuta_glade_dir)
\"
\
-DANJUTA_UI_DIR
=
\"
$(anjuta_ui_dir)
\"
\
$(LIBANJUTA_CFLAGS)
\
-DPACKAGE_SRC_DIR
=
\"
$(srcdir)
\"
\
-DGIR_PATH
=
\"
$(girdir)
\"
\
-DGJS_PATH
=
\"
$(gjsdir)
\"
# Where to install the plugin
plugindir
=
$(anjuta_plugin_dir)
# The plugin
plugin_LTLIBRARIES
=
libjs_support_plugin.la
# Plugin sources
libjs_support_plugin_la_SOURCES
=
plugin.c plugin.h code-completion.c code-completion.h util.c util.h
\
y.tab.c y.tab.h lex.yy.c lex.yy.h js-node.c js-node.h js-context.c js-context.h jsparse.c jsparse.h ijs-symbol.h ijs-symbol.c gir-symbol.c gir-symbol.h gi-symbol.c gi-symbol.h simple-symbol.c simple-symbol.h local-symbol.c local-symbol.h node-symbol.c node-symbol.h import-symbol.c import-symbol.h dir-symbol.c dir-symbol.h std-symbol.c std-symbol.h database-symbol.c database-symbol.h db-anjuta-symbol.c db-anjuta-symbol.h
# Plugin dependencies
libjs_support_plugin_la_LIBADD
=
\
$(LIBANJUTA_LIBS)
EXTRA_DIST
=
\
$(plugin_in_files)
\
$(js_support_plugin_plugin_DATA)
\
$(js_support_plugin_glade_DATA)
\
$(js_support_plugin_ui_DATA)
\
$(js_support_plugin_pixmaps_DATA)
-include
$(top_srcdir)/git.mk
plugins/language-support-js/anjuta-language-javascript.ui
0 → 100644
View file @
655dc05b
<?xml version="1.0"?>
<interface>
<requires
lib=
"gtk+"
version=
"2.16"
/>
<!-- interface-naming-policy toplevel-contextual -->
<object
class=
"GtkListStore"
id=
"jsdirs_liststore"
>
<columns>
<!-- column-name text -->
<column
type=
"gchararray"
/>
</columns>
</object>
<object
class=
"GtkWindow"
id=
"preferences_dialog"
>
<property
name=
"title"
translatable=
"yes"
>
window1
</property>
<child>
<object
class=
"GtkVBox"
id=
"vbox1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"orientation"
>
vertical
</property>
<child>
<object
class=
"GtkFrame"
id=
"frame1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"label_xalign"
>
0
</property>
<property
name=
"shadow_type"
>
in
</property>
<child>
<object
class=
"GtkAlignment"
id=
"alignment1"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"left_padding"
>
12
</property>
<child>
<object
class=
"GtkHBox"
id=
"hbox1"
>
<property
name=
"visible"
>
True
</property>
<child>
<object
class=
"GtkTreeView"
id=
"jsdirs_treeview"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"model"
>
jsdirs_liststore
</property>
<property
name=
"enable_search"
>
False
</property>
<property
name=
"search_column"
>
0
</property>
<child>
<object
class=
"GtkTreeViewColumn"
id=
"text"
>
<property
name=
"title"
>
Test
</property>
<child>
<object
class=
"GtkCellRendererText"
id=
"test-renderer"
/>
<attributes>
<attribute
name=
"text"
>
0
</attribute>
</attributes>
</child>
</object>
</child>
</object>