Skip to content

Commit

Permalink
[MOSYNC-17] Updated example workfiles. Added some helpful functions t…
Browse files Browse the repository at this point in the history
…o /rules/.
  • Loading branch information
Fredrik Eldh committed Oct 6, 2011
1 parent 70c8736 commit 8de3f42
Show file tree
Hide file tree
Showing 67 changed files with 371 additions and 189 deletions.
4 changes: 2 additions & 2 deletions examples/3dLines/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@EXTRA_CPPFLAGS = " -Wno-shadow"
@NAME = "3dLines"
Expand Down
4 changes: 2 additions & 2 deletions examples/AdvGraphics/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@EXTRA_CPPFLAGS = " -Wno-shadow"
@NAME = "AdvGraphics"
Expand Down
6 changes: 3 additions & 3 deletions examples/BluetoothClient/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "BluetoothClient"
end

work.invoke
work.invoke
6 changes: 3 additions & 3 deletions examples/BluetoothServer/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "BluetoothServer"
end

work.invoke
work.invoke
2 changes: 1 addition & 1 deletion examples/CameraDemo/ImageScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void ImageScreen::buttonClicked(Widget* button)
/**
* Lazy initializations
*/
int ImageScreen::initialize(StackScreen* stackScreen)
void ImageScreen::initialize(StackScreen* stackScreen)
{
mStackScreen = stackScreen;
createUI();
Expand Down
2 changes: 1 addition & 1 deletion examples/CameraDemo/ImageScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ImageScreen : public ButtonListener

virtual void buttonClicked(Widget* button);

int initialize(StackScreen* stackScreen);
void initialize(StackScreen* stackScreen);

void pushImageScreen();

Expand Down
6 changes: 3 additions & 3 deletions examples/CameraDemo/SettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void SettingsScreen::buttonClicked(Widget* button)
/**
* Lazy initialization
*/
int SettingsScreen::initialize(StackScreen* stackScreen, CameraPreview* previewWidget)
void SettingsScreen::initialize(StackScreen* stackScreen, CameraPreview* previewWidget)
{
mPreviewWidget = previewWidget;
mStackScreen = stackScreen;
Expand Down Expand Up @@ -167,7 +167,7 @@ void SettingsScreen::pushSettingsScreen()
/**
* A wrapper for iterating over flash modes
*/
char* SettingsScreen::getModeForIndex( int index)
const char* SettingsScreen::getModeForIndex( int index)
{
switch(index)
{
Expand Down Expand Up @@ -195,7 +195,7 @@ int SettingsScreen::getCurrentCamera()
/**
* Returns the selected flash mode
*/
char * SettingsScreen::getFLashMode()
const char * SettingsScreen::getFLashMode()
{
return getModeForIndex(flashModeIndex);
}
6 changes: 3 additions & 3 deletions examples/CameraDemo/SettingsScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class SettingsScreen : public ButtonListener

virtual void buttonClicked(Widget* button);

int initialize(StackScreen* stackScreen, CameraPreview* previewWidget);
void initialize(StackScreen* stackScreen, CameraPreview* previewWidget);

void pushSettingsScreen();

int getCurrentCamera();

char * getFLashMode();
const char * getFLashMode();

bool flashSupported;

Expand All @@ -68,7 +68,7 @@ class SettingsScreen : public ButtonListener

void createUI();

char * getModeForIndex(int index);
const char * getModeForIndex(int index);

Screen *mScreen;

Expand Down
4 changes: 2 additions & 2 deletions examples/CameraDemo/WidgetUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MA 02110-1301, USA.

/**
* @file WidgetUtil.h
* @author Mattias Frånberg and Chris Hughes
* @author Mattias Frånberg and Chris Hughes
*
* Implementation of basic utilities that get and set widget properties.
*/
Expand Down Expand Up @@ -46,7 +46,7 @@ int widgetSetPropertyInt(MAHandle handle, const char *property, int value)
{
char buffer[256];
sprintf(buffer, "%i", value);
maWidgetSetProperty( handle, property, buffer );
return maWidgetSetProperty( handle, property, buffer );
}

/**
Expand Down
10 changes: 5 additions & 5 deletions examples/CameraDemo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class AppScreen : public ButtonListener, public StackScreenListener
// Make the AppScreen listen for events coming from widgets.
//MAUtil::Environment::getEnvironment().addCustomEventListener(this);
char buffer[256];
int length = maCameraGetProperty(MA_CAMERA_MAX_ZOOM, buffer, 256);
maCameraGetProperty(MA_CAMERA_MAX_ZOOM, buffer, 256);
maxZoom = atoi(buffer);
createMainScreen();
mStackScreen = new StackScreen();
Expand Down Expand Up @@ -248,11 +248,11 @@ class AppScreen : public ButtonListener, public StackScreenListener
maCameraSelect(mSettingsScreen->getCurrentCamera());
mCameraPreview->bindToCurrentCamera();
maCameraSetProperty(
MA_CAMERA_FLASH_MODE,
mSettingsScreen->getFLashMode()
);
MA_CAMERA_FLASH_MODE,
mSettingsScreen->getFLashMode()
);
char buffer[256];
int length = maCameraGetProperty(MA_CAMERA_MAX_ZOOM, buffer, 256);
maCameraGetProperty(MA_CAMERA_MAX_ZOOM, buffer, 256);
maxZoom = atoi(buffer);

//Disable the zoom buttons if zoom is not supported
Expand Down
9 changes: 5 additions & 4 deletions examples/CameraDemo/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "HelloNativeUI"
@SOURCES = ['.']
@LIBRARIES = ['mautil', 'nativeui']
@EXTRA_LINKFLAGS = standardMemorySettings(11)
@NAME = 'CameraDemo'
end

work.invoke
12 changes: 12 additions & 0 deletions examples/DeviceFonts/workfile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/ruby

require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
@SOURCES = ['.']
@LIBRARIES = ['mautil']
@NAME = 'DeviceFonts'
end

work.invoke
13 changes: 13 additions & 0 deletions examples/DeviceFontsNativeUI/workfile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/ruby

require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
@SOURCES = ['.']
@LIBRARIES = ['mautil', 'nativeui']
@EXTRA_LINKFLAGS = standardMemorySettings(9) unless(USE_NEWLIB)
@NAME = 'DeviceFontsNativeUI'
end

work.invoke
2 changes: 1 addition & 1 deletion examples/Graphun/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
Expand Down
8 changes: 4 additions & 4 deletions examples/HelloMAUI/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
@SOURCES = ["."]
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil", "maui"]
@EXTRA_LINKFLAGS = " -datasize=256000 -heapsize=128000 -stacksize=16000"
@EXTRA_LINKFLAGS = " -datasize=256000 -heapsize=128000 -stacksize=16000" unless(USE_NEWLIB)
@NAME = "HelloMAUI"
end

Expand Down
5 changes: 3 additions & 2 deletions examples/HelloMap/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LSTFILES = ["Res/res.lst"]
@LIBRARIES = ["mautil", "map", "maui"]
@EXTRA_LINKFLAGS = standardMemorySettings(11)
@NAME = "HelloMap"
end

Expand Down
3 changes: 2 additions & 1 deletion examples/HelloNativeUI/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MA 02110-1301, USA.

/**
* @file main.cpp
* @author Mattias Frånberg and Chris Hughes
* @author Mattias Frånberg and Chris Hughes
*
* This application provides a very basic example of how to work
* with Native UI to position and and manipulate graphical user
Expand Down Expand Up @@ -77,6 +77,7 @@ class NativeUIMoblet : public Moblet
* This method is called when the application is closed.
*/
void NativeUIMoblet::closeEvent()
GCCATTRIB(noreturn)
{
// Deallocate the main screen.
delete mMainScreen;
Expand Down
7 changes: 4 additions & 3 deletions examples/HelloNativeUI/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
@SOURCES = ["."]
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil","nativeui"]
@EXTRA_LINKFLAGS = standardMemorySettings(11)
@NAME = "HelloNativeUI"
end

Expand Down
4 changes: 2 additions & 2 deletions examples/HelloOpenGLES/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "HelloOpenGLES"
Expand Down
4 changes: 2 additions & 2 deletions examples/HelloWorld/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "HelloWorld"
Expand Down
4 changes: 2 additions & 2 deletions examples/MAStx/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@EXTRA_CFLAGS = " -Wno-unreachable-code"
if(USE_NEWLIB)
Expand Down
5 changes: 3 additions & 2 deletions examples/MAUI/MAUIex/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/ruby

require File.expand_path('../../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@EXTRA_CPPFLAGS = " -Wno-shadow"
@LIBRARIES = ["mautil", "maui"]
@EXTRA_LINKFLAGS = standardMemorySettings(8) unless(USE_NEWLIB)
@NAME = "MAUIex"
end

Expand Down
2 changes: 1 addition & 1 deletion examples/MapDemo/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
Expand Down
4 changes: 2 additions & 2 deletions examples/MinUI/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@LIBRARIES = ["mautil"]
@NAME = "MinUI"
Expand Down
4 changes: 2 additions & 2 deletions examples/MoSketch/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@NAME = "MoSketch"
end
Expand Down
4 changes: 2 additions & 2 deletions examples/MoSound/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@NAME = "MoSketch"
end
Expand Down
4 changes: 2 additions & 2 deletions examples/MoTris/workfile.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require File.expand_path('../../rules/mosync_exe.rb')
require File.expand_path(ENV['MOSYNCDIR']+'/rules/mosync_exe.rb')

work = PipeExeWork.new
work.instance_eval do
work.instance_eval do
@SOURCES = ["."]
@EXTRA_CPPFLAGS = " -Wno-shadow"
@LSTFILES = ["Res/res.lst"]
Expand Down
Loading

0 comments on commit 8de3f42

Please sign in to comment.