Commit a6e9f61e authored by Benoît Minisini's avatar Benoît Minisini

[CONFIGURATION]

* NEW: Update *.component files to the new format.
* BUG: Fix component TEMPLATE directory.

[EXAMPLES]
* NEW: PhotoTouch: Display the browsed directory path.

[INTERPRETER]
* NEW: Change the 'main' hook syntax. Add a macro to call the previous 
  'main' hook, so that several hooks can be declared.

[GB.MEDIA]
* NEW: New multimedia component based on GStreamer.

[GB.GTK]
* BUG: Fix timer management so that it is compatible with the GB.Every()
  interpreter API.
* NEW: Allows multiple 'main' hooks.

[GB.QT4]
* NEW: Allows multiple 'main' hooks.


git-svn-id: svn://localhost/gambas/trunk@4693 867c0c6c-44f3-4631-809d-bfa615b0a4ec
parent 5241ca29
......@@ -28,6 +28,7 @@ SUBDIRS = \
@dbus_dir@ \
@gsl_dir@ \
@ncurses_dir@ \
@media_dir@ \
comp \
app \
examples \
......
/* Copyrights */
#define __COPYRIGHT (c) 2005
#define __COPYRIGHT (c) 2012
#define __AUTHOR Joe Smith
#define __EMAIL <joe.smith@gmail.com>
......
/* Copyrights */
#define __COPYRIGHT (c) 2012
#define __AUTHOR Benoît Minisini
#define __EMAIL <gambas@users.sourceforge.net>
/* Name of the component */
#define __COMPONENT gb.media
/* Name of the component with points replaced by underscore */
#define __COMPONENT_UNDERSCORE gb_media
/* Short name of the component */
#define __NAME media
/* Short name of the component in uppercase */
#define __UNAME MEDIA
/* Description of the component */
#define __DESCRIPTION GStreamer component
/* If the component detection uses pkg-config */
#define __USE_PKGCONFIG 1
#if __USE_PKGCONFIG
/* Name of the package for pkg-config */
#define __PKGCONFIG_NAME gstreamer-0.10
/* Minimum version needed */
//#define __PKGCONFIG_VERSION 2.14.3
#else /* __USE_PKGCONFIG */
/* If your component uses C */
#define __USE_C 1
/* If your component uses C++ */
#define __USE_CPLUSPLUS 0
/* If your component uses multi-threading */
#define __USE_THREAD 0
/* If your component uses X-Window */
#define __USE_XWINDOW 0
/* Includes to search for */
#define __SEARCH_INCLUDE
/* Includes directories search path */
#define __SEARCH_INCLUDE_PATH
/* Includes sub-directories search */
#define __SEARCH_INCLUDE_DIR
/* Libraries to search for */
#define __SEARCH_LIBRARY
/* Libraries directories search path */
#define __SEARCH_LIBRARY_PATH
/* Libraries sub-directories search path */
#define __SEARCH_LIBRARY_DIR
/* Libraries to link with */
#define __LIBRARY
/* Includes to look for */
#define __INCLUDE
#endif /* __USE_PKGCONFIG */
/* Source file list */
#define __SOURCES main.c main.h
/* Main C/C++ source basename in uppercase */
#define __MAIN_UNAME MAIN
......@@ -17,6 +17,7 @@ fi
echo "Creating component directory $1..."
cp -R template ../$1
rm -rf ../$1/.svn ../$1/*/.svn
echo "Applying template..."
for i in ../$1/* ../$1/*/*; do
......
ACLOCAL_AMFLAGS = -I m4 --install
SUBDIRS = @__UNAME##_DIR@
EXTRA_DIST = reconf gambas.h gb*.h
[Component]
Author=
Alpha=1
COMPONENT = __COMPONENT
include $(top_srcdir)/component.am
INCLUDES = #@#__UNAME##_INC@
gblib_LTLIBRARIES = __COMPONENT.la
__COMPONENT_UNDERSCORE##_la_LIBADD = #@#__UNAME##_LIB@
__COMPONENT_UNDERSCORE##_la_LDFLAGS = -module @LD_FLAGS@ #@#__UNAME##_LDFLAGS@
__COMPONENT_UNDERSCORE##_la_SOURCES = __SOURCES
This diff is collapsed.
This diff is collapsed.
......@@ -107,6 +107,7 @@ Static Private Sub InitComponentNames()
$cName["gb.image.imlib"] = ("Image routines from the Imlib2 library")
$cName["gb.image.io"] = ("Image loading and saving")
$cName["gb.ldap"] = ("OpenLDAP client")
$cName["gb.media"] = ("GStreamer multimedia component")
$cName["gb.mysql"] = ("MySQL specific routines")
$cName["gb.ncurses"] = ("NCurses library")
$cName["gb.net"] = ("Network programming")
......
......@@ -775,8 +775,9 @@ Private Sub DecodeHelpLine(sLine As String) As String
Inc iPos
If iPos > iLen Then Break
sChar = String.Mid(sLine, iPos, 1)
If sWait = ">" Then
sHtml &= sChar
If sChar = ">" Then sWait = ""
......
......@@ -1059,7 +1059,20 @@ Public Sub UpdateMenu()
mnuClearDebugWindows.Enabled = Project.Running
Action["component-property"].Visible = Project.Type <> Project.TYPE_NORMAL
With Action["component-property"]
Select Case Project.Type
Case Project.TYPE_NORMAL
.Visible = False
Case Project.TYPE_LIBRARY
.Visible = True
mnuPropertyComp.Text = ("Library properties") & "..."
btnComponent.Tooltip = ("Library properties")
Case Project.TYPE_COMPONENT
.Visible = True
mnuPropertyComp.Text = ("Component properties") & "..."
btnComponent.Tooltip = ("Component properties")
End Select
End With
End
......
......@@ -124,7 +124,6 @@
}
{ mnuPropertyComp Menu
Action = "component-property"
Text = ("Co&mponent properties...")
Picture = Picture["icon:/small/component"]
Visible = False
Shortcut = "Ctrl+Shift+P"
......@@ -574,7 +573,6 @@
}
{ btnComponent ToolButton
MoveScaled(17,0,4,4)
ToolTip = ("Component properties")
Action = "component-property"
Picture = Picture["icon:/small/component"]
}
......@@ -1061,7 +1059,7 @@
Picture = "icon:/small/make-all"
}
{ Action component-property
Text = "Co&mponent properties..."
Text = ""
Shortcut = "Ctrl+Shift+P"
Picture = "icon:/small/component"
}
......
......@@ -5,12 +5,12 @@
16 DistroWatch.com
15 Yvick Miossec
15 Christian Henri Fischer
12 Leo Barnhoorn
12 Eric Damron
12 Hans-Martin Bundeshund
12 Michael Zbinden
12 Eight Virtues
12 Laurent Carlier
11 Leo Barnhoorn
11 Eric Damron
11 Hans-Martin Bundeshund
11 Michael Zbinden
11 Eight Virtues
11 Laurent Carlier
10 Thierry Senges
10 Nando Favaro
9 David Losada
......@@ -32,12 +32,12 @@
6 Pearces Hardware
6 Adrian Nicol
6 Olivier Cruilles
6 Adolf J. Winterer
6 Alexander G Schaller
6 Randall Wilkinson
6 Ron Klinkien
6 David Villalobos
6 Jon Nicholson
5 Adolf J. Winterer
5 Alexander G Schaller
5 Randall Wilkinson
5 Ron Klinkien
5 David Villalobos
5 Jon Nicholson
5 Pierre Chassagneux
5 Igor Furlan
5 Fernando J Parra Velandia
......@@ -75,6 +75,7 @@
3 Frank Tomesch
3 Nicola Giacobbe
3 John Tsatsakis
3 Peter Garlick
3 DaifNet
2 Eloy Velázquez López
2 Reza Salari
......
[Component]
Key=gb.chart
Version=3.0.0
Version=3.1.90
State=2
Authors=Fabien Bodard
Needs=Form
......
# Gambas Project File 3.0
# Compiled with Gambas 3.0.0
# Compiled with Gambas 3.1.90
Title=gb.chart
Startup=FTest
Version=3.0.0
Version=3.1.90
VersionFile=1
Component=gb.image
Component=gb.qt4
......@@ -12,4 +12,5 @@ Description="Gambas Chart Component"
Authors="Fabien Bodard"
Environment="GB_GUI=gb.gtk"
TabSize=2
MakeComponent=1
Type=Component
Packager=1
[Component]
Key=gb.db.form
Version=3.0.90
Version=3.1.90
Authors=Benoît Minisini
Needs=Form
Requires=gb.db,gb.form
......
......@@ -13,7 +13,7 @@ Environment="GB_GUI=gb.gtk"
TabSize=2
Translate=1
Language=en
MakeComponent=1
Type=Component
Maintainer=benoit
Vendor=Princeton
Address=benoit@localhost
......
[Component]
Key=gb.eval.highlight
Version=3.0.0
Version=3.1.90
Requires=gb.eval
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
# Compiled with Gambas 3.1.90
Title=gb.eval.highlight
Startup=Main
Version=3.1.0
Version=3.1.90
VersionFile=1
Component=gb.image
Component=gb.qt4
Component=gb.eval
Component=gb.qt4.ext
TabSize=2
MakeComponent=1
Type=Component
Packager=1
......@@ -2,7 +2,7 @@ Main
gb.eval.highlight
0
0
3.1.0
3.1.90
gb.image
gb.qt4
......
[Component]
Key=gb.form.dialog
Version=3.0.0
Version=3.1.90
Authors=Benoît Minisini,David Villalobos Cambronero
Needs=Form
Requires=gb.form
......
# Gambas Project File 3.0
# Compiled with Gambas 3.0.90
# Compiled with Gambas 3.1.90
Title=Enhanced standard dialogs
Startup=Main
Version=3.0.90
Version=3.1.90
VersionFile=1
Component=gb.image
Component=gb.gui
......@@ -13,8 +13,9 @@ Environment="GB_GUI=gb.qt4"
TabSize=2
Translate=1
Language=en
MakeComponent=1
Type=Component
Maintainer=David Villalobos Cambronero
Vendor=Princeton
Address=david_villalobos_c@yahoo.com
License=General Public Licence
Packager=1
[Component]
Key=gb.form.mdi
Version=3.0.90
Version=3.1.90
Authors=Benoît Minisini
Needs=Form
Requires=gb.form,gb.settings
......
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
# Compiled with Gambas 3.1.90
Title=Multiple document interface management
Startup=FMain1
Version=3.1.0
Version=3.1.90
VersionFile=1
Component=gb.image
Component=gb.gui
......@@ -15,7 +15,7 @@ Environment="GB_GUI=gb.gtk"
TabSize=2
Translate=1
Language=en
MakeComponent=1
Type=Component
Maintainer=benoit
Address=benoit@localhost
License=General Public Licence
......
[Component]
Key=gb.form.stock
Version=3.0.90
Version=3.1.90
Hidden=True
# Gambas Project File 3.0
# Compiled with Gambas 3.0.90
# Compiled with Gambas 3.1.90
Title=Default stock icons
Startup=Main
Version=3.0.90
Version=3.1.90
VersionFile=1
TabSize=2
MakeComponent=1
Type=Component
Packager=1
[Component]
Key=gb.form
Version=3.1.0
Version=3.1.90
Authors=Benoît Minisini
Needs=Form
......@@ -13,7 +13,7 @@ Environment="GB_GUI=gb.gtk"
TabSize=2
Translate=1
Language=en
MakeComponent=1
Type=Component
Maintainer=David Villalobos Cambronero
Vendor=Princeton
Address=david_villalobos_c@yahoo.com
......
[Component]
Key=gb.mysql
Version=3.0.0
Version=3.1.90
State=2
Authors=David Villalobos Cambronero
Requires=gb.db
......
# Gambas Project File 3.0
# Compiled with Gambas 3.0.0
# Compiled with Gambas 3.1.90
Title=mysql
Startup=modMain
Icon=logo.png
Version=3.0.0
Version=3.1.90
VersionFile=1
Component=gb.db
Description="Creates MySQL statements and executes them."
Authors="David Villalobos Cambronero"
TabSize=2
MakeComponent=1
Type=Component
ModulePublic=1
Maintainer=David Villalobos Cambronero
Vendor=Princeton
Address=david_villalobos_c@yahoo.com
License=General Public Licence
Packager=1
......@@ -2,7 +2,7 @@ modMain
mysql
0
0
3.0.0
3.1.90
gb.db
[Component]
Key=gb.report
Version=3.1.0
Version=3.1.90
State=1
Authors=Fabien Bodard
Needs=Form,ImageIO
......
......@@ -531,10 +531,6 @@ _GenerateClones
m
pause
m
_GetSizeHints
m
TSizeHint
......
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
# Compiled with Gambas 3.1.90
Title=Report designer
Startup=Report8
Icon=printer1.png
Version=3.1.0
Version=3.1.90
VersionFile=1
Component=gb.image
Component=gb.gui
......@@ -15,7 +15,7 @@ Environment="GB_GUI=gb.gtk"
TabSize=2
Translate=1
Language=fr
MakeComponent=1
Type=Component
Maintainer=benoit
Vendor=Princeton
Address=benoit@localhost
......
[Component]
Key=gb.settings
Version=3.1.0
Version=3.1.90
Authors=Benoît Minisini
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
# Compiled with Gambas 3.1.90
Title=Gambas settings management
Startup=Main
Version=3.1.0
Version=3.1.90
VersionFile=1
Authors="Benoît Minisini"
TabSize=2
MakeComponent=1
Type=Component
Maintainer=benoit
Vendor=Princeton
Address=benoit@localhost
License=General Public Licence
Packager=1
[Component]
Key=gb.web
Version=3.0.90
Version=3.1.90
Authors=Benoît Minisini
# Gambas Project File 3.0
# Compiled with Gambas 3.1.0
# Compiled with Gambas 3.1.90
Title=Web applications tools
Startup=Webpage1
Version=3.1.0
Version=3.1.90
VersionFile=1
Component=gb.web
Authors="Benoît Minisini"
TabSize=2
MakeComponent=1
Type=Component
Maintainer=benoit
Vendor=Princeton
Address=benoit@localhost
License=General Public Licence
Packager=1
......@@ -37,6 +37,7 @@ GB_CONFIG_SUBDIRS(imageimlib, gb.image.imlib)
GB_CONFIG_SUBDIRS(dbus, gb.dbus)
GB_CONFIG_SUBDIRS(gsl, gb.gsl)
GB_CONFIG_SUBDIRS(ncurses, gb.ncurses)
GB_CONFIG_SUBDIRS(media, gb.media)
AC_CONFIG_SUBDIRS(comp)
AC_CONFIG_SUBDIRS(app)
......
......@@ -26,6 +26,7 @@ Private $MY As Integer
Private btnPrev As CButton
Private btnNext As CButton
Private dwgPath As DrawingArea
Private Sub UpdateSaveIcon()
......@@ -221,11 +222,17 @@ Public Sub _new()
aButton = ["film", "-", "zoom-in", "zoom-out", "zoom-original", "zoom-fit", "-", "hflip", "vflip", "rotate-left", "rotate-right", "-",
"magic", "invert", "blur", "sharpen", "normalize", "despeckle", "oil", "-", "scissors", "resize", "balance", "<->", "save", "undo", "quit"]
CreateButtons(aButton, cTooltip, panToolbar)
aButton = ["photo", "usb", "save-all", "-", "hflip#2", "vflip#2", "rotate-left#2", "rotate-right#2", "<->", "save#2", "undo#2", "quit#2"]
aButton = ["photo", "usb", "save-all", "-"]
CreateButtons(aButton, cTooltip, panToolbarBrowser)
dwgPath = New DrawingArea(panToolbarBrowser) As "dwgPath"
dwgPath.Painted = True
dwgPath.Expand = True
dwgPath.Font = Font["Bold,+5"]
aButton = ["hflip#2", "vflip#2", "rotate-left#2", "rotate-right#2", "-", "save#2", "undo#2", "quit#2"]
CreateButtons(aButton, cTooltip, panToolbarBrowser)
btnPrev = New CButton(Me) As "Button"
......@@ -666,9 +673,25 @@ Public Sub svwImage_MouseMove()
End
Private Sub PaintOutlineText(sText As String, X As Float, Y As Float, W As Float, H As Float)
Dim I, J As Integer
Paint.Brush = Paint.Color(Color.SetAlpha(Color.White, 128))
For I = -1 To 1
For J = -1 To 1
Paint.DrawRichText(sText, X + I + 2, Y + J + 2, W - 4, H - 4, Align.Left)
Next
Next
'Paint.Fill
Paint.Brush = Paint.Color(Color.LightForeground)
Paint.DrawRichText(sText, X + 2, Y + 2, W - 4, H - 4, Align.Left)
End
Public Sub dwgInfo_Draw()
Dim X, Y As Integer
Dim sText As String
Dim sSpace As String
......@@ -681,16 +704,7 @@ Public Sub dwgInfo_Draw()
End With
Paint.Font = Font["+5"]
Paint.Brush = Paint.Color(Color.SetAlpha(Color.White, 128))
For X = -1 To 1
For Y = -1 To 1
Paint.DrawRichText(sText, X + 2, Y + 2, dwgInfo.W - 4, dwgInfo.H - 4, Align.Left)
Next
Next
'Paint.Fill
Paint.Brush = Paint.Color(Color.LightForeground)
Paint.DrawRichText(sText, 2, 2, dwgInfo.W - 4, dwgInfo.H - 4, Align.Left)
PaintOutlineText(sText, 0, 0, dwgInfo.W, dwgInfo.H)
End
......@@ -1093,3 +1107,9 @@ Public Sub PushUndo()
$hUndoStack.Add($hImage.Copy())
End
Public Sub dwgPath_Draw()
PaintOutlineText($sDir, 0, 0, Paint.W, Paint.H)
End
......@@ -84,7 +84,7 @@ GB_CLASS CLASS_SvgImage;
static void my_lang(char *lang,int rtl1);
static void my_error(int code,char *error,char *where);
static void my_quit (void);
static void my_main(int *argc, char **argv);
static void my_main(int *argc, char ***argv);
static void my_timer(GB_TIMER *timer,bool on);
static void my_wait(int duration);
static void my_post(void);
......@@ -97,6 +97,8 @@ static bool _must_check_quit = false;
static bool _application_keypress = false;
static GB_FUNCTION _application_keypress_func;
static void *_old_hook_main;
int MAIN_scale = 0;
extern "C"
......@@ -215,7 +217,7 @@ extern "C"
int EXPORT GB_INIT(void)
{
GB.Hook(GB_HOOK_QUIT, (void *)my_quit);
GB.Hook(GB_HOOK_MAIN, (void *)my_main);
_old_hook_main = GB.Hook(GB_HOOK_MAIN, (void *)my_main);
GB.Hook(GB_HOOK_WAIT, (void *)my_wait);
GB.Hook(GB_HOOK_LOOP, (void *)my_loop);
GB.Hook(GB_HOOK_TIMER,(void *)my_timer);
......@@ -316,14 +318,14 @@ static bool global_key_event_handler(int type)
return GB.Stopped();
}
static void my_main(int *argc, char **argv)
static void my_main(int *argc, char ***argv)
{
static bool init = false;
if (init)
return;
gApplication::init(argc, &argv);
gApplication::init(argc, argv);
gApplication::setDefaultTitle(GB.Application.Title());
gDesktop::init();
MAIN_scale = gDesktop::scale();
......@@ -338,6 +340,8 @@ static void my_main(int *argc, char **argv)
}
init = true;
CALL_HOOK_MAIN(_old_hook_main, argc, argv);
}
/*static void raise_timer(GB_TIMER *timer)
......@@ -348,10 +352,11 @@ static void my_main(int *argc, char **argv)
typedef
struct {
int source;
GTimer *timer;
int timeout;
}
MyTimerTag;
MyTimerId;
gboolean my_timer_function(GB_TIMER *timer)
{
......@@ -361,15 +366,16 @@ gboolean my_timer_function(GB_TIMER *timer)
if (timer->id)
{
MyTimerTag *tag = (MyTimerTag *)timer->tag;
GTimer *t = tag->timer;
int elapsed = (int)(g_timer_elapsed(t, NULL) * 1000) - tag->timeout;
MyTimerId *id = (MyTimerId *)timer->id;
GTimer *t = id->timer;
int elapsed = (int)(g_timer_elapsed(t, NULL) * 1000) - id->timeout;
int next = timer->delay - elapsed;
if (next < 10)
next = 10;
tag->timeout = next;
id->timeout = next;
g_timer_start(t);
timer->id = (intptr_t)g_timeout_add(next, (GSourceFunc)my_timer_function,(gpointer)timer);
id->source = g_timeout_add(next, (GSourceFunc)my_timer_function,(gpointer)timer);
//timer->id = (intptr_t)g_timeout_add(next, (GSourceFunc)my_timer_function,(gpointer)timer);
//fprintf(stderr, "elapsed = %d delay = %d next = %d\n", elapsed, timer->delay, next);
}
}
......@@ -379,22 +385,22 @@ gboolean my_timer_function(GB_TIMER *timer)
static void my_timer(GB_TIMER *timer,bool on)
{
if (timer->id) {
MyTimerTag *tag = (MyTimerTag *)timer->tag;
g_source_remove(timer->id);
g_timer_destroy(tag->timer);
g_free(tag);
if (timer->id)
{
MyTimerId *id = (MyTimerId *)timer->id;
g_source_remove(id->source);
g_timer_destroy(id->timer);