Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone Support #2

Merged
merged 8 commits into from
Feb 29, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
build
Build
bin
Bin
deps
Deps
Makefile
56 changes: 56 additions & 0 deletions CMake/Modules/FindAllegro.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# - Try to find Allegro 5.0
# Once done, this will define
# ALLEGRO_INCLUDE_DIR - allegro.h etc.
# ALLEGRO_LIBRARIES - for linking
# ALLEGRO_FOUND - True if found
# ALLEGRO_DEFINITIONS - compiler switches used for Allegro

set(ALLEGRO_NAMES allegro allegro_acodec allegro_audio allegro allegro_color allegro_font allegro_image allegro_memfile allegro_primitives allegro_ttf allegro_shader)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND ALLEGRO_NAMES allegro_main)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ALLEGRO_SUFFIX "-5.1")
set(ALLEGRO_VERSION "-5.1.0")
set(ALLEGRO_WIN32_FLAVOR "-mt")

# use pkg-config
find_package(PkgConfig)
if(PkgConfig_FOUND)
foreach(ALLEGRO_SPECIFIC_LIB ${ALLEGRO_NAMES})
pkg_check_modules(PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB} REQUIRED ${ALLEGRO_SPECIFIC_LIB}${ALLEGRO_SUFFIX})
list(APPEND ALLEGRO_DEFINITIONS ${PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_CFLAGS_OTHER})
string(COMPARE EQUAL "${PC_ALLEGRO_INCLUDE_DIRS}" "${PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_INCLUDE_DIRS}" INC_ALREADY_ADDED)
string(COMPARE EQUAL "${PC_ALLEGRO_LIBRARY_DIRS}" "${PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_LIBRARY_DIRS}" LIB_ALREADY_ADDED)
if(INC_ALREADY_ADDED)
else(INC_ALREADY_ADDED)
list(APPEND PC_ALLEGRO_INCLUDE_DIRS ${PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_INCLUDE_DIRS})
endif(INC_ALREADY_ADDED)
if(LIB_ALREADY_ADDED)
else(LIB_ALREADY_ADDED)
list(APPEND PC_ALLEGRO_LIBRARY_DIRS ${PC_ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_LIBRARY_DIRS})
endif(LIB_ALREADY_ADDED)
endforeach(ALLEGRO_SPECIFIC_LIB)
endif(PkgConfig_FOUND)

# use pkg-config returns as hints to find include directory
find_path(ALLEGRO_INCLUDE_DIRS allegro5/allegro.h
HINTS ${PC_ALLEGRO_INCLUDEDIR} ${PC_ALLEGRO_INCLUDE_DIRS} "${PROJECT_SOURCE_DIR}/Deps/include" "$ENV{ALLEGRO_HOME}/include" "$ENV{EXTDEV}/include" "$ENV{EPREFIX}/include" "$ENV{PREFIX}/include" "/usr/include" "/usr/local/include"
)

# use pkg-config returns as hints to find lib directory
foreach(ALLEGRO_SPECIFIC_LIB ${ALLEGRO_NAMES})
find_library(ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_LIB
NAMES ${ALLEGRO_SPECIFIC_LIB} ${ALLEGRO_SPECIFIC_LIB}${ALLEGRO_SUFFIX} ${ALLEGRO_SPECIFIC_LIB}${ALLEGRO_VERSION} ${ALLEGRO_SPECIFIC_LIB}${ALLEGRO_VERSION}${ALLEGRO_WIN32_FLAVOR} ${ALLEGRO_SPECIFIC_LIB}-static
HINTS ${PC_ALLEGRO_LIBDIR} ${PC_ALLEGRO_LIBRARY_DIRS} "${PROJECT_SOURCE_DIR}/Deps/lib" "$ENV{ALLEGRO_HOME}/lib" "$ENV{EXTDEV}/lib" "$ENV{EXTDEV}/lib/MSVC" "$ENV{EXTDEV}/lib/MinGW" "$ENV{EXTDEV}/lib/BCC" "$ENV{EPREFIX}/lib" "$ENV{PREFIX}/lib" "/usr/lib" "/usr/local/lib"
)
list(APPEND ALLEGRO_LIBRARY ${ALLEGRO_${ALLEGRO_SPECIFIC_LIB}_LIB})
endforeach(ALLEGRO_SPECIFIC_LIB)

set(ALLEGRO_LIBRARIES "${ALLEGRO_LIBRARY}")
set(ALLEGRO_INCLUDE_DIR "${ALLEGRO_INCLUDE_DIRS}")

include(FindPackageHandleStandardArgs)
# handle QUIETLY and REQUIRED args and set ALLEGRO_FOUND to TRUE if all listed variables are TRUE
find_package_handle_standard_args(Allegro DEFAULT_MSG ALLEGRO_LIBRARY ALLEGRO_INCLUDE_DIRS)

mark_as_advanced(ALLEGRO_INCLUDE_DIRS ALLEGRO_LIBRARY)
89 changes: 89 additions & 0 deletions CMake/Modules/FindFreetype.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#Modified for Convenience from CMake's Existing Detection. Do not modify.

# - Locate FreeType library
# This module defines
# FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
# $FREETYPE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$FREETYPE_DIR
# used in building FREETYPE.

#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)

# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.

# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
HINTS
$ENV{FREETYPE_DIR}/include
$ENV{FREETYPE_DIR}
PATHS
/usr/local/X11R6/include
/usr/local/X11/include
/usr/freeware/include
)

FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
HINTS
$ENV{FREETYPE_DIR}/include/freetype2
PATHS
/usr/local/X11R6/include
/usr/local/X11/include
/usr/freeware/include
PATH_SUFFIXES freetype2
)

FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
HINTS
$ENV{FREETYPE_DIR}
PATH_SUFFIXES lib64 lib
PATHS
/usr/local/X11R6
/usr/local/X11
/usr/freeware
)

# set the user variables
IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")

# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
#include(FindPackageHandleStandardArgs)
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)


MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)
56 changes: 44 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,68 @@ include_directories(
file(GLOB_RECURSE SOURCES "src/*.c")
if(NOT USE_INTERNAL_LIB)
set(EXAMPLE_DATA "DejaVuSans.ttf")

set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -g")

include(FindPkgConfig)
set(ENV{FREETYPE_DIR} Deps)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/Modules")
find_package(Allegro REQUIRED)
include_directories(${ALLEGRO_INCLUDE_DIR})
find_package(Freetype REQUIRED)
set(WZ_ALLEGRO_LDFLAGS ${ALLEGRO_LIBRARIES} ${FREETYPE_LIBRARIES})

if(WIN32)
set(EXECUTABLE_TYPE "WIN32")
set(WZ_ALLEGRO_LDFLAGS -lallegro_ttf -lallegro_font -lallegro -lallegro_primitives)
else(WIN32)
pkg_check_modules(WZ_ALLEGRO REQUIRED allegro_primitives-5.0 allegro_ttf-5.0)
endif(WIN32)

if(APPLE)
set(WANT_X11 off)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
if(IPHONE)
set(WZ_ALLEGRO_LDFLAGS ${WZ_ALLEGRO_LDFLAGS} "-framework CoreGraphics -framework QuartzCore -framework UIKit -framework Foundation -framework CoreFoundation -framework OpenGLES -framework OpenAL -lm")
set(SDKROOT "iphoneos")
set(CMAKE_OSX_SYSROOT "${SDKROOT}")
add_definitions(-DIPHONE)
else(IPHONE)
set(WZ_ALLEGRO_LDFLAGS ${WZ_ALLEGRO_LDFLAGS} "-framework Cocoa -framework QuartzCore -framework Foundation -framework CoreFoundation -framework OpenGL -framework IOKit -framework AudioToolbox -framework OpenAL -lm")
add_definitions(-DAPPLE)
endif(IPHONE)
endif(APPLE)

add_custom_target(example_data ALL DEPENDS ${EXAMPLE_DATA})

if(NOT IPHONE)
foreach(file ${EXAMPLE_DATA})
add_custom_command(
OUTPUT ${file}
COMMAND "${CMAKE_COMMAND}" -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/${file}" "${file}"
)
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${file}" "${file}"
)
endforeach(file)
endif(NOT USE_INTERNAL_LIB)
endif(NOT IPHONE)
add_library(widgetz ${SOURCES})
if(NOT USE_INTERNAL_LIB)
target_link_libraries(widgetz ${WZ_ALLEGRO_LDFLAGS})
add_executable(example "example/example.c")
target_link_libraries(example widgetz ${WZ_ALLEGRO_LDFLAGS})
if(IPHONE)
add_executable(example MACOSX_BUNDLE "example/example.c")
set_target_properties(example PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.widgetz.example")
set_target_properties(example PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
set(APP_RES_DIR \${TARGET_BUILD_DIR}/\${FULL_PRODUCT_NAME})
foreach(file ${EXAMPLE_DATA})
add_custom_command(
TARGET example
POST_BUILD
COMMAND mkdir -p ${APP_RES_DIR} &&
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -resolve-src-symlinks "${CMAKE_CURRENT_SOURCE_DIR}/${file}" ${APP_RES_DIR} &&
echo "Copied Data to Bundle."
)
endforeach(file)
else(IPHONE)
add_executable(example "example/example.c")
endif(IPHONE)

target_link_libraries(example widgetz ${WZ_ALLEGRO_LDFLAGS})
install(DIRECTORY "${WIDGETZ_SOURCE_DIR}/include/widgetz" DESTINATION include)
install(TARGETS widgetz ARCHIVE DESTINATION lib)
else(NOT USE_INTERNAL_LIB)
add_library(widgetz ${SOURCES})
target_link_libraries(widgetz ${ALLEGRO_LIBRARIES})
endif(NOT USE_INTERNAL_LIB)
endif(NOT USE_INTERNAL_LIB)
45 changes: 28 additions & 17 deletions example/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ int main(int argc, char *argv[])
ALLEGRO_FONT *font;
ALLEGRO_EVENT_QUEUE *queue;
int refresh_rate;
float size=1.0;
int font_size=18;
double fixed_dt;
double old_time;
double game_time;
Expand All @@ -48,17 +50,25 @@ int main(int argc, char *argv[])
al_init_font_addon();
al_init_primitives_addon();
al_init_ttf_addon();
#ifdef IPHONE
size=0.5;
al_set_new_display_option(ALLEGRO_SUPPORTED_ORIENTATIONS, ALLEGRO_DISPLAY_ORIENTATION_LANDSCAPE, 1);
display = al_create_display(0, 0);
#else //IPHONE
display = al_create_display(1000, 600);
#endif //IPHONE
al_install_keyboard();
// Load a font
font = al_load_font("DejaVuSans.ttf", 18, 0);
font = al_load_font("DejaVuSans.ttf", font_size*size, 0);

al_install_mouse();

// Start the event queue to handle keyboard input and our timer
queue = al_create_event_queue();
al_register_event_source(queue, al_get_keyboard_event_source());
al_register_event_source(queue, al_get_mouse_event_source());
if (al_install_touch_input())
al_register_event_source(queue, al_get_touch_input_event_source());

refresh_rate = 60;
fixed_dt = 1.0f / refresh_rate;
Expand All @@ -69,7 +79,8 @@ int main(int argc, char *argv[])
Define custom theme
wz_def_theme is a global vtable defined by the header
*/
theme = wz_def_theme;
memset(&theme, 0, sizeof(theme));
memcpy(&theme, &wz_def_theme, sizeof(theme));
theme.font = font;
theme.color1 = al_map_rgba_f(0, 0.3, 0, 1);
theme.color2 = al_map_rgba_f(1, 1, 0, 1);
Expand All @@ -83,27 +94,27 @@ int main(int argc, char *argv[])
/*
Define all other gui elements, fill_layout is an automatic layout container
*/
wz_create_fill_layout(gui, 50, 50, 300, 450, 50, 20, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);
wz_create_fill_layout(gui, 50*size, 50*size, 300*size, 450*size, 50*size, 20*size, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);

wz_create_textbox(gui, 0, 0, 200, 50, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Welcome to WidgetZ!"), 1, -1);
wz_create_toggle_button(gui, 0, 0, 200, 50, al_ustr_new("Toggle 1"), 1, 1, 5);
wz_create_toggle_button(gui, 0, 0, 200, 50, al_ustr_new("Toggle 2"), 1, 1, 6);
wz_create_toggle_button(gui, 0, 0, 200, 50, al_ustr_new("Toggle 3"), 1, 1, 7);
wz_create_textbox(gui, 0*size, 0*size, 200*size, 50*size, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Welcome to WidgetZ!"), 1, -1);
wz_create_toggle_button(gui, 0*size, 0*size, 200*size, 50*size, al_ustr_new("Toggle 1"), 1, 1, 5);
wz_create_toggle_button(gui, 0*size, 0*size, 200*size, 50*size, al_ustr_new("Toggle 2"), 1, 1, 6);
wz_create_toggle_button(gui, 0*size, 0*size, 200*size, 50*size, al_ustr_new("Toggle 3"), 1, 1, 7);

wgt = (WZ_WIDGET*)wz_create_button(gui, 0, 0, 200, 50, al_ustr_new("Quit"), 1, 1);
wgt = (WZ_WIDGET*)wz_create_button(gui, 0*size, 0*size, 200*size, 50*size, al_ustr_new("Quit"), 1, 1);
wz_set_shortcut(wgt, ALLEGRO_KEY_Q, ALLEGRO_KEYMOD_CTRL);

wz_create_fill_layout(gui, 350, 50, 300, 450, 50, 20, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);
wz_create_fill_layout(gui, 350*size, 50*size, 300*size, 450*size, 50*size, 20*size, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);

wz_create_textbox(gui, 0, 0, 200, 50, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Scroll Bars:"), 1, -1);
wz_create_scroll(gui, 0, 0, 200, 50, 20, 9);
wz_create_scroll(gui, 0, 0, 50, 200, 20, 9);
wz_create_scroll(gui, 0, 0, 50, 200, 20, 9);
wz_create_textbox(gui, 0*size, 0*size, 200*size, 50*size, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Scroll Bars:"), 1, -1);
wz_create_scroll(gui, 0*size, 0*size, 200*size, 50*size, 20*size, 9);
wz_create_scroll(gui, 0*size, 0*size, 50*size, 200*size, 20*size, 9);
wz_create_scroll(gui, 0*size, 0*size, 50*size, 200*size, 20*size, 9);

wz_create_fill_layout(gui, 650, 50, 300, 450, 20, 20, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);
wz_create_textbox(gui, 0, 0, 200, 50, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Edit Box:"), 1, -1);
wgt = (WZ_WIDGET*)wz_create_editbox(gui, 0, 0, 200, 50, al_ustr_new("Type here..."), 1, -1);
wz_create_textbox(gui, 0, 0, 200, 50, WZ_ALIGN_LEFT, WZ_ALIGN_TOP, al_ustr_new("A textbox with a lot of text"
wz_create_fill_layout(gui, 650*size, 50*size, 300*size, 450*size, 20*size, 20*size, WZ_ALIGN_CENTRE, WZ_ALIGN_TOP, -1);
wz_create_textbox(gui, 0*size, 0*size, 200*size, 50*size, WZ_ALIGN_CENTRE, WZ_ALIGN_CENTRE, al_ustr_new("Edit Box:"), 1, -1);
wgt = (WZ_WIDGET*)wz_create_editbox(gui, 0*size, 0*size, 200*size, 50*size, al_ustr_new("Type here..."), 1, -1);
wz_create_textbox(gui, 0*size, 0*size, 200*size, 50*size, WZ_ALIGN_LEFT, WZ_ALIGN_TOP, al_ustr_new("A textbox with a lot of text"
" in it. Also supports new lines:\n\nNew paragraph.\n"
"Also supports unicode:\n\n"
"Привет"), 1, -1);
Expand Down
27 changes: 15 additions & 12 deletions include/widgetz/widgetz.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ A struct that defines a bunch of rendering functions to render various types of
*/
typedef struct WZ_THEME
{
void (*draw_button)(struct WZ_THEME* theme, float x, float y, float w, float h, ALLEGRO_USTR* text, int style);
void (*draw_box)(struct WZ_THEME* theme, float x, float y, float w, float h, int style);
void (*draw_textbox)(struct WZ_THEME* theme, float x, float y, float w, float h, int halign, int valign, ALLEGRO_USTR* text, int style);
void (*draw_scroll)(struct WZ_THEME* theme, float x, float y, float w, float h, float fraction, int style);
void (*draw_editbox)(struct WZ_THEME* theme, float x, float y, float w, float h, int cursor_pos, ALLEGRO_USTR* text, int style);
void (*draw_image)(struct WZ_THEME* theme, float x, float y, float w, float h, ALLEGRO_BITMAP* image);
int pad;
void (*const draw_button)(struct WZ_THEME* theme, float x, float y, float w, float h, ALLEGRO_USTR* text, int style);
void (*const draw_box)(struct WZ_THEME* theme, float x, float y, float w, float h, int style);
void (*const draw_textbox)(struct WZ_THEME* theme, float x, float y, float w, float h, int halign, int valign, ALLEGRO_USTR* text, int style);
void (*const draw_scroll)(struct WZ_THEME* theme, float x, float y, float w, float h, float fraction, int style);
void (*const draw_editbox)(struct WZ_THEME* theme, float x, float y, float w, float h, int cursor_pos, ALLEGRO_USTR* text, int style);
void (*const draw_image)(struct WZ_THEME* theme, float x, float y, float w, float h, ALLEGRO_BITMAP* image);
ALLEGRO_FONT*(*get_font)(struct WZ_THEME* theme, int font_num);
} WZ_THEME;

Expand All @@ -40,12 +41,6 @@ typedef struct WZ_DEF_THEME
{
WZ_THEME theme;

/*
Variable: font
Font to use for this GUI
*/
ALLEGRO_FONT* font;

/*
Variable: color1
The background color
Expand All @@ -56,6 +51,14 @@ typedef struct WZ_DEF_THEME
The foreground color
*/
ALLEGRO_COLOR color2;

/*
Variable: font
Font to use for this GUI
*/
ALLEGRO_FONT* font;
int pad[3];

} WZ_DEF_THEME;

typedef struct WZ_SHORTCUT
Expand Down
1 change: 1 addition & 0 deletions src/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ The default theme.
const WZ_DEF_THEME wz_def_theme =
{
{
0,
wz_def_draw_button,
wz_def_draw_box,
wz_def_draw_textbox,
Expand Down
9 changes: 9 additions & 0 deletions src/widgets/box.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ int wz_box_proc(WZ_WIDGET* wgt, ALLEGRO_EVENT* event)
ret = 0;
break;
}
case ALLEGRO_EVENT_TOUCH_BEGIN:
{
if (wz_widget_rect_test(wgt, event->touch.x, event->touch.y))
{
wz_ask_parent_for_focus(wgt);
}
ret = 0;
break;
}
case WZ_DRAW:
{
if (wgt->flags & WZ_STATE_HIDDEN)
Expand Down
Loading