Compare commits

...

486 Commits

Author SHA1 Message Date
Chris Michael 46d35dd75e ecore-wl2: Always create cursor surface for pointer
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 11:40:27 -05:00
Mike Blumenkrantz 240f817ba5 ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-12-03 11:36:56 -05:00
Chris Michael 9e9b5d6b31 ecore-evas-wl: Fix issue of resize jumping
Summary: When an initial client application was shown and we tried to
resize it, the resize would jump by the amount of framespace. This was
because the xdg_surface@configure event would be sending window
geometry as the width/height params in the event. We need to account
for that in the callback of window configure and adjust size
accordingly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 11:36:56 -05:00
Chris Michael 85381ee839 ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 11:33:29 -05:00
Subodh Kumar 8273f35269 Edje entry: Use markup text for password in preedit mode
Summary:
Use markup text for password in preedit mode

Problem is that when text comes in preedit mode
it is always markup text and when it is committed
to entry it got committed with markup tags along with
the original string, so for preedit mode password
should be filtered all markup to set the proper text.

@fix

Test Plan:
In preedit mode, enter any character say 'A'
preedit markup like <preedit>A</preedit>
will come in preedit changed callback

Result: Text is set as plain text like below
&lt;preedit&gt;A&lt;/preedit&gt;

Reviewers: thiepha, jihoon, herdsman, shilpasingh, tasn

Reviewed By: shilpasingh, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2929
2015-12-03 11:31:08 -05:00
Jean-Philippe Andre 864fed5fef Ector: Fix Windows build (missed in previous patch) 2015-12-03 11:31:08 -05:00
Jean-Philippe Andre d61189fa4b Ector: use uint32_t instead of uint
This fixes the build for Windows. Thanks @vtorri for the report.

I'm not using "unsigned int" as uint was mostly used like DATA32,
ie. color data (one pixel color or a pixel buffer).
2015-12-03 11:31:08 -05:00
Shilpa Singh 2d7058d4d4 edje_entry: Fix crash on selection
Summary:
When text is selected, crash happens due to double free as rectangles are freed both in _sel_update
and _evas_textblock_selection_iterator_free hence removing free from _sel_update.

@fix T2910

Test Plan:
1. Launch elementary test
2. launch entry demo
3. select text

Reviewers: cedric, herdsman

Subscribers: jpeg

Maniphest Tasks: T2910

Differential Revision: https://phab.enlightenment.org/D3401
2015-12-03 11:31:08 -05:00
Jean-Philippe Andre 9be52172cb Ector: Kill compilation warnings
Remove unimplemented function (no test case yet).
Convert #warning into comments.
2015-12-03 11:31:08 -05:00
Jean-Philippe Andre 26f6ef7ae9 Evas: Move alpha functions to static_libs/draw
This is a pretty simple code refactor, moving pixel handling
to the new draw lib.
2015-12-03 11:31:08 -05:00
Jean-Philippe Andre 24b1b54bbf Ector: Move cairo surface back to ector
The original plan was to have two different surfaces for GL and SW,
but this is probably not going to happen anytime soon. So, move
the implementation back to lib/ector. This avoid a file duplication.
2015-12-03 11:31:08 -05:00
Jean-Philippe Andre c9456e3cfe Ector: Rename C files to match their EO counterparts 2015-12-03 11:31:08 -05:00
Jean-Philippe Andre 389986a263 Ector: Another minor code cleanup
Remove DATA8, DATA16, DATA32
Remove empty data structure
Remove unnecessary typedef
2015-12-03 11:31:07 -05:00
Jean-Philippe Andre 9b18d0d8a2 Ector: Move drawhelper to static_libs
Rename a few things:
 - draw helper -> efl_draw
 - Ector_Rop -> Efl.Gfx.Render_Op
 - ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
 - ector_memfill -> draw_memset32 (and invert arg order to match memset)

The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
2015-12-03 11:31:07 -05:00
Jean-Philippe Andre 77a310b18e Ector: Use Ector Buffer inside SW and Cairo renderers
Ector Surface now inherits from Ector Buffer, and the current
two renderers (SW and Cairo SW) use Ector.Software.Buffer
implementations for pixel surfaces.

Basic pixel handling is merged and will allow easy extension
(color conversion, etc...).

Buffer classes are Mixins to be fully implemented by the final
class, such as: Ector.Software.Buffer, Ector.Software.Surface
or Ector.Cairo.Surface.

This is a large ugly commit. Sorry.
The code is quite a mess right now.
2015-12-03 11:31:07 -05:00
Jean-Philippe Andre a8e853a1e9 Ector: Implement pixel buffer support
The objective of this patch is to propose a standardized
format for pixel buffers to use within Ector and Evas.

The basic EO API provided here is not meant to be the
fastest path for all operations, simply the most convenient
to generalize. Performance will be achieved by implementing
(or porting) custom draw functions.

This implements support for:
- Generic pixel buffers
- Generic buffer renderer to draw images with ector
- Software engine pixel buffers, ie. malloc buffers
- Software buffer renderer

Cairo support has not been implemented yet.

The only renderer is still extremely limited, as it does not
support Fill modes, Scaling, etc... yet.

Not a single line from this patch has been tested yet.
It compiles. That's pretty damn good for a start!

@feature
2015-12-03 11:31:07 -05:00
Vivek Ellur 86116ab18c Eio: Fixes T2831, eio xattr tests failing
Summary:
@Fix
The eio_file_xattr test was failing in jenkins, so added a new callback
and moved the check condition to callback. The condition is checked
only when it is successfully executed

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric, stefan_schmidt

Subscribers: jpeg, cedric

Maniphest Tasks: T2831

Differential Revision: https://phab.enlightenment.org/D3400
2015-12-03 11:31:07 -05:00
Daniel Hirt ba08cdcdce Edje entry: emit "selection,reset"
Adding a check for the selection range on extend/preextend.
If there is no range, then emit "selection,reset".
Expected handling on the theme end for this signal is to show the
cursor.

This improves cursor visuals, as it will show the cursor again once the
selection range ends up being 0.
2015-12-03 11:31:07 -05:00
Jaeun Choi 82903da150 evas: rewrite gl image transformation logic in a very simple way
all we need to do for image transformation such as rotation or flipping in gl
is to map the vertices of source image to destination in a changed order.
this commit not only enhances readability but also fixes bugs in rotation.

@fix
2015-12-03 11:31:07 -05:00
Amitesh Singh 9c6ea9d70f edje: fix edje RTL description in case of custom state of a part
Summary:
In case of RTL, the "custom" state properties does not apply. It happened because we don't copy the latest src to
dst in set_state(PART:.., "custom", 0.0); in case of dst is already populated.
We should copy the updated src to dst whenever we set the new custom description.

@fix

Reviewers: cedric, raster, jpeg, zmike, jaehwan

Subscribers: kimcinoo, seoz, jpeg

Differential Revision: https://phab.enlightenment.org/D3394
2015-12-03 11:31:07 -05:00
Oleksandr Shcherbina 33af9c0210 evas: set visible texcolorpick texture in 3D shaders
Summary:
Add uniform varialble uColorTexture. Generate sampler count for textcolorpick
and pass to renderer for bind additional texture unit to gl.
It can be used for different 3D effects - blur, wave distortion, heat haze, etc.
T2761

Reviewers: Hermet, raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3372

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:07 -05:00
Jee-Yong Um 8fd1ed5c7e edje: add missing EAPI keyword for edje_color_class_del
Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3398

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:07 -05:00
jiin.moon 83389ec869 ecore_evas: fix disappearing socket image
Summary:
In case there is connection between a server and some client,
show/hide does not work properly.

If there are clients need to show,
this patch make it hide operation will not work even if get the hide signal

@fix

Reviewers: jypark, Hermet, cedric

Subscribers: Hermet, cedric

Differential Revision: https://phab.enlightenment.org/D2962

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:07 -05:00
se.osadchy f8e7f0d2ac evas: fix bug with logic with eina_matrix in evas_3d_utils
Summary: Also need to fix logically dead code in coverity.

Reviewers: raster, Hermet, cedric

Subscribers: jpeg

Maniphest Tasks: T2832

Differential Revision: https://phab.enlightenment.org/D3346

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:07 -05:00
perepelits.m 77b3975640 edje: Remove redondant array in Evas 3D edd (part2)
Summary: There are more redundant arrays to be deleted. In fact I don't think string name of descriptor shouldn't never change, I was testing some 2D examples and this is not true.

Reviewers: raster, jpeg, cedric

Subscribers: artem.popov, cedric

Differential Revision: https://phab.enlightenment.org/D3361

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:07 -05:00
Cedric BAIL 89a4fa17f1 evas: properly clean up all memory. 2015-12-03 11:31:07 -05:00
Cedric BAIL d44b524e7a evas: fix double free.
The ownership of this list and its content belong to the iterator. This code
was actively double freeing and our test suite doesn't crash or have any issue...
Well actually it was complaining that the list had error, but due to our other
false positive test that do trigger eina log, we continuously ignored this error.

NOTE: The fact that the test rely also on the container of the iterator instead
of the iterator itself is not that great to. I kind of feel bad now for having
allowed access to the container. We should have been able to allow changing the
logic to generate those rectangle step after step instead of in one go. Now this
seems difficult.
2015-12-03 11:31:07 -05:00
Daniel Hirt 5b0c8d8606 Evas textblock: fix height on line wrapping
Line advance should finalize the line with its last item, and not the
item we're currently wrapping. This fixes T1583, where some line
wrapping cases would look different than their equivalent <ps>
versions.

@fix
2015-12-03 11:31:07 -05:00
Carsten Haitzler e2db06f11f fix efreetd to scan more subdirs for desktop and icon files
we miss desktop files for apps and stuff because we dont monitor too
deep a tree. this ups our tree depth to 10 levels.

@fix
2015-12-03 11:31:06 -05:00
Carsten Haitzler a87eb94ffe efreet desktop tracking - fix monitoring of dirs of custom desktops
@fix

this is wrong - start monitoring every/any dir in which a desktop file
exists that we load a desktop file from. imagine you browse directories
in efm with lots of desktop files in them - we end up monitoring lots
of directories that we then rememebr and don't un-monitor. this
disables monitoring of dirs from which we load a .desktop file from to
fix this.
2015-12-03 11:31:06 -05:00
Stefan Schmidt 0daa4a0156 build: fix distcheck after model saver and loader rework
32c33ed64d broke distcheck here as the header
files would not be included in the generated tarballs. This is the second or
third time I fixed soemthing like this after a loader/saver rework. I would
appreciate if the people involved would run distcheck on their own.
2015-12-03 11:31:06 -05:00
Youngbok Shin b458cca08c Evas Textblock: Fix text disappear issue when text is made up with multiple items.
Summary:
Text is disappearing when we resize a singleline Evas Textblock with ellipsis.
It is happened by putting a Text item at logical_items list without considering about logical position.
It is only happended the text is made up with multiple items.
@fix

Test Plan:
1. Run elementary_test
2. Click Label Ellipsis
3. Resize the window dynamically and see the result.

Reviewers: woohyun, tasn, herdsman

Subscribers: jpeg, subodh6129, shilpasingh, cedric

Maniphest Tasks: T2709

Differential Revision: https://phab.enlightenment.org/D3022
2015-12-03 11:31:06 -05:00
Amitesh Singh 0dd1a9144c evas_gl_shader: refractor shader/program compile check code.
Summary:
    Call respective shader/program functions on shader/program target only.

Reviewers: cedric, raster, wonsik, spacegrapher, jpeg

Reviewed By: jpeg

Subscribers: alok25, sachin.dev, cedric, seoz

Differential Revision: https://phab.enlightenment.org/D3388
2015-12-03 11:31:06 -05:00
Carsten Haitzler 9ef7237aa3 edje cc fix - we parsed floats not intsfor min and max desc size
thanks conr2d for pointing this out - we uses the float parse func and
not in parse. we should use int parse as the min and max sizes are
just ints and not floats. :)

@fix
2015-12-03 11:31:06 -05:00
perepelits.m d912777476 evas: refactor model's savers and loaders.
Summary:
Move common part to a separated document.
Make code more readable using smaller functions. (from Task T2713)

Reviewers: cedric, raster, Hermet

Subscribers: artem.popov

Differential Revision: https://phab.enlightenment.org/D3373
2015-12-03 11:31:06 -05:00
Youngbok Shin 5edc57156b efl: fix build failure when it builds with coverage.
Summary:
When src/bin/efl/ builds with [--with-tests=coverage], it fails to find gcov lib.
The gcov/lcov related options has to be passed when it is builded.
And it only contained in EFL_CFLAGS, EFL_LIBS.
@fix

Test Plan:
Be sure the your enviroments to build src/bin/efl/.

1. Run ./autogen.sh --with-tests=coverage
2. make or make check
3. See the build errors.

Reviewers: raster, jpeg, cedric

Reviewed By: cedric

Subscribers: herdsman

Differential Revision: https://phab.enlightenment.org/D3370

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Youngbok Shin 39e8f1824e evas: fix a NULL dereference issue in font.
Summary:
eina_list_remove returns Eina_List pointer.
It could be NULL if the last list item is removed.
And the returned Eina_List pointer could be different from the given list.
So, calling free for fdir->data after fdir's address is changed is dangerous.
@fix

Test Plan: Run expedite or test app with evas_font_path_append() API.

Reviewers: stefan_schmidt, jpeg

Reviewed By: jpeg

Subscribers: stefan, jiin.moon, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3392

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jee-Yong Um 8c3af8ef19 edje: add mising closing brace and adjust indents and spacing in test edc
Summary: A closing brace is missing, and indent is not aligned.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3387

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Vincent Torri 8955c24424 evil: better check of Windows 64 bits
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 2ca03d4566 ecore_cocoa: fix live resize of windows
This was a tricky little bastard!
When a window is live resized, the NSWindow which is the target of
the live resize will wait for a kevent from the window manager,
until live resizing is done. So... live resizing is synchronous
and blocks the main thread... hence ecore_main_loop.

- When live resize starts, the Ecore_Timer which polls NSRunLoop
is paused.
- When the window is resized, the ecore_main_loop is run manually
with ecore_main_loop_iterate() to process Ecore events (mostly
Ecore_Evas)
- When live resize finished, the Ecore_Timer which polls NSRunLoop
is resumed.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 16bf841884 ecore_cocoa_app: don't override init
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h a1951db500 ecore_cocoa: don't make ecore_cocoa_feed_events() a public API
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 5e1c926818 ecore_cocoa: NSApp must be configured in the App wrapper
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 931ff41168 ecore_cocoa_window: cosmetic changes
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 667fe4dc8d ecore_cocoa: don't export Ecore_Cocoa_Keys.h
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 13560ef285 ecore_x: factorize multiple calls to strlen()
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:06 -05:00
Jean Guyomarc'h 908b97243e ecore_cocoa: factorize code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h d9540fd2dd evas_gl_cocoa: make sure focus is always unlocked after locking it
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h ae305761e0 ecore_cocoa_cnp: make API thread-safe
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h ba73c40fdb ecore_cocoa_cnp: clear the clipboard only if writable
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h c6e038f740 ecore_cocoa: NSEvent modifiers are of type NSUInteger
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 83ba75ccd6 ecore_evas_cocoa: factorize code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h fe3a1ac654 ecore_cocoa: report error when [super init] fails
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 3a1502d16a ecore_evas_cocoa: remove dead code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h ca5d75c5b8 ecore_cocoa: remove EINA_UNUSED because parameter is used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 04a1d91c2f ecore_cocoa: remove debug log
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 9bf5d669ec ecore_cocoa: reindent file
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 36ab03290d ecore_cocoa: add more safety checks
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 79447403a0 ecore_cocoa: remove EINA_UNUSED because parameter is actually used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h b8f34dfcd8 ecore_cocoa: prevent Ecore_Cocoa_Window to be re-defined
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 49ba44f64b ecore_cocoa: remove ECORE_COCOA_EVENT_EXPOSE
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h 889411bcf9 ecore_cocoa: remove unused events 2015-12-03 11:31:05 -05:00
Jean Guyomarc'h ca577a1c9d ecore_cocoa: start doxygen
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h b53049d898 ecore_evas_cocoa: focus: handle ignore_events
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h f2bb88ad1e ecore_cocoa: don't track NSAppKitDefined event
Currently, it was used only to get track of focus, howver focus was
already handled (and better) in ecore_cocoa_window (with
NSWindowDelegate).
This led to the LOST_FOCUS event to be posted twice, with different
values, which messed up the focus stack.

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:05 -05:00
Jean Guyomarc'h d07ad96727 ecore_evas_cocoa: don't reset the init count if negative
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h bf837a9763 ecore_evas_cocoa: use Eina macro to determine the size of a static array
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h aa85457d71 ecore_evas_cocoa: don't shutdown ecore_event_evas() twice
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 87195c41ea ecore_evas_cocoa: EAPI cannot be set for WIN32
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h da20ed38d4 ecore_cocoa: fix types
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h ccd2817776 ecore_evas_cocoa: remove dead code
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h d944184ff7 ecore_cocoa: copy and paste support
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 4cf61ad918 ecore_cocoa: silent warning: unused parameter 2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 1753e42639 ecore_cocoa: use EAPI in implementation 2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 28b31c4f14 ecore_cocoa: improve const-correctness 2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 6e1054f897 ecore_cocoa: don't specify inline
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:04 -05:00
Jean Guyomarc'h 389c88529f ecore_cocoa: add support for system cursors
- Ecore_Cocoa_Cursor enum which references system cursors;
- API to show/hide cursor: ecore_cocoa_window_cursor_show();
- API to set system cursor: ecore_cocoa_window_cursor_set();
- Ecore_Evas interface to get Ecore_Cocoa_Window from Ecore_Evas.

@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:31:01 -05:00
Vincent Torri 7eed6d062d ecore_win32: add support of X11 shaped cursors
@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Vincent Torri 9dd8d8e3b4 ecore_win32: add clipboard management
@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Vincent Torri 8ee8eaf526 eina: use eina_file_path_join() and eina_environment_tmp_get() when needed
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Vincent Torri de6b7acbaf ecore_file: fix ecore_file_file_get() on Windows
@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Subhransu Mohanty cc20e01b4a efl: change efl_gfx_shape_cubic_to() api signature to follow other API (cairo and freetype).
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Subhransu Mohanty d1125c11a9 efl: updated efl_gfx_shape_dup() implementation to use direct access to internal data.
As I don't see the use of inheritance for stroke anymore, we will use internal access
rather than inherited get/set function. This behavior can be reverted if anyone find
a real use case for it.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Subhransu Mohanty d5303bec8b efl: add bookkeeping for convex shapes.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Subhransu Mohanty c47925c13a efl: update append_rect implementation.
This now generate more optimized path by reducing the use of arc and
switching to only line whenever possible.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:14 -05:00
Subhransu Mohanty 1252a022b1 efl: update append_circle implementation to use _efl_gfx_shape_append_arc.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:13 -05:00
Subhransu Mohanty 887bd798a2 efl: add alternative append_arc implementation
This allow to reduce the number of generated arc, but doesn't follow
SVG specification. This is just used internally and can't be used by
outside call.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:13 -05:00
Subhransu Mohanty e1f57a1173 eina: add new api eina_bezier_on_interval()
I couldn't come up with a better name, if anyone has a suggestion.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:13 -05:00
Cedric BAIL c461aa04b8 eina: fix bad use of calloc. 2015-12-03 11:30:13 -05:00
Jean Guyomarc'h 0e8b48aa8e eina: fix missing header
This caused functions from eina_util to be undefined at compile time.
The compiler would make implicit casts of return values into ints,
which had major side effects (e.g. segfault edje_cc)

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-03 11:30:13 -05:00
Stefan Schmidt d01d7a9159 evas_3d_utils: do not bitwise AND against 0 in condition
We need to check against the state here and if the compilers assignes 0 to the
first item in an enum we are screwed here as the bitwise AND will always
evaluate to false.

This is a re-incarnation from a486671bce
2015-12-03 11:30:13 -05:00
Stefan Schmidt cd3d5e84f3 evas_font_dir: do not passed free'd memory to eina_list_remove()
Free the actual memory after we removed it from the list.
2015-12-03 11:30:13 -05:00
Mike Blumenkrantz 838c67c2c5 ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-12-03 11:30:13 -05:00
Chris Michael 7fff962813 ecore-evas-wl: Fix issue of improper window geometry
This fixes an issue where maximizing a window would set improper xdg
surface window geometry. We receive window configure sizes based on
xdg surface window geometry, so we need to subtract framespace there
or else window size grows when maximizing/unmaximizing multiple times.
This also adjusts the call to xdg_surface_set_window_geometry to
account for framespace (Fixes T2842).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 11:30:11 -05:00
Mike Blumenkrantz a697e47df1 ecore-evas wayland: use correct values when updating wayland window size
by using the geometry from after the request size has been updated,
scenarios such as the following can be avoided:

[4208305.332] xdg_surface@46.set_window_geometry(0, 0, 1778, 1)
[4208305.370] xdg_surface@46.set_window_geometry(0, 0, 1778, 250)

@fix
2015-12-03 11:29:48 -05:00
Chris Michael b2efb3044f ecore-wl2: Add start of code to support wl_keyboards
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:45:11 -05:00
Chris Michael bfb3bb0e61 ecore-wl2: Add private Ecore_Wl2_Keyboard structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:45:11 -05:00
Chris Michael 4ed004769b ecore-wl2: Remove unnecessary use of MIN macro
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:45:04 -05:00
Chris Michael 89155a3e7b ecore-wl2: Fix calling wl_surface_frame with proper Ecore_Wl2 window
frame

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:44:40 -05:00
Chris Michael 4299290476 ecore-evas-wl: Fix ecore-evas wl common code due to botched rebase
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:43:37 -05:00
Chris Michael c080b409ad ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:42:54 -05:00
Vincent Torri 7df5711a63 Evas: use LC_MESSAGES on Windows to fix compilation
Compilation is broken on Windows because LC_MESSAGES does not exist on this platform
Include Evil.h to provide support of LC_MESSAGES

@fix
2015-11-30 11:39:26 -05:00
Vincent Torri e54073f3c4 Evil: add support for LC_MESSAGES for setlocale()
LC_MESSAGES is an extension to C ANSI and does not exist on Windows.
So add LC_MESSAGES API and overload setlocale() to support it

@feature
2015-11-30 11:39:26 -05:00
Duna Oh 347bc94d10 ecore-drm: Add logical pointer x, y variable in seat for reflecting multiple pointer's movement
Summary: When one pointer moves, we should update the position of other devices.

Test Plan:
(1) Two pointer devices are connected.
(2) Move the cursor to (x, y) position using "device 1".
(3) When you move the cursor using "device 2", the cursor doesn't start from (x, y) position. This causes discontinuous mouse motion.

Reviewers: raster, zmike, gwanglim, stefan_schmidt, devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, Jeon, input.hacker, jpeg

Differential Revision: https://phab.enlightenment.org/D3384
2015-11-30 11:39:26 -05:00
Stefan Schmidt bdb13d23b2 emotion: correct argument order for calloc()
calloc() expects count first and the actual size to allocate as second
argument. Say Thank You to smatch for finding this issues for us.
2015-11-30 11:39:26 -05:00
Stefan Schmidt bcc3980296 examples ecore_buffer: correct argument order for calloc()
calloc() expects count first and the actual size to allocate as second
argument. Say Thank You to smatch for finding this issues for us.
2015-11-30 11:39:25 -05:00
Chris Michael ccf1ee8224 evas-3d: Fix missing field initializers
Clang spits warnings here about missing field initializers for
Evas_Vec3 (missing y and z fields), so we will explicitly initialize
them to 0 (matching the x field).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:39:25 -05:00
Vincent Torri fe1f9bfd8b Evil: fix warning
Use the USERPROFILE environment variable instead of deprecated evil_homedir_get
function. Also set the shell to cmd.exe if the SHELL var is not found
2015-11-30 11:39:25 -05:00
JinsolPark a78a62c90c eolian: fix eo makefile example of --eo option.
Summary: eolian: fix eo makefile example of --eo option.

Reviewers: cedric, q66

Reviewed By: q66

Subscribers: jpeg, q66

Differential Revision: https://phab.enlightenment.org/D3389
2015-11-30 11:39:25 -05:00
Tom Hacohen 0f5eb551c8 Revert "Evas: Temporarily hack OT_SUPPORT to fix textgrid"
Fixed in upstream, see T2865.

This reverts commit 8ccea8233c.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 64e636bcf6 eina_matrix: optimize multiply and inverse calls by actually using the shortcut
We had this nice shortcuts for multiply and inverse with the identity matrix.
Pity we never used it! The EINA_MATRIX_TYPE_IDENTITY is coming from an enum
without and direct assignments to its internals. Being the first item in the
enum it is most likely will be 0 which makes the whole bitwise AND zero and thus
the optimized path will never get called. If our compiler now decides hew wants
to handle enums differently and does not assign the 0 to the first item this
bitwise operation will be even more screwed. What we really want is to check is
if the type we get for the matrix matches EINA_MATRIX_TYPE_IDENTITY. So better
do this. Made me look into matrix multply and inverse. Fun!

Thanks to smatch for poiting this out.
2015-11-30 11:39:25 -05:00
Stefan Schmidt b635497632 rg_etc: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 504a165f81 evas software_x11: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 931ab93ba4 evas gl_common: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 3ecdc98967 evas_common3d: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 36e14082a3 eolian: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt e08c76c78e ector: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt 78b6b07e16 evas_cserve2: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Stefan Schmidt e1f5bf8ee5 edje_decc: use void to force empty function parameters
We have to use void in a function declaration if we want no function
parameters. Using just empty parenthesis means the function takes an
unspecified number of parameters.

We had it correct for most declarations and this series fixes it for
the rest.
2015-11-30 11:39:25 -05:00
Youngbok Shin 8a242b10df evas: Add ExtraLight, ExtraBold for font weight.
Summary:
Evas supports UltraLight, UltraBold as font weight.
These terms have same weight value as ExtraLight, ExtraBold.
Some applications, for example, fontforge, use ExtraLight, ExtraBold terms for these weight values.
So, it would be better to support these terms, too.
@feature

Test Plan: None

Reviewers: tasn, woohyun, herdsman

Reviewed By: herdsman

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3126
2015-11-30 11:39:25 -05:00
Thiep Ha 3ce1d99ac2 edje entry: return correct selection
Summary:
In entry, when selection_get function is called, selection is not
always returned the current selection.

Scenario:
- In select mode, entry has selection (e.g, by double click).
- When selection handler is moved, set the cursor the current coordinate
  with edje_object_part_text_cursor_pos_set() API.
- Edje emits "selection,changed" signal.
- Elementary gets current selection and stores it.
- Elementary does not get selection as visual selection (e.g, text is
   highlighted with "entry test", but the selection returned
   from edje is "entry").
- If we copy and then paste to the entry, the pasted text is not same as
   selected text.

Reason:
- In _edje_entry_cursor_coord_set function, if entry has selection, we only
  emit "selection,changed" signal without freeing en->selection.
- When _edje_entry_selection_get is called, we check the en->selection,
  since it is existed, we just return it which is not updated one.

This patch clears en->selection, so that it is updated at _selection_get,
and the updated selection is returned to caller.

@fix

Test Plan:
In mobile profile, open entry
- Right click, choose select, double click -> selection handlers are shown.
- Drag selection handlers to change selection.
- Right click, do copy.
- Right click, do paste.
- See the pasted text is not same as selection.

Reviewers: raster, tasn, herdsman

Subscribers: seoz, JackDanielZ, cedric

Differential Revision: https://phab.enlightenment.org/D2746
2015-11-30 11:39:24 -05:00
Stefan Schmidt e3bbd8c9d0 build: rename Eolian helper cmake file to mark it as input
Align it with the rest of our cmake support files. Adding it to configure as
well so the cmake file gets generate from the cmake.in

Without this I had distcheck failing with a missing target for it.
2015-11-30 11:39:24 -05:00
Marcel Hollerbach eb19a36703 cmake: Include module per default
if someone uses eolian its likly that he wants to install some rules
2015-11-30 11:39:24 -05:00
Marcel Hollerbach 27ba8943ac cmake: Add a helper script which defines generator rules for eo files
eo_rule_create adds rules to generate to .eo.x .eo.h .eot.h files.
It also monitors its deps.

@feature
2015-11-30 11:39:24 -05:00
Marcel Hollerbach 517464f961 efreet_icon: Fix wrong inherit selection
Summary:
The list of elem->paths is given with the actual icon at position 0 and
the bigger the index is the lower the icon in the inherit structure is.

Due to the for loop beginning at 0 walking to the end this
direction is flipped. So the last r is returned, which is the lowest
icon in the inherit structure.

This is fixed by returning if the first valid path is found.

@fix

Test Plan: run jesus or efm with a custom icon theme beore the wrong icons are taken, now the correct ones are taken

Reviewers: raster, cedric

Subscribers: DaveMDS

Differential Revision: https://phab.enlightenment.org/D3366
2015-11-30 11:39:24 -05:00
Jean-Philippe Andre c65d9c2d62 Evas: Temporarily hack OT_SUPPORT to fix textgrid
See T2865.
Since Harfbuzz 1.1.0, terminology displays fonts funnily aligned to
the top. This is apparently because until 1.0.6 the y_offset was
always 0 for all glyphs, but since 1.1.1 the offset is actually
set.

This is a TEMPORARY fix. There might be an underlying issue left
here.

Harfbuzz changed behaviour in this commit:

  commit 44f82750807475aa5b16099ccccd917d488df703
  Author: Behdad Esfahbod <behdad@behdad.org>
  Date:   Wed Nov 4 20:40:05 2015 -0800

      [ft] Remove font funcs that do nothing
2015-11-30 11:39:24 -05:00
Subhransu Mohanty eff8185283 ector: cleanup freetype raster
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Subhransu Mohanty 4b440fcc5d ector: support fill rule for shape object.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Subhransu Mohanty f56c81d0e4 efl: added fill_rule property in efl_gfx_shape class
Open question, should fill rule be part of the public data ? Let's
say no for now.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Subhransu Mohanty af2df731d8 efl: make path stroke related api as non virtual.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Cedric BAIL 04317ce6f4 efl: quick code cleanup. 2015-11-30 11:39:24 -05:00
Subhransu Mohanty 2be9ed825d ector: updated the freetype raster with faster line renderer.
Merged from freetype repo with 'smooth', faster, alternative line renderer.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Subhransu Mohanty 64f3a4e931 ector: fix the rounding issue when applying transformation to shape data in freetype backend.
@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:24 -05:00
Cedric BAIL bd5795917c evas: avoid double eet_close call while caching GL shader. 2015-11-30 11:39:24 -05:00
Cedric BAIL 55b194a463 eet: improve error message during eet_close. 2015-11-30 11:39:24 -05:00
Daniel Hirt 448cedc5d3 Edje: Add example for hyphenation style
A small example how hyphenation is set as a style in TEXTBLOCK parts.
2015-11-30 11:39:24 -05:00
Daniel Hirt 4e20be6657 Evas textblock: add hyphenation tests 2015-11-30 11:39:23 -05:00
Daniel Hirt b24594fc4b Evas textblock: add support for hyphenation wrap style
We now support hyphenation in style. Use "wrap=hyphenation" to use this
wrap option. It will hyphenate based on explicit SOFT HYPHEN (&shy;)
placement in the text, and with the (optional) assistance of dictionaries
compatible with Hunspell's "hyphen" library.

This wrap mode favors breaking at hyphen positions in a word, over moving
the whole word to the next line. It will put an additional "-" at the
break position if it was hyphened.

Enabling the hyphen dictionaries is done by adding these configure
options:
  --enable-hyphen (requires Hunspell's "hyphen" library installed)
  --with-dictionaries-hyphen-dir=DIR (specifies the install location of
          the actual .dic dictionary files e.g. /usr/share/hyphen)

Note that dictionary files are expected to be in the form of "en_US.dic"
or anything that ends with it e.g. "hyph_en_US.dic" (this how they are
        named in Arch Linux).

@feature
2015-11-30 11:39:23 -05:00
Daniel Hirt e8528498f0 Eina unicode: add eina_unicode_unicode_to_utf8_range
Required some special treatment to get words (substring) out of an
input Unicode string to a utf8 one. This saves the trouble converting
the whole string: you input an offset in the Eina_Unicode array, and
provide the required length. That's is, now you can extract words and
whatnot in utf8 form.

To save code I wrapped the original one to get the whole length.
2015-11-30 11:39:23 -05:00
Anand 66306f3e6e eina: Applied NULL check
Summary:
In _eina_list_setup_accounting function
{
...
...
if (!list->accounting)
     goto on_error;
...
...
on_error:
   _eina_list_mempool_list_free(list);
}

_eina_list_mempool_list_free function deference the "list->accounting"
variable which is already NULL.

Reviewers: JackDanielZ, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3376
2015-11-30 11:39:23 -05:00
Deepjyoti Dutta 41b6da1a3e Evas 3d: Initialized local variables
Summary:
The OpenGL functions  assigns a value to the local variable. However,
in case of error it would take the uninitialized garbage value. So, the
correct solution would be to initialize it to 0.

Signed-off-by: Deepjyoti Dutta <deepjyoti.d@samsung.com>

Reviewers: Hermet, singh.amitesh, raster, jpeg

Reviewed By: jpeg

Subscribers: yashu21985, mvsovani, alok25, sachin.dev, cedric

Differential Revision: https://phab.enlightenment.org/D3375
2015-11-30 11:39:23 -05:00
Vincent Torri b02f374ad7 autotools: detect IPV6 support on Windows
The detection in configure.ac includes netinet/in.h, for linux, but this header
file does not exist on Windows. So guard this header.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:23 -05:00
Cedric BAIL 21a4bda992 eina: simplify tests logic for base64. 2015-11-30 11:39:23 -05:00
Cedric BAIL 7fe0b1e664 eina: always terminate the string with a '\0'. 2015-11-30 11:39:23 -05:00
Yeshwanth Reddivari 009d662e31 Eina Example: Fix memory leak of variable buf
Summary: Fix memory leak of buf in eina_test_simple_xml_parser.c as reported by static analysis tool, Cppcheck.

Reviewers: singh.amitesh, Hermet, jpeg

Reviewed By: jpeg

Subscribers: alok25, mvsovani, sachin.dev, cedric

Differential Revision: https://phab.enlightenment.org/D3371
2015-11-30 11:39:23 -05:00
Minwoo, Lee 3e76b74871 evas: Fix text effect which has shadow direction
Summary:
If text object has outline and shadow effect (OUTLINE_SHADOW or OUTLINE_SOFT_SHADOW), and has shadow direction except BOTTOM_RIGHT then outline is not displayed.
So fix logic of style checking.

OUTLINE_SOFT_SHADOW effect of text object is different with text block, so fix it.

Test Plan: Make text obect with OUTLINE_SHADOW or OUTLINE_SOFT_SHADOW effect with any direction except BOTTOM_RIGHT

Reviewers: cedric, woohyun, herdsman, tasn

Subscribers: id213sin

Differential Revision: https://phab.enlightenment.org/D3047
2015-11-30 11:39:23 -05:00
Srivardhan Hebbar 8f09386247 evas_fb: Handling memory leak on realloc failure.
Summary:
I thought its better to fail and return null if realloc fails than to
continue. So returning by closing all openend file.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric, illogict

Differential Revision: https://phab.enlightenment.org/D3232
2015-11-30 11:39:23 -05:00
Jean-Philippe Andre 5e5bbe05cc Evas 3d: Remove left over debug message from recent commit 2015-11-30 11:39:23 -05:00
Jean-Philippe Andre 872b5f73f5 Edje edit: Free textblock styles with the proper function 2015-11-30 11:39:23 -05:00
Yeshwanth Reddivari 56e172af4f Edje: Remove duplicate NULL reassignment
Summary:
Remove duplicate code of variable 's' assignment to NULL in edje_edit_style_del.

Signed-off-by: Yeshwanth Reddivari <r.yeshwanth@samsung.com>

Reviewers: Hermet, alok25, mvsovani, singh.amitesh, jpeg

Reviewed By: jpeg

Subscribers: sachin.dev, cedric

Differential Revision: https://phab.enlightenment.org/D3358
2015-11-30 11:39:23 -05:00
Vivek Ellur 4511fff3e3 eet: Fix warning in eet file
Summary:
variable 'total' is of unsigned long long but %lli was used to print..so fixed
warning

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3325
2015-11-30 11:39:23 -05:00
perepelits.m 2c4fa3472d evas: fix PLY loader and saver.
Summary:
Use less memory by indexation vertices and not keeping more than one copy of it (from task T2713).

[Fix]

Reviewers: cedric, raster, Hermet

Subscribers: artem.popov

Differential Revision: https://phab.enlightenment.org/D3355

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Oleksandr Shcherbina bb834d96ea evas: remove useless part of code in evas_convex_hull_get function
Summary:
@fix
CID: 1339788

Reviewers: raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3350

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Oleksandr Shcherbina a9b35151bb evas: fix uninitialize variable in convex_hull_vertex_set function
Summary:
A bit of useless claim, becouse parameter coord always have value 0 or 1 or 2.
May be for escape problem in future.
@fix
CID: 1339781

Reviewers: raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3349

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Oleksandr Shcherbina 9154d932ea evas: fix possible accsess to NULL pointer in Evas.Canvas3d.
Summary:
@fix
CID:1339784

Reviewers: raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3348

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Oleksandr Shcherbina ffa488e8e3 evas: fix unreachable code in _generate_unic_color_key function in Evas.Canvas3D.
Summary:
Have a sence. It is hard to assume that more that 16 million color will be used.
@fix
CID: 1339790

Reviewers: raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3347

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Vivek Ellur 7504dec273 evil: fix uninitialize warning
Summary:
@Fix

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3324

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Vivek Ellur 9d19fcb185 eet: remove useless assignment in eet cipher and silence warning.
Summary:

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3310

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Srivardhan Hebbar 08304504df eina: example for base64 encoding.
Summary:
Depends on D3228

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3230

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Srivardhan Hebbar 261a3ed4b3 eina: test case for base64 encoding function.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3229

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Subhransu Mohanty 58d2c3c726 eina: added bounds_get api to Eina_Bezier
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 11:39:22 -05:00
Mike Blumenkrantz f9b7179684 ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-11-30 11:39:19 -05:00
Chris Michael e9b4d2964e ecore-evas-wl: Fix issue of improper window geometry
This fixes an issue where maximizing a window would set improper xdg
surface window geometry. We receive window configure sizes based on
xdg surface window geometry, so we need to subtract framespace there
or else window size grows when maximizing/unmaximizing multiple times.
This also adjusts the call to xdg_surface_set_window_geometry to
account for framespace (Fixes T2842).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-30 11:38:27 -05:00
Mike Blumenkrantz a11bf0d36c ecore-evas wayland: use correct values when updating wayland window size
by using the geometry from after the request size has been updated,
scenarios such as the following can be avoided:

[4208305.332] xdg_surface@46.set_window_geometry(0, 0, 1778, 1)
[4208305.370] xdg_surface@46.set_window_geometry(0, 0, 1778, 250)

@fix
2015-11-30 11:38:27 -05:00
Chris Michael 9260da5c8c ecore-evas-wl: Fix bad merge
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 18:48:00 -05:00
Chris Michael e74e8d4f78 ecore-wl2: Start on implementing support for multi-seat
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:16 -05:00
Chris Michael cc0c6ed852 ecore-evas-wayland: Remove call to ecore_wl function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:15 -05:00
Chris Michael 65a2f2044d ecore-wl2: Cancel data callback if we have a fatal error
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:15 -05:00
Chris Michael 0642a14cbe ecore-wl2: Remove setting custom wl_log handler
Seems EINA_LOG_DOM has a problem printing out wayland protocol logs,
so allow wayland to handle that itself.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:15 -05:00
Chris Michael 6fa212a25d ecore-wl2: Fix maximized & fullscreen functions to use window flag
Rather than rely on window->type for maximized & fullscreen, use the
cooresponding window flag

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:15 -05:00
Chris Michael 7870e4fc70 ecore-wl2: Fix calling wl_surface_frame with proper Ecore_Wl2 window frame
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:20:12 -05:00
Chris Michael 61e529406c ecore-evas-wl: Fix ecore-evas wl common code due to botched rebase
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:19:48 -05:00
Chris Michael 1f43b91b8a ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:19:18 -05:00
Chidambar Zinnoury 2572201276 ecore con: Fix UDP sockets.
The client structure holds a file descriptor, which is not initialized (which means 0) in case of UDP as there is no client-specific socket.

 However, we check for the file descriptor being positive before closing it in the client destructor, which means that we actually end up closing the 0 file descriptor.

 That means that things were going crazy with real strange things happening afterwards…
2015-11-22 16:16:06 -05:00
Jean-Philippe Andre 107388ae0d Evas render: Fix another map clip render issue
This time it's only about performance. We seem to be setting the
changed flag too often, which might trigger unnecessary redraws.

- map flag is set if there is currently a map AND it's not an image
  object (because images can map themselves)
- hmap flag is set if there was a map before

So, map != hmap does not imply a transition between a mapped and
non-mapped state. Add an extra check before marking the clip
as dirty and changed.
2015-11-22 16:16:06 -05:00
Jean-Philippe Andre d6f6bf9914 Ector: Simplify confusing code
The base class data was already stored, no need to figure it out again
2015-11-22 16:16:06 -05:00
Andy Williams ed7bef4a6e [eolian_gen] remove documentation for removed argument.
Used to be mandatory, is now not recognised, let's not confuse people @fix
2015-11-22 16:16:05 -05:00
Daniel Kolesa 2f17f0834f eolian: more relaxed safety in types API
This changes the checks in eolian type API so that you can use the various
type funcs on incompatible types, getting a NULL in return; this allows
simplified generator logic, with error handling done on generator side,
without getting annoying messages from the Eolian lib.
2015-11-22 16:16:05 -05:00
Daniel Kolesa daa43ae25c eolian: turn "undefined type" into its own EOLIAN_TYPE 2015-11-22 16:16:05 -05:00
Cedric BAIL a05a6c733a ector: don't use parent relationship to get access to the surface for freetype backend. 2015-11-22 16:16:05 -05:00
Cedric BAIL 843b312e9c ector: don't use eo parent relationship for accessing the surface. 2015-11-22 16:16:05 -05:00
Cedric BAIL c31f88a720 ector: starting decoralating surface and parent by adding a property to access the surface independently.
NOTE: It would be nice to be able to protect independently the setter from the getter in eolian.
2015-11-22 16:16:05 -05:00
Cedric BAIL 071db5634e ector: improve uploading of GL texture for vector graphism
This rely on a faster code path to upload dynamic texture. Once we get support
for gbm, we should see significant performance improvement in speed, but this
first step is already a 5 times improvement (Ok, we get from really bad, to not
really useful...).
2015-11-22 16:16:05 -05:00
Daniel Kolesa 30f1775043 elua: add eolian_type_aliased_base_get to lua bindings 2015-11-22 16:16:05 -05:00
Youngbok Shin 86a89c6869 Evas object: Add paragraph_direciton APIs
Summary:
It adds evas_object_paragraph_direction_set, get APIs.
The APIs set or get paragraph direction to/from the given object.
It changes BiDi calculations and affect the direction and aligning of text.
It doesn't have any effect to text without Fribidi library.

The default paragraph direction is EVAS_BIDI_DIRECTION_INHERIT.
If dir is EVAS_BIDI_DIRECTION_INHERIT, paragraph direction is changed
according to smart parent object. If there is no smart parent object,
paragraph direction works as EVAS_BIDI_DIRECTION_NEUTRAL.

@feature

Test Plan:
Test cases included to the following files.
- evas_test_textblock.c
- evas_test_text.c
- evas_test_object_smart.c

Run "make check".

Reviewers: woohyun, raster, herdsman, tasn

Subscribers: c, raster, cedric

Differential Revision: https://phab.enlightenment.org/D1690
2015-11-22 16:16:05 -05:00
Jean-Philippe Andre 321d127473 Efl: eo-ify enum Efl.Gfx.Fill 2015-11-22 16:16:05 -05:00
Jee-Yong Um 6b4e862780 edje: revise the explanation for mask_flags attribute
Reviewers: cedric, raster

Reviewed By: raster

Subscribers: raster

Differential Revision: https://phab.enlightenment.org/D3330
2015-11-22 16:16:05 -05:00
Chris Michael 02434285cb ecore-wayland: Reduce overhead for maximize/fullscreen set functions
This patch just gets the state flags directly from the window rather
than calling "get" functions to return the same parameter.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:16:05 -05:00
Chris Michael d909d46981 ecore-wayland: Fix iconified functions for consistency
* sanitize bool params
* enforce window state flag setting
* correctly detect window state using window flag

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:16:05 -05:00
Chris Michael 8d8298a579 ecore-wayland: Add EINA_SAFETY checks to window functions
This adds EINA_SAFETY returns for all public facing ecore_wl_window
functions.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:16:05 -05:00
Daniel Kolesa e03d423da3 eolian: add eolian_type_aliased_base_get
This adds a new API function that is there mainly for convenience (see doc).
Also added/updated tests as necessary.

@feature
2015-11-22 16:16:05 -05:00
Daniel Kolesa d37d44c977 gitignore: ignore core dumps 2015-11-22 16:16:05 -05:00
Tom Hacohen d44dab055c Evas text: Fix last up to pos error return value.
This commit also simplifies the code a (tiny) bit.

This fixes the bug introduced in:
392df9479f
2015-11-22 16:16:04 -05:00
Tom Hacohen 9444de3ab7 Evas text: Remove useless FIXME. 2015-11-22 16:16:04 -05:00
Subodh Kumar 65e3548a31 Evas text: Fix memory leak
Summary:
Fix memory leak

Position is getting returned without
freeing the temporary logical item list.

@fix

Test Plan: NA

Reviewers: tasn, raster

Reviewed By: raster

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D3345
2015-11-22 16:16:04 -05:00
Tom Hacohen ca1ea20b0b Eet: remove dead variable assignment.
I guess this is what 2a01c4517b was meant to be doing.
2015-11-22 16:16:04 -05:00
Stefan Schmidt 3e22ae2558 Revert "eet: removing useless assignment variables."
This reverts commit 2a01c4517b.

Declaring these variable void breaks the build with disabled crypto.

Fixes T2855
2015-11-22 16:16:04 -05:00
Jean-Philippe Andre 6ca00b70de Edje data: Remove redondant array in Evas 3D edd
Since I just broke EDJ ABI, as well clean it up. The same array
was saved twice under two different names.
2015-11-22 16:16:04 -05:00
Jean-Philippe Andre feb1351939 Edje: Fix Evas 3D eet data descriptors
Memleak found with valgrind points to this line, where clearly the
edd field name is incorrect. It looks like this feature has no example,
no test case either.

This breaks EDJ ABI!
I do this because I believe there are zero users of this API
at this point, as Evas 3D is still not ready yet.

See also https://phab.enlightenment.org/D2544

@fix
2015-11-22 16:16:04 -05:00
Jean-Philippe Andre 00807969bc Edje data: Fix memory leak in nested data descriptors 2015-11-22 16:16:04 -05:00
sunghyun kim 699eee9422 Evas GL: XFreeColormap when window free
When gl window is created, XCreateColormap is called in eng_best_visual_get
but when gl window is freed, Colormap is not freed.

See original patch: D3342.
2015-11-22 16:16:04 -05:00
Mike Blumenkrantz ea2f71c0c2 ecore-wayland: rewrite maximize/fullscreen set functions for consistency
* use safety macros for win struct param (should be the case for all fns here)
* sanitize bool params
* enforce window state flag setting
* correctly detect window state using window flag instead of type

@fix

ref T2841
2015-11-22 16:16:04 -05:00
Mike Blumenkrantz e530cc37a6 ecore-wayland: return only the relevant state value for maximize/fullscreen
having window types for fullscreen/maximize is not defined by spec and leads
to state mismatches when toggling from api vs receiving events from the compositor

@fix
2015-11-22 16:16:04 -05:00
Mike Blumenkrantz 85a576016d ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-11-22 16:16:01 -05:00
Chris Michael 60fa3c182a evas-gl_drm: Remove set but unused variable
Variable 'osurface' is not actually being used inside the code here,
so remove it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:15:28 -05:00
Chris Michael 6eacfcd5c3 ecore-wayland: Make ecore_wl_window_maximized_get return proper values
This brings ecore_wl_window_maximized_get more inline with
ecore_wl_fullscreen_get function in that it will now check either the
window maximized state, or the window type, to determine if a window
is actually maximized

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:15:28 -05:00
Chris Michael 97b51f61eb ecore-evas-drm: Send fake mouse_move event after registering
This fixes an issue where ecore_drm was sending an initial mouse_move
event too early in the startup process. Instead, we will send the
event from Ecore_Evas after it has been registered with Ecore_Input.
This is done here to address and Fix T2854.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:15:28 -05:00
Chris Michael b46455ba96 ecore-drm: Don't send mouse_move event too early
We cannot be sending an ecore_event for mouse move here as it is too
early in the startup process for that too happen. Raising the event
here never gets caught because the ecore_evas has not yet registered
for ecore_input listening.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:15:28 -05:00
Chris Michael c0708792ce ecore-evas-wl: Fix issue of improper window geometry
This fixes an issue where maximizing a window would set improper xdg
surface window geometry. We receive window configure sizes based on
xdg surface window geometry, so we need to subtract framespace there
or else window size grows when maximizing/unmaximizing multiple times.
This also adjusts the call to xdg_surface_set_window_geometry to
account for framespace (Fixes T2842).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:15:23 -05:00
Chris Michael d764ee34a5 ector: Fix incorrect expression
Coverity reports that 'obj' is written twice with the same value
here., so fix this with a proper call to eo_do_super_ret

NB: Fixes Coverity CID1339786

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Chris Michael 623d568e18 evas-software-x11: Fix resource leak
If we end up leaving evas_xlib_image_dri_native_set due to a failure
to allocate memory, we should free the previously allocated
Evas_DRI_Image so that we don't leak

NB: Fixes Coverity CID1339782

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Daniel Hirt 878cdb0e32 Evas textblock: fix bad deletion in test case
No need to delete this object. It is already being deleted when the
textblock is freed at the end of the test.
2015-11-22 16:14:45 -05:00
Daniel Hirt 82541c9d05 Evas language: add full locale language getter
evas_common_language_from_locale_get truncates the country letters in
the language. We don't always want that (one example is dictionaries).
2015-11-22 16:14:45 -05:00
Chris Michael 8b6c6cfb07 evas-software-x11: Fix returning NULL pointer
evas_xlib_image_dri_native_set should be returning a pointer to an
RGBA_Image on success, or NULL on failure. Returning EINA_FALSE here
leads to an expression which evaluates to zero being treated as a null
pointer constant

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Chris Michael c4fda4ebc1 evas-software-x11: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Chris Michael a092f0ae9e evas-gl: Remove extra parentheses
clang warns of equality comparison with extraneous parentheses in
these cases. Remove the extra parens as they are not needed anyway

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Chris Michael 5552e09427 ector: Add missing EINA_UNUSED for unused function parameter
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:45 -05:00
Tom Hacohen 658bce248a Evas language: Fix language from locale function.
This function was trying to infer from the LANG env var, though it should
have just queried the locale all along, as the language we want is the
system's text language, and not necessarily the LANG variable's value.

@fix.
2015-11-22 16:14:45 -05:00
Subodh Kumar e91e1331d3 Evas text: Remove fixme marker
Summary:
Remove fixme marker

Algorithm used is good enough to sort
very few number of items, usually 2 to 6
items.

Test Plan: NA

Reviewers: herdsman, cedric, tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3312
2015-11-22 16:14:45 -05:00
Subodh Kumar 058a7dd5c4 Evas text: Remove tabs for readability
Summary: Remove tabs

Test Plan: NA

Reviewers: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3337
2015-11-22 16:14:45 -05:00
Cedric BAIL 7edddd9a95 ector: disable NEON build.
There is more problem with this code, better disable it for now.

@fix

T2851
2015-11-22 16:14:45 -05:00
Jean-Philippe Andre 0487ae1724 Evas GL: Remove invalid call inside make current pbuffer
There was some confusion as color_buf is a texture but it was used
as an fbo. Not sure was this call was for.

@fix
2015-11-22 16:14:45 -05:00
Jean-Philippe Andre 6c127eaf4d Evas GL: Ignore compilation warning
Desktop OpenGL doesn't care about the version here (GLES 2 or 3)
2015-11-22 16:14:45 -05:00
Jean-Philippe Andre c780ad4f2c Evas GL: Fix BadMatch with pbuffer make current
This is the kind of horrible things you'll encounter when working
with GL. The surface and context need to have matching configuration
otherwise make current will fail, and the only way to get a matching
config is to reuse the config selected to create the context. Gah.

This is the same fix as for EGL. More a hack than a fix, to be honest.

@fix
2015-11-22 16:14:45 -05:00
Cedric BAIL b2656ab0df eolian: fix build after removal of --eo option. 2015-11-22 16:14:45 -05:00
Mike Blumenkrantz 60d72df09a ecore-evas drm: null global device pointer after free
ref T2844

@fix
2015-11-22 16:14:45 -05:00
Jean-Philippe Andre 402c787997 Evas GL: Fix failing make check test case
The version field was not properly set for GLES 1 and 3 (but not tested),
double free() could happen on the API structs, and empty API structs
could be returned.
2015-11-22 16:14:45 -05:00
Mike Blumenkrantz 84ec2f606f ecore-evas wayland: use correct values when updating wayland window size
by using the geometry from after the request size has been updated,
scenarios such as the following can be avoided:

[4208305.332] xdg_surface@46.set_window_geometry(0, 0, 1778, 1)
[4208305.370] xdg_surface@46.set_window_geometry(0, 0, 1778, 250)

@fix
2015-11-22 16:14:44 -05:00
Stefan Schmidt 9a6bfea870 emotion webcam: fix check for v4l2 video capture device capability
The negation should be uses after checking the capability bit with the &.
Better use parenthesis  to make this work.

Thankls to the sparse sematic parser for spotting this.
2015-11-22 16:14:44 -05:00
Stefan Schmidt 108a356d36 eina_thread_queue: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-22 16:14:44 -05:00
Stefan Schmidt 7be6489a31 evas polygon: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-22 16:14:44 -05:00
Stefan Schmidt 2a77bd33f6 ecore_evas x engine: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-22 16:14:44 -05:00
Stefan Schmidt 9db8e740ec evas buffer engine: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
Fix the indent where needed as well.
2015-11-22 16:14:44 -05:00
Minwoo, Lee 881bd75ab2 evas textblock: fixed ascent/descent calculation
Summary:
If textblock has linegap and multi language, ascent/descent calculation is
incorrect.
In _layout_format_ascent_descent_adjust(), descent is accumulated.
(for example, for a line gap of 50, the first line gap is more than 100)

Test Plan:
Textblock has "linegap=50" and multi language (ex.
        "This is a test suite for line gap -
        ഈ ലൈൻ വിടവ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ഒരു പരീക്ഷണ വെയര് ")
Added test suite in evas_test_textblock.c file.

Reviewers: tasn

Subscribers: subodh6129, cedric

Differential Revision: https://phab.enlightenment.org/D3311
2015-11-22 16:14:44 -05:00
Stefan Schmidt ceb8597a4c ecore_ipc: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-22 16:14:44 -05:00
Stefan Schmidt ef704b3670 gif loader: use Eina_Bool for one-bit bitfield
Make sure we are using a unsigned var here. Best go with a Eina_Bool directly.
2015-11-22 16:14:44 -05:00
Jean-Philippe Andre 4033e41730 Revert "efl: Fix configure help message for cserve"
This reverts commit e83fae6960.

cserve2 is enabled by default at build time. It's disabled by
default at runtime. Basically it's always built but never used.
2015-11-22 16:14:44 -05:00
Cedric BAIL c8a9e0c0af ector: do get symbol at object construction time.
This make it part of the object initialization and will prevent the construction
of the object if the needed cairo function are not fund. So if Ector can create
the object, it can display them.
2015-11-22 16:14:44 -05:00
Chris Michael 3f09a6e0f2 efl: Fix configure help message for multisense
By default, multisense is disabled. The configure help message for
multisense was incorrect because it stated that multisense was enabled
by default

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:44 -05:00
Chris Michael 0975d5d8e4 efl: Fix configure help message for cserve
By default, cserve2 is disabled. The configure help message for
cserve2 was incorrect in that is said cserve2 was enabled by default.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-22 16:14:44 -05:00
Tom Hacohen b93502d78d Evas text: Change bitfield bool types to Eina_Bool.
This is really just a safety measure, as we always just check if the value
is true. However, with char the potential values are -1 and 0, and with
Eina_Bool they are 1 and 0, so fixing that.

Thanks to the "sparse semantic parser" for detecting that, and to Stefan
for reporting.
2015-11-22 16:14:44 -05:00
Stefan Schmidt 88a559117a ecore_con: fix another case where files have been moved and sitcheck benn broken
This time the move of dns to static_libs in
4f24deac44 broke distcheck as the header file was
never shipped with the tarball. I would really appreciate if author and reviewer
would pay more attention.
2015-11-22 16:14:44 -05:00
Stefan Schmidt b7b4d5b485 evas: add forgotten file to SOURCES to fix distcheck
Added in 8ab190daec but forgotten to be added
to the SOURCES.
2015-11-22 16:14:44 -05:00
Dongyeon Kim 0afc559edf evas/gl_generic: Check for errors when calling tbm surface map/unmap
tbm_surface_map/unmap might fail and return error, so we need to check
the return value of these APIs.
2015-11-22 16:14:44 -05:00
Dongyeon Kim e8b333cb4c evas/gl: Bind texture with external target for tbm surface
egl images created using tbm surface for native surface set use
GL_TEXTURE_EXTERNAL_OES as texture target, so we should bind to
this target when rendering.
Dynamic hint set using tbm surface also creates egl images, but
as we only use RGB* colorspace for this we can use GL_TEXTURE_2D.
So, keep track of texture target in shader array, and bind to the
appropriate one.
This also fixes the bug that image_data_get only worked when BOTH
sec_image_map and sec_tbm_surface extensions are supported.
2015-11-22 16:14:43 -05:00
Dongyeon Kim 60f960ff36 evas/gl: Do not check for egl errors with glEGLImageTargetTexture2DOES
Summary:
glEGLImageTargetTexture2DOES is a GL extension API, so we need to use
glGetError instead of eglGetError!
2015-11-22 16:14:43 -05:00
Dongyeon Kim 9881621d9a evas/gl_common: Enable dynamic hint set using tbm surface only when egl extension is supported
Summary:
Dynamic hint set using tbm surface can only be used when EGL_TIZEN_image_native_surface
extension is supported by the driver. So check for both tbm surface and egl extension.
2015-11-22 16:14:43 -05:00
Dongyeon Kim c823935828 Revert "Evas GL: Fix crash with dynamic hint set using tbm surface"
Upcoming patch will fix this crash issue in a more proper way, so I revert this patch here.

This reverts commit 8b1b8d5cf0.
2015-11-22 16:14:43 -05:00
Vincent Torri 1ac54c1e77 ecore_con: remove last occurence of EMILE_SSLv3
This fixes compilation on Windows

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-22 16:14:43 -05:00
Vincent Torri bad87e39bd evil: remove useless vc++ code
vc++ is not supported anymore

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-22 16:14:43 -05:00
Vincent Torri 0e172f6fbe evil: fix warnings when mingw-w64 4.* is installed
mingw-w64 4.* adds several macros and functions compared to the 3.* version,
so make sure that Evil does not redeclare them

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-22 16:14:43 -05:00
Chris Michael e4b8bea513 ecore-wl2: Add missing @since for all existing doxygen
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael a7c6754db3 ecore-wl2: Change name of ecore_wl2_window_class_name_set function
It makes more sense to have this function be called
ecore_wl2_window_class_set.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael d6a1da16c6 ecore-wl2: Add missing EINA_UNUSED for function parameters
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael cb75b35f04 ecore-wl2: Add function to get a windows rotation
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael c5d190ffc5 ecore-wl2: Fix issue of not unsetting move mouse pointer
Summary: When we finish moving a window, previously the mouse cursor
would never get unset from the hand cursor. This is due to the way
that grabs work in wayland, and not ever getting an event notification
for the move being completed. This patch works around that issue

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael 61cb6f17f9 ecore-wl2: Fix maximized and fullscreen functions to restore geometry
Previously, when we maximized or fullscreen a window, we were sending
the improper geometry to the window_configure callback

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael f4837267b1 ecore-evas-wl: Fix issue of resize jumping
Summary: When an initial client application was shown and we tried to
resize it, the resize would jump by the amount of framespace. This was
because the xdg_surface@configure event would be sending window
geometry as the width/height params in the event. We need to account
for that in the callback of window configure and adjust size
accordingly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael ac11a9a8fe ecore-wl2: Add doxygen for more ecore_wl2_window functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael df88d7d0f8 ecore-wl2: Add support for handling Fatal Errors
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael b4130b7ade ecore-wl2: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael ded7a94085 ecore-wl2: Add note about calling ecore_wl2_display_globals_get
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael 571e8d3b21 ecore-wl2: Add caching of server displays and fix issue of client
connecting to same server pid

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael d11f0fdddc ecore-wl2: Client connections do not need to listen for a write event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael 1cff662d5a ecore-wl2: Also listen for write events when creating a compositor
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael 01784a1dfe ecore-wl2: Fix event processing for client connections
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:03 -05:00
Chris Michael e1ee09938b ecore-wl2: Connect to proper name during ecore_wl2_display_connect
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 2484056698 ecore-evas-wl: Update frame callbacks to use Ecore_Wl2
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 049acffbd9 ecore-wl2: Add safety trap for null compositor
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael af49a8f0c6 ecore-wl2: Don't re-add existing globals
If we already have seen this global, and it is in the globals hash,
then don't re-add it and just jump straight to sending the event

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 8d4854d28d ecore-evas-wayland: Fix error message for connect failures
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael b1e5730bc2 ecore-wl2: Remove all code relating to custom window animators
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 043d5d31b2 ecore-wl2: Fix calling wl_surface_frame with proper Ecore_Wl2 window
frame

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael a86c7a6fc0 ecore-wl: Remove setting window animator in server mode
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael d29fed2a26 ecore-imf-wayland: Remove trailing whitespace
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 134893a6d6 ecore-wl2: Rename anim_listener to avoid confusion with ecore_wayland
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 5ac582cdfd ecore-imf-wayland: Use ecore_wl2_display_window_find API function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 00145d70ba ecore-evas-wl: Use ecore_wl2_display_window_find function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael d28493b8d7 ecore-wl2: Remove duplicate window_find API function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael a6798eb812 ecore-wl2: Re-order window API function to be with window group
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 48546cb67d ecore-wl2: Add doxygen group for Subsurface functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael e79bf409b8 ecore-wl2: Fix typo in doxy group definition for Dnd Group
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael cc384c26e7 ecore-wl2: Re-order API functions for input to be located next to the
group definition

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 84f58faa20 ecore-wl2: Add doxy group for output functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael 0afc5a2ab4 ecore-wl2: Add API function to get the DPI of a given output
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:02 -05:00
Chris Michael e53f74787e ecore-wl2: Fix issue of compositors not flushing clients properly
Summary: When we use ecore_wl2 for creating compositors (E), we need
to flush clients before we dispatch events on the wl loop, so add a
prepare_callback for the fd handlers and flush clients there.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:01 -05:00
Chris Michael 8f2512c9a3 ecore-evas-wl: Fix ecore-evas wl common code due to botched rebase
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:01 -05:00
Chris Michael 40ba19a73c ecore-evas-wl: Fix calls to ecore_wl2_window_resize (due to botched
rebase)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:01 -05:00
Chris Michael b87652b8bc ecore-imf-wayland: Disconnect display when we close the module
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:39:01 -05:00
Chris Michael 26e8935205 ecore-imf-wayland: Port ecore_imf_wayland to use Ecore_Wl2
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:38:56 -05:00
Chris Michael 70db0a5b19 ecore-wl2: Add API function to return a wl_seat from an Ecore_Wl2_Input
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8149404d62 ecore-wl2: Implement ecore_animators for windows instead of using a
custom animator

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6ed5a5fabb ecore-evas-wayland: Comment out calls to set custom animator
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2be0a40129 ecore-wl2: Fix dnd to function when source window and target window
are same

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael aa232d0a61 ecore-wl2: Implement reference counting for client connected displays
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 110a210c6e ecore-wl2: Cache client displays and reuse them to reduce memory usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bda1b1d731 ecore-wl2: Reset Ecore_Wl2 events to 0 on shutdown
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ba5e5ab667 ecore-wl2: Set WAYLAND_DISPLAY env variable when we create a display
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 0d9ce71b39 ecore-wl2: Don't reset window->input on keyboard or pointer leave events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 54077f460c ecore-wl2: Don't check twice if a key repeats and also fix issue of
repeating keys getting delayed

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9bfe2b4392 ecore-wl2: Adjust keyboard repeat delay and rate
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Derek Foreman a83de3e1fe ecore-wl2: cache the registry
wl_get_registry() returns a new object that we must destroy, so
we should cache one at connect and never call that again.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 0d598da53b ecore-wl2: Add support for idle_enterer
Summary: This fixes an issue where scrolling mouse wheel would not
actually perform any scroll until another event was received.

NB: Unsure if we need this for "server" connections yet

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael faf1f03101 ecore-wl2: Free internal mouse down info when we delete an input
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael eb3823e891 ecore-wl2: Add API function to set opaque region of a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 3fa374f09e ecore-wl2: Add API function to set sync/desync on a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2fa19739ed ecore-wl2: Add API function to place a subsurface below a surface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7b8431b93d ecore-wl2: Add API function to place a subsurface above a surface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael fe8580cf6f ecore-wl2: Add API function to get the position of a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 80cccbf8c4 ecore-wl2: Add API function to set the position of a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8e41ee62a9 ecore-wl2: Add API function to return the wl_surface of a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d532f5240c ecore-wl2: Add API function to delete a subsurface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 407bbd0538 ecore-wl2: Use proper wayland function to get display registry
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e39325929d ecore-wl2: Start on preliminary subsurface support
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d5556753c9 ecore-wl2: Cleanup wayland objects on display cleanup
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e103d86143 ecore-wl2: Cleanup inputs on display disconnect/destroy
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7b981d0f79 ecore-wl2: Add subsurface structure type
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8f715f090a ecore-wl2: Add subsurface protocol files to support subsurfaces
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a466cef85f ecore-wl2: Add doxygen for ecore_wl2_window functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5bf1015c29 ecore-wl2: Add support for input region setting for an Ecore_Wl2_Window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f7b4bf3775 ecore-wl2: Add API function to return the registry of a display
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8b65a84759 ecore-wl2: Add API funtion declarations need for Elementary
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ef016f5a65 ecore-wl2: Add API function to find a window given a window id
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d4d9556bd4 ecore-wl2: Add API function to issue an ungrab on an input
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ba35c5acbd ecore-evas: Add API function to get an Ecore_Wl2_Window for an
ecore_evas

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 298989495b ecore-evas-wayland: Fix issue of using wrong structure for mouse
events, and bring back function to listen for window configure events

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael c8e16b85bb ecore-evas: Add function to return Ecore_Wl2_Window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 4aa3f7957c ecore-evas: Add ecore_evas_wayland_window_get2 to the Ecore_Evas
Wayland Interface

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 942684d8fc ecore-evas: Add new API to return a Ecore_Wl2_Window when requested
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 3299b9db4c ecore-wl2: Check if a window is transparent or alpha when setting
opaque region

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5bf4141fac ecore-wl2: Cleanup dnd drag and selection sources when we delete an
input

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 0bb09e4a1a ecore-wl2: Send window configure event when we un-maximize/fullscreen
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael cb6fb2280d ecore-wl2: Add a LAST member for enum of window type
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f0fceeaa46 ecore-wl2: Don't use bitfields for public structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5f7b0796c0 ecore-wl2: Add display to global event structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael df5d7b0485 ecore-wl2: Provide internal function to stop any cursor update timers
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f0936d67f4 ecore-wl2: Create new event type for window configure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9c2b713a4c ecore-wl2: Update input serial when we get a mouse button event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 34f49d3e01 ecore-wl2: Add event type and structure for sending window configure
events

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5e8d9bc6c6 ecore-wl2: Set window input on pointer enter/leave events
Summary: This is so that we can still change mouse cursor (to indicate resize)
even when the window does not have focus

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 080e2c8613 ecore-evas-wayland: Re-enable interface functions for window get and
type set

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 3682bc6348 ecore-wl2: Remove window animator callback when we free a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 14f53ae171 ecore-wl2: Remove test for no-op move/resize
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 4dbfcae2a0 ecore-wl2: Fix compiler warning
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6c2a497f7b ecore-wl2: Reduce noise of ERR messages which are not that important
when trying to set pointer cursor images

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5171d7d92a ecore-wl2: Fix issue of never getting keyboard focus
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8f8f47d933 ecore-wl2: Fix issue of animators not starting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bfa04ca6c7 ecore-wl2: Finish off internal dnd code to actually send events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 454d91c005 ecore-wl2: Add API function to clear a dnd selection
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7a762d87dc ecore-wl2: Add API function to return if a dnd selection exists
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d15dfad898 ecore-wl2: Add API function to set a dnd selection
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a3a0e20193 ecore-wl2: Add API function to determine if an input has a selection
owner

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8de77bf6b2 ecore-wl2: Add API function to end a dnd drag operation
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 30a5f1a6dd ecore-wl2: Add API function to get a dnd drag
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5a7aae761c ecore-wl2: Add API function to start a dnd operation
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael dda0f18bd7 ecore-wl2: Add API function to set dnd drag types
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bac455e651 ecore-wl2: Add missing TODO for doxygen
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 64217f2395 ecore-wl2: Add API function to return the Ecore_Wl2_Input from a given
window

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bcf21e46ea ecore-wl2: Add API function to set the type of window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ddeb2cfba6 ecore-wl2: Add API function to return surface id of a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael efff154808 ecore-wl2: Add API function to set a cursor for a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 539876df81 ecore-wl2: Add support for setting cursor images to input code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 1bf99a7df7 ecore-wl2: Add event structure and event type for selection data ready
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ea577e02f6 ecore-wl2: Add remaining events and event structures for data source
(dnd)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5cdf7a8d14 ecore-wl2: Add event structure for dnd end event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9903774a14 ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e0e20383b0 ecore-wl2: Add API function to set pointer surface on a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f67a86e7fe ecore-wl2: Implement ecore_wl2_window_raise for xdg surfaces also
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael faa8eae113 ecore-wl2: Add API function to return pointer position
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 618f94f367 ecore-wl2: Add API function to retrieve screen size
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9f6f7c931a ecore-wl2: Add API function to set window minimized state
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 840710da63 ecore-wl2: Add API function to return if a window is iconified
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9364b71e54 ecore-wl2: Add API function to set if a window is fullscreen
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 4255d238dc ecore-wl2: Add API function to set if a window is maximized
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 0a239557b7 ecore-wl2: Add API function to set window geometry
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 05ffa467f6 ecore-wl2: Add API function to return window geometry
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael b375a29739 ecore-wl2: Fix not sending compositor reguests when we use
ecore_wl2_display_connect

Summary: If we do Not listen for ECORE_FD_WRITE on the file descriptor
handler, then we never send a wl_display_flush which means we don't
send requests to the compositor and thus nothing ever renders. Fix
that by listening for FD_WRITE and calling wl_display_flush.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e23750bc33 ecore-wl2: Add API function to set window class name
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 93dce48609 ecore-wl2: Add API function to set window title
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ca33bbb4f1 ecore-wl2: Add API function to set window rotation
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 1107303c3e ecore-wl2: Add API function to return if a window is fullscreen or not
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f204780968 ecore-wl2: Add API function to return if a window is maximized
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael b0e559d536 ecore-wl2: Add API function to set if a window is transparent
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5045ff1319 ecore-wl2: Add API function to set window opaque region
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a261b135d2 ecore-wl2: Add API function to set if a window is alpha or not
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 0f03c0b451 ecore-wl2: Add API function to return if a window is alpha or not
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8403024cf1 ecore-wl2: Add API function to find a window by id
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 49391cbdb6 ecore-wl2: Add implementation for supporting custom tick animators
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 303faf8e33 ecore-wl2: Raise dnd drop event when we get the event from the data
listener

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 83c623fb3a ecore-wl2: Add dnd drop event type and event structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6fb6813845 ecore-wl2: Add event and structure for dnd motion events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bc774525d0 ecore-wl2: Raise event for dnd leave
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 807e36c5ac ecore-wl2: Add event and structure for event dnd leave
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 238c0b9144 efl: Add ecore_wl2 pc file to gitignore
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael bd5e10ef8a ecore-wl2: Add calls to dnd functions for drag listener
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 48e63ba17a ecore-wl2: Add source file for dnd functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d5cdbf4b61 ecore-wl2: Add private function declarations for dnd functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 99f78e2660 ecore-wl2: Add structure and event type for dnd enter
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 70e7e584da ecore-wl2: Add TODO notes for dnd
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5ce2bc3a50 ecore-wl2: Support window raise function for wl_shell_surface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7ed409d477 ecore-wl2: Implement support for window resizing
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 379149eaf3 ecore-wl2: Improve popup support to be able to use the parent windows
seat

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 4759f68734 ecore-wl2: Add support for window moving
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 445b340a3f ecore-wl2: Add support for xdg popups
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 549ba9aeea ecore-wl2: Assign an input to a window when the window gets focus
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 846214c734 ecore-wl2: Finish up touch support. Record touch motion coordinates
into input->pointer.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael af9c21d875 ecore-wl2: Add support for double/triple click in mouse events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e039bc06ea ecore-wl2: Send key press/release events when we get wayland event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 57fa740fe7 ecore-wl2: Raise focus in/out events when we get wayland events for
keyboard enter/leave

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 5b7297a120 ecore-wl2: Add event structures for focus in/out
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7c7bdcc41e ecore-wl2: Reset pointer and keyboard focus when a window gets deleted
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 35861403f7 ecore-wl2: Call input ungrab when window operations occur
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a4ebba55fe ecore-wl2: Finish send ecore events for any wayland touch related events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 3b8d91ec2f ecore-wl2: Send mouse up event when we ungrab input
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d38fd710a3 ecore-wl2: Send mouse button down/up events when we get a wayland
pointer button event

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7d2dce17ee ecore-wl2: Add internal functions for sending mouse button down/up
events

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6ae3560210 ecore-wl2: Set display serial during keyboard events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 15c49d4d25 ecore-wl2: Add code to send mouse wheel events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a8c6a4fff5 ecore-wl2: Issue input grab/ungrab during pointer button events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 99dcc2e4c9 ecore-wl2: Add code to send mouse move events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d5e0a60788 ecore-wl2: Add functions to send mouse in/out events and call them
during pointer enter/leave

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6ebc272a46 ecore-wl2: Add internal input functions to initiate/release a grab
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 64b7e6dd9e ecore-wl2: Add prototype functions to support data listener
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 600e542149 ecore-wl2: Add placeholders for touch listener functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8f4c45636f ecore-wl2: Add initial support for keyboard events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8b738a0ad1 ecore-wl2: Add placeholders for functions of the keyboard listener
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 212e843310 ecore-wl2: Add TODO note for handling mouse wheel event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael b6cc9cac24 ecore-wl2: Add start of code for pointer button event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 81c6843f87 ecore-wl2: Start on code for pointer motion event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7e8945f088 ecore-wl2: Start on code for pointer leave event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7acfc3f8ce ecore-wl2: Destroy cursor theme when input is destroyed
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael eeab762498 ecore-wl2: Add start of pointer handling code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2a96aff413 ecore-wl2: Add function to find a window based on surface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a34e83137e ecore-wl2: Add pointer fields to input structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9ceeaf1b29 ecore-wl2: Add placeholder touch listener structure and setup touch
listener

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael fc2a4f5f34 ecore-wl2: Add placeholder keyboard listener structure and setup
keyboard listener

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 84d84dfcf1 ecore-wl2: Add placeholder pointer listener structure and setup
pointer listener

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e6ed988e54 ecore-wl2: Add support for initial setup of pointer cursor
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 79f4fa95ed ecore-wl2: Add start of Ecore_Wl2_Input code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e4c39ba2fe ecore-wl2: Fix doxygen comment
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e0fdb907dc ecore-wl2: Add support for xdg shell listener
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 353ecac25e ecore-wl2: Add start of Ecore_Wl2_Output code for outputs
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d1c4d53e50 ecore-wl2: Free window when surface gets deleted
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2811d85907 ecore-wl2: Add placeholder API for ecore_wl2_window_raise
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 561a67069c ecore-wl2: Update doxygen for window move and resize functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 58bc1a5e87 ecore-wl2: Add API function to resize a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael addfd3f42a ecore-wl2: Add API function to move a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael eb34a9f53e ecore-wl2: Add API function to free a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 137c24c904 ecore-wl2: Add API function to hide a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7458725b85 ecore-wl2: Add API function for ecore_wl2_window_show
Summary: This adds preliminary support for wl_shell and xdg_shell

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 3fd3d99baf ecore-wl2: Add a listener for display sync when connect is called
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e283efa5a1 ecore-wl2: Add bool fields to window structure to store state
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2c4aeefc23 ecore-wl2: Add function to create/get a wl_surface for a window
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a925d0ca66 ecore-wl2: Add support for window types
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 9005f360d0 ecore-wl2: Add function to return window id
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e81351491f ecore-wl2: Add start of ecore_wl2_window code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 1d69824237 ecore-wl2: Add API function to return an iterator for display globals
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 01706a9eae ecore-wl2: Group connect and disconnect functions together
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael c273933205 ecore-wl2: Add internal function to cleanup Ecore_Wl2_Display when closed
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d76c2e2a2d ecore-wl2: Add API function for servers to terminate wayland display main loop
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael de7a0947a5 ecore-wl2: Create new xkb context for each display when connected
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6a05c1e69b ecore-wl2: Add API function for servers to destroy a wayland display
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael ea416178e4 ecore-wl2: Add API function for clients to disconnect from a Wayland display
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7c226972dc ecore-wl2: Add API function to return the wl_shm interface
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 69bf2f0c7c ecore-wl2: Remove unused wl_registry field in display structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f3d640f10a ecore-wl2: Call wl_event_loop_dispatch with a 0 timeout
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael f449ad4f87 ecore-wl2: Add support for binding various wayland interfaces
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 2366f6b7d8 ecore-wl2: Add xdg_shell protocol files
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e4db8ef7c5 ecore-wl2: Add API function to return wl_display
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 7f34987f65 ecore-wl2: Modify ecore_wl2_display_create to take an optional socket name
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e4aa6eedc8 ecore-wl2: Use Eina_Stringshare type instead of const char
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d006ebff71 ecore-wl2: Start on code to handle globals being added or removed
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 35dfb992ca ecore-wl2: Add start of opaque Ecore_Wl2_Display structure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d013e678bb ecore-wl2: Add pkgconfig file for Ecore_Wl2 library
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 71e7efde0f ecore-wl2: Add wayland log handler callback to print wl log messages
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 674d3d386a ecore-wl2: Add ecore_wl2_display file to build order
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael d2dbbdc071 ecore-wl2: Link to wayland-server for ecore_wl2 library
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 8e8f2e480c ecore-wl2: Add start of doxygen infrastructure
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael e6a3a0736c ecore-wl2: Add API function for ecore_wl2_shutdown
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 26459b4492 ecore-wl2: Add events for adding and removing globals
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 04add6501d ecore-wl2: Add API function for ecore_wl2_init
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael c42fa00bfa ecore-wl2: Add start of headers for ecore_wl2 library
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 6458cae492 efl: Add Ecore_Wl2 library to configure.ac
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael a891d9f2ef ecore-wl2: Add Makefile for building Ecore_Wl2 library
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 73e87f071b ecore-wl: Make "server mode" a global
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
Chris Michael 64f76de07a ecore-wayland: Add support for using timer based animators if in
server mode

Summary: For E internal windows, we cannot use custom animator sources
due to Other animators using a timer-based solution. For this case,
when running in "server mode" for internal windows we will default to
a timer based animator solution.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-11 10:34:45 -05:00
285 changed files with 20207 additions and 3764 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@ tags
.libs
*.trs
*.log
*.core
*.exe
*.o
*.lo

View File

@ -244,6 +244,10 @@ if HAVE_ECORE_WAYLAND
pkgconfig_DATA += pc/ecore-wayland.pc
endif
if HAVE_ECORE_WL2
pkgconfig_DATA += pc/ecore-wl2.pc
endif
if HAVE_WIN32
pkgconfig_DATA += pc/ecore-win32.pc
endif
@ -297,7 +301,8 @@ cmakeconfig/EoConfigVersion.cmake
eolian_cmakeconfigdir = $(libdir)/cmake/Eolian/
eolian_cmakeconfig_DATA = \
cmakeconfig/EolianConfig.cmake \
cmakeconfig/EolianConfigVersion.cmake
cmakeconfig/EolianConfigVersion.cmake \
cmakeconfig/EolianHelper.cmake
eolian_cxx_cmakeconfigdir = $(libdir)/cmake/EolianCxx/
eolian_cxx_cmakeconfig_DATA = \

View File

@ -39,3 +39,5 @@ if(_pkgconfig_failed)
else()
set (EOLIAN_EO_DIR ${_pkgconfig_invoke_result})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/EolianHelper.cmake)

View File

@ -0,0 +1,79 @@
# macro to create a eolian generated c source file
#
# macro adds a generate rule, which depends on the original file the rule will output file.x
#
# The passed include snippet will just be added to the command
macro(_rule_eox file include deps)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${file}.x
COMMAND eolian_gen ${include} --gc -o ${CMAKE_CURRENT_SOURCE_DIR}/${file}.x ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${deps}
)
endmacro()
# macro to create a eolian generated header file
#
# other details are like the eox rule
macro(_rule_eoh file include deps)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${file}.h
COMMAND eolian_gen ${include} --gh -o ${CMAKE_CURRENT_SOURCE_DIR}/${file}.h ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${deps}
)
endmacro()
# Can be used to create .eo.x , .eo.h, .eot.h generator rules.
# <file>.eo files are generated into <file>.eo.x and <file>.eo.h files
# <file>.eot files are generated into <file>.eot.h files
# The standard include path of efl eolian files is automatically added to the includes
#
# build_files - A list of files
# relative_include_dirs - A list of dirs to include
#
# If one of the included files is changed the file will be rebuilded at the next
# make call
#
# The macro scans for .eo files, hey have to be in the build_files.
# The generator rules are just executed if the file is a dependecy of some lib/executable.
function(eo_rule_create build_files relative_include_dirs)
string(REPLACE "\n" "" EOLIAN_EO_DIR_WITHOUT_NEWLINE "${EOLIAN_EO_DIR}")
# add std includes
list(APPEND include_dirs
${EOLIAN_EO_DIR_WITHOUT_NEWLINE}
)
# convert relative to absolut
foreach(relative_include_dir ${relative_include_dirs})
list(APPEND include_dirs
${CMAKE_CURRENT_SOURCE_DIR}/${relative_include_dir}
)
endforeach()
# work with the absolut paths
foreach(include_cmd ${include_dirs})
# build include cmd
string(CONCAT includes "${includes}" " -I${include_cmd}")
# fetch dep files
file(GLOB_RECURSE files "${include_cmd}/*.eo")
foreach(file ${files})
list(APPEND dep_files ${file})
endforeach()
endforeach()
string(REPLACE " " ";" includes "${includes}")
foreach(file ${build_files})
get_filename_component(ext ${file} EXT)
if (ext MATCHES "^\\.eo$")
_rule_eoh("${file}" "${includes}" "${dep_files}")
_rule_eox("${file}" "${includes}" "${dep_files}")
endif()
if (ext MATCHES "^\\.eot$")
_rule_eoh("${file}" "${includes}" "${dep_files}")
endif()
endforeach()
endfunction()

View File

@ -878,6 +878,9 @@ EINA_CONFIG([MAGIC_DEBUG], [test "x${have_magic_debug}" = "xyes"])
AC_ARG_WITH([xattr-tests-path],
[AS_HELP_STRING([--with-xattr-tests-path=DIR],[path of xattr enabled directory to create test files])],[XATTR_TEST_DIR=${withval}][AC_DEFINE_UNQUOTED([XATTR_TEST_DIR],["$withval"], [xattr enabled directory])])
AC_ARG_WITH([dictionaries-hyphen-dir],
[AS_HELP_STRING([--with-dictionaries-hyphen-dir=DIR],[path of hunspell-compatible hyphen dictionaries])],[EVAS_DICTS_HYPHEN_DIR=${withval}][AC_DEFINE_UNQUOTED([EVAS_DICTS_HYPHEN_DIR],["$withval"], [Hunspell-compatible hyphen dictionaries install directory])])
### Checks for programs
### Checks for libraries
@ -1609,6 +1612,18 @@ AC_ARG_ENABLE([harfbuzz],
],
[want_harfbuzz="no"])
# Hyphenation
AC_ARG_ENABLE([hyphen],
[AS_HELP_STRING([--enable-hyphen],[enable text hyphenation support. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_hyphen="yes"
else
want_hyphen="no"
fi
],
[want_hyphen="no"])
# Egl
AC_ARG_ENABLE([egl],
[AS_HELP_STRING([--enable-egl],[enable EGL rendering. @<:@default=disabled@:>@])],
@ -2066,6 +2081,25 @@ EFL_EVAL_PKGS([EVAS])
### Checks for header files
if test "x$want_hyphen" = "xyes" ; then
EFL_CHECK_LIB_CODE([EVAS], [-lhyphen], [have_fct], [[
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <hyphen.h>
]], [[
HyphenDict *dict;
]])
if test "${have_fct}" = "no"; then
AC_MSG_ERROR([Cannot find the hyphen library.])
else
AC_DEFINE([HAVE_HYPHEN], [1], [have hunspell hyphen support])
fi
fi
if test "x$have_harfbuzz" = "xyes" ; then
CPPFLAGS_SAVE="$CPPFLAGS"
@ -2625,7 +2659,9 @@ AC_CHECK_TYPES([struct ipv6_mreq],
[have_ipv6="yes"],
[have_ipv6="no"],
[[
#include <netinet/in.h>
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif
@ -2807,6 +2843,8 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [ecore-input])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [ecore])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [eo])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [eina])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [evas])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [emile])
### Checks for header files
@ -2988,6 +3026,45 @@ EFL_EVAL_PKGS([ECORE_WAYLAND])
EFL_LIB_END_OPTIONAL([Ecore_Wayland])
#### End of Ecore_Wayland
#### Ecore_Wl2
EFL_LIB_START_OPTIONAL([Ecore_Wl2], [test "${want_wayland}" = "yes"])
if test "x${want_wayland_ivi_shell}" = "xyes" ; then
AC_DEFINE(USE_IVI_SHELL, 1, [Ecore_Wl2 IVI-Shell Support])
fi
### Additional options to configure
### Default values
### Checks for programs
### Checks for libraries
EFL_INTERNAL_DEPEND_PKG([ECORE_WL2], [ecore-input])
EFL_INTERNAL_DEPEND_PKG([ECORE_WL2], [ecore])
EFL_INTERNAL_DEPEND_PKG([ECORE_WL2], [eo])
EFL_INTERNAL_DEPEND_PKG([ECORE_WL2], [eina])
EFL_DEPEND_PKG([ECORE_WL2], [WAYLAND],
[wayland-server >= 1.8.0 wayland-client >= 1.8.0 wayland-cursor >= 1.8.0 xkbcommon >= 0.5.0])
EFL_EVAL_PKGS([ECORE_WL2])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
### Checks for linker characteristics
### Checks for library functions
EFL_LIB_END_OPTIONAL([Ecore_Wl2])
#### End of Ecore_Wl2
#### Eldbus
EFL_LIB_START([Eldbus])
@ -4216,7 +4293,7 @@ EFL_LIB_START([Edje])
### Default values
AC_ARG_ENABLE([multisense],
[AS_HELP_STRING([--enable-multisense],[Enable multisense support. @<:@default=enabled@:>@])],
[AS_HELP_STRING([--enable-multisense],[Enable multisense support. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
want_multisense="yes"
@ -4757,6 +4834,7 @@ pc/ecore-fb.pc
pc/ecore-psl1ght.pc
pc/ecore-sdl.pc
pc/ecore-wayland.pc
pc/ecore-wl2.pc
pc/ecore-win32.pc
pc/ecore-x.pc
pc/ecore-evas.pc
@ -4798,6 +4876,7 @@ cmakeconfig/EoConfig.cmake
cmakeconfig/EoConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in
cmakeconfig/EolianConfig.cmake
cmakeconfig/EolianConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in
cmakeconfig/EolianHelper.cmake
cmakeconfig/EolianCxxConfig.cmake
cmakeconfig/EolianCxxConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in
cmakeconfig/EinaCxxConfig.cmake
@ -4925,6 +5004,7 @@ echo "Ecore_IMF.......: yes (${features_ecore_imf})"
echo "Ecore_X.........: ${with_x11} (${features_ecore_x})"
echo "Ecore_SDL.......: $want_sdl"
echo "Ecore_Wayland...: $want_wayland"
echo "Ecore_Wl2.......: $want_wayland"
echo "IVI-Shell.......: $want_wayland_ivi_shell"
echo "Ecore_Buffer....: $want_ecore_buffer (${features_ecore_buffer})"
if test "${have_linux}" = "yes"; then

1
pc/.gitignore vendored
View File

@ -14,6 +14,7 @@
/ecore-psl1ght.pc
/ecore-sdl.pc
/ecore-wayland.pc
/ecore-wl2.pc
/ecore-win32.pc
/ecore-x.pc
/ecore.pc

12
pc/ecore-wl2.pc.in Normal file
View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: ecore-wl2
Description: E core library, Wayland module
Requires.private: @requirements_pc_ecore_wl2@
Version: @VERSION@
Libs: -L${libdir} -lecore_wl2
Libs.private: @requirements_libs_ecore_wl2@
Cflags: -I${includedir}/efl-@VMAJ@ -I${includedir}/ecore-wl2-@VMAJ@

View File

@ -40,6 +40,7 @@ include Makefile_Ecore_FB.am
include Makefile_Ecore_Psl1ght.am
include Makefile_Ecore_SDL.am
include Makefile_Ecore_Wayland.am
include Makefile_Ecore_Wl2.am
include Makefile_Ecore_Win32.am
include Makefile_Ecore_X.am
include Makefile_Ecore_IMF.am

View File

@ -7,12 +7,14 @@ lib_LTLIBRARIES += lib/ecore_cocoa/libecore_cocoa.la
installed_ecorecocoamainheadersdir = $(includedir)/ecore-cocoa-@VMAJ@
dist_installed_ecorecocoamainheaders_DATA = \
lib/ecore_cocoa/Ecore_Cocoa.h \
lib/ecore_cocoa/Ecore_Cocoa_Keys.h
lib/ecore_cocoa/Ecore_Cocoa_Cursor.h
lib_ecore_cocoa_libecore_cocoa_la_SOURCES = \
lib/ecore_cocoa/ecore_cocoa.m \
lib/ecore_cocoa/ecore_cocoa_keys.h \
lib/ecore_cocoa/ecore_cocoa_window.h \
lib/ecore_cocoa/ecore_cocoa_window.m \
lib/ecore_cocoa/ecore_cocoa_cnp.m \
lib/ecore_cocoa/ecore_cocoa_app.m \
lib/ecore_cocoa/ecore_cocoa_app.h \
lib/ecore_cocoa/ecore_cocoa_private.h

View File

@ -71,7 +71,8 @@ else
if HAVE_IPV6
lib_ecore_con_libecore_con_la_SOURCES += \
lib/ecore_con/ecore_con_dns.c \
static_libs/dns/dns.c
static_libs/dns/dns.c \
static_libs/dns/dns.h
else
lib_ecore_con_libecore_con_la_SOURCES += lib/ecore_con/ecore_con_info.c
endif

View File

@ -20,6 +20,7 @@ lib/ecore_evas/ecore_evas_private.h \
lib/ecore_evas/ecore_evas_extn.h \
lib/ecore_evas/ecore_evas_extn.c \
lib/ecore_evas/ecore_evas_wayland.h \
lib/ecore_evas/ecore_evas_cocoa.h \
lib/ecore_evas/ecore_evas_win32.h \
lib/ecore_evas/ecore_evas_x11.h \
lib/ecore_evas/ecore_evas_util.c
@ -186,15 +187,19 @@ modules_ecore_evas_engines_wayland_module_la_SOURCES = $(WAYLANDSOURCES)
modules_ecore_evas_engines_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@ECORE_EVAS_CFLAGS@ \
@ECORE_WAYLAND_CFLAGS@ \
@ECORE_WL2_CFLAGS@ \
-I$(top_srcdir)/src/modules/evas/engines/wayland_shm \
-I$(top_srcdir)/src/modules/evas/engines/wayland_egl \
@ECORE_WAYLAND_CFLAGS@
@ECORE_WAYLAND_CFLAGS@ \
@ECORE_WL2_CFLAGS@
modules_ecore_evas_engines_wayland_module_la_LIBADD = \
@USE_ECORE_EVAS_LIBS@ \
@USE_ECORE_WAYLAND_LIBS@
@USE_ECORE_WAYLAND_LIBS@ \
@USE_ECORE_WL2_LIBS@
modules_ecore_evas_engines_wayland_module_la_DEPENDENCIES = \
@USE_ECORE_EVAS_INTERNAL_LIBS@ \
@USE_ECORE_WAYLAND_INTERNAL_LIBS@
@USE_ECORE_WAYLAND_INTERNAL_LIBS@ \
@USE_ECORE_WL2_INTERNAL_LIBS@
modules_ecore_evas_engines_wayland_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
modules_ecore_evas_engines_wayland_module_la_LIBTOOLFLAGS = --tag=disable-static
endif

View File

@ -139,15 +139,15 @@ modules/ecore_imf/wayland/text-protocol.c
modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
@ECORE_IMF_CFLAGS@ \
@ECORE_EVAS_CFLAGS@ \
@ECORE_WAYLAND_CFLAGS@
@ECORE_WL2_CFLAGS@
modules_ecore_imf_wayland_module_la_LIBADD = \
@USE_ECORE_IMF_LIBS@ \
@USE_ECORE_EVAS_LIBS@ \
@USE_ECORE_WAYLAND_LIBS@
@USE_ECORE_WL2_LIBS@
modules_ecore_imf_wayland_module_la_DEPENDENCIES = \
@USE_ECORE_IMF_INTERNAL_LIBS@ \
@USE_ECORE_EVAS_INTERNAL_LIBS@ \
@USE_ECORE_WAYLAND_INTERNAL_LIBS@
@USE_ECORE_WL2_INTERNAL_LIBS@
modules_ecore_imf_wayland_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
modules_ecore_imf_wayland_module_la_LIBTOOLFLAGS = --tag=disable-static
endif

View File

@ -10,6 +10,7 @@ lib/ecore_win32/Ecore_Win32.h
lib_ecore_win32_libecore_win32_la_SOURCES = \
lib/ecore_win32/ecore_win32.c \
lib/ecore_win32/ecore_win32_clipboard.c \
lib/ecore_win32/ecore_win32_cursor.c \
lib/ecore_win32/ecore_win32_dnd.c \
lib/ecore_win32/ecore_win32_dnd_enumformatetc.cpp \
@ -19,6 +20,7 @@ lib/ecore_win32/ecore_win32_dnd_drop_target.cpp \
lib/ecore_win32/ecore_win32_event.c \
lib/ecore_win32/ecore_win32_window.c \
lib/ecore_win32/ecore_win32_private.h \
lib/ecore_win32/ecore_win32_cursor_x11.h \
lib/ecore_win32/ecore_win32_dnd_enumformatetc.h \
lib/ecore_win32/ecore_win32_dnd_data_object.h \
lib/ecore_win32/ecore_win32_dnd_drop_source.h \

30
src/Makefile_Ecore_Wl2.am Normal file
View File

@ -0,0 +1,30 @@
if HAVE_ECORE_WL2
### Library
lib_LTLIBRARIES += lib/ecore_wl2/libecore_wl2.la
installed_ecorewl2mainheadersdir = $(includedir)/ecore-wl2-@VMAJ@
dist_installed_ecorewl2mainheaders_DATA = lib/ecore_wl2/Ecore_Wl2.h
lib_ecore_wl2_libecore_wl2_la_SOURCES = \
lib/ecore_wl2/subsurface-client-protocol.h \
lib/ecore_wl2/subsurface-protocol.c \
lib/ecore_wl2/xdg-shell-client-protocol.h \
lib/ecore_wl2/xdg-shell-protocol.c \
lib/ecore_wl2/ecore_wl2_seat.c \
lib/ecore_wl2/ecore_wl2_subsurf.c \
lib/ecore_wl2/ecore_wl2_dnd.c \
lib/ecore_wl2/ecore_wl2_window.c \
lib/ecore_wl2/ecore_wl2_input.c \
lib/ecore_wl2/ecore_wl2_output.c \
lib/ecore_wl2/ecore_wl2_display.c \
lib/ecore_wl2/ecore_wl2.c \
lib/ecore_wl2/ecore_wl2_private.h
lib_ecore_wl2_libecore_wl2_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WL2_CFLAGS@
lib_ecore_wl2_libecore_wl2_la_LIBADD = @ECORE_WL2_LIBS@
lib_ecore_wl2_libecore_wl2_la_DEPENDENCIES = @ECORE_WL2_INTERNAL_LIBS@
lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
endif

View File

@ -2,8 +2,10 @@
### Library
ector_eolian_files_generic = \
lib/ector/ector_generic_surface.eo \
lib/ector/ector_generic_buffer.eo \
lib/ector/ector_renderer_generic_base.eo \
lib/ector/ector_renderer_generic_shape.eo \
lib/ector/ector_renderer_generic_buffer.eo \
lib/ector/ector_renderer_generic_gradient.eo \
lib/ector/ector_renderer_generic_gradient_radial.eo \
lib/ector/ector_renderer_generic_gradient_linear.eo
@ -12,6 +14,7 @@ ector_eolian_generic_h = $(ector_eolian_files_generic:%.eo=%.eo.h)
# Handle cairo backend
ector_eolian_files_cairo = \
lib/ector/cairo/ector_cairo_surface.eo \
lib/ector/cairo/ector_cairo_software_surface.eo \
lib/ector/cairo/ector_renderer_cairo_base.eo \
lib/ector/cairo/ector_renderer_cairo_shape.eo \
lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo \
@ -21,8 +24,11 @@ ector_eolian_cairo_h = $(ector_eolian_files_cairo:%.eo=%.eo.h)
# Handle default software backend
ector_eolian_files_software = \
lib/ector/software/ector_software_surface.eo \
lib/ector/software/ector_software_buffer.eo \
lib/ector/software/ector_software_buffer_base.eo \
lib/ector/software/ector_renderer_software_base.eo \
lib/ector/software/ector_renderer_software_shape.eo \
lib/ector/software/ector_renderer_software_buffer.eo \
lib/ector/software/ector_renderer_software_gradient_radial.eo \
lib/ector/software/ector_renderer_software_gradient_linear.eo
ector_eolian_software_h = $(ector_eolian_files_software:%.eo=%.eo.h)
@ -63,12 +69,13 @@ lib/ector/software/Ector_Software.h
lib_ector_libector_la_SOURCES = \
lib/ector/ector_main.c \
lib/ector/ector_surface.c \
lib/ector/ector_renderer_shape.c \
lib/ector/ector_renderer_base.c \
lib/ector/ector_renderer_gradient.c \
lib/ector/ector_renderer_gradient_radial.c \
lib/ector/ector_renderer_gradient_linear.c
lib/ector/ector_generic_buffer.c \
lib/ector/ector_renderer_generic_shape.c \
lib/ector/ector_renderer_generic_base.c \
lib/ector/ector_renderer_generic_buffer.c \
lib/ector/ector_renderer_generic_gradient.c \
lib/ector/ector_renderer_generic_gradient_radial.c \
lib/ector/ector_renderer_generic_gradient_linear.c
installed_ectorgenericheadersdir = $(includedir)/ector-@VMAJ@/generic
nodist_installed_ectorgenericheaders_DATA = $(ector_eolian_generic_h)
@ -79,25 +86,33 @@ lib/ector/cairo/ector_renderer_cairo_gradient_linear.c \
lib/ector/cairo/ector_renderer_cairo_gradient_radial.c \
lib/ector/cairo/ector_renderer_cairo_shape.c \
lib/ector/cairo/ector_renderer_cairo_base.c \
lib/ector/cairo/ector_cairo_software_surface.c \
lib/ector/cairo/ector_cairo_surface.c
installed_ectorcairoheadersdir = $(includedir)/ector-@VMAJ@/cairo
nodist_installed_ectorcairoheaders_DATA = $(ector_eolian_cairo_h)
# SW draw static lib
draw_sources = \
static_libs/draw/draw_main_sse2.c \
static_libs/draw/draw_main.c \
static_libs/draw/draw_main_neon.c \
$(NULL)
# And the default software backend
lib_ector_libector_la_SOURCES += \
lib/ector/software/ector_renderer_software_gradient_linear.c \
lib/ector/software/ector_renderer_software_gradient_radial.c \
lib/ector/software/ector_renderer_software_shape.c \
lib/ector/software/ector_renderer_software_buffer.c \
lib/ector/software/ector_software_gradient.c \
lib/ector/software/ector_software_rasterizer.c \
lib/ector/software/ector_software_surface.c \
lib/ector/software/ector_software_buffer.c \
static_libs/freetype/sw_ft_math.c \
static_libs/freetype/sw_ft_raster.c \
static_libs/freetype/sw_ft_stroker.c \
lib/ector/software/ector_drawhelper.c \
lib/ector/software/ector_drawhelper_sse2.c \
lib/ector/software/ector_drawhelper_neon.c
$(draw_sources)
installed_ectorsoftwareheadersdir = $(includedir)/ector-@VMAJ@/software
nodist_installed_ectorsoftwareheaders_DATA = $(ector_eolian_software_h)
@ -107,6 +122,7 @@ lib_ector_libector_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_builddir)/src/lib/ector/cairo \
-I$(top_builddir)/src/lib/ector/software \
-I$(top_srcdir)/src/static_libs/freetype \
-I$(top_srcdir)/src/static_libs/draw \
@ECTOR_CFLAGS@ \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
@ -150,10 +166,12 @@ endif
EXTRA_DIST += \
lib/ector/ector_private.h \
lib/ector/ector_buffer.h \
lib/ector/cairo/ector_cairo_private.h \
lib/ector/software/ector_drawhelper_private.h \
lib/ector/software/ector_software_private.h \
static_libs/freetype/sw_ft_math.h \
static_libs/freetype/sw_ft_raster.h \
static_libs/freetype/sw_ft_stroker.h \
static_libs/freetype/sw_ft_types.h
static_libs/freetype/sw_ft_types.h \
static_libs/draw/draw.h \
static_libs/draw/draw_private.h

View File

@ -1,3 +1,9 @@
# Even though libefl is new, it contains definitions used by legacy APIs
efl_eolian_legacy_files = \
lib/efl/interfaces/efl_gfx_fill.eo \
lib/efl/interfaces/efl_gfx_base.eo \
$(NULL)
efl_eolian_files = \
lib/efl/interfaces/efl_control.eo \
lib/efl/interfaces/efl_file.eo \
@ -5,9 +11,7 @@ efl_eolian_files = \
lib/efl/interfaces/efl_player.eo \
lib/efl/interfaces/efl_text.eo \
lib/efl/interfaces/efl_text_properties.eo \
lib/efl/interfaces/efl_gfx_base.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
lib/efl/interfaces/efl_gfx_fill.eo \
lib/efl/interfaces/efl_gfx_view.eo \
lib/efl/interfaces/efl_gfx_shape.eo \
lib/efl/interfaces/efl_gfx_gradient_base.eo \
@ -15,18 +19,22 @@ efl_eolian_files = \
lib/efl/interfaces/efl_gfx_gradient_radial.eo \
lib/efl/interfaces/efl_gfx_filter.eo \
lib/efl/interfaces/efl_model_base.eo \
$(efl_eolian_legacy_files) \
$(NULL)
efl_eolian_files_h = $(efl_eolian_files:%.eo=%.eo.h)
efl_eolian_files_c = $(efl_eolian_files:%.eo=%.eo.c)
efl_eolian_legacy_files_h = $(efl_eolian_legacy_files:%.eo=%.eo.legacy.h)
BUILT_SOURCES += \
$(efl_eolian_files_c) \
$(efl_eolian_files_h)
$(efl_eolian_files_h) \
$(efl_eolian_legacy_files_h)
CLEANFILES += \
$(efl_eolian_files_c) \
$(efl_eolian_files_h)
$(efl_eolian_files_h) \
$(efl_eolian_legacy_files_h)
EXTRA_DIST += \
lib/efl/Efl_Config.h \
@ -55,7 +63,8 @@ dist_installed_eflheaders_DATA = \
installed_eflinterfacesdir = $(includedir)/efl-@VMAJ@/interfaces
nodist_installed_eflinterfaces_DATA = \
$(efl_eolian_files_h)
$(efl_eolian_files_h) \
$(efl_eolian_legacy_files_h)
if HAVE_ELUA
@ -81,7 +90,7 @@ bin/efl/efl_debugd.c \
bin/efl/efl_debug_common.c \
bin/efl/efl_debug_common.h
bin_efl_efl_debugd_CPPFLAGS = -I$(top_builddir)/src/bin/efl @EINA_CFLAGS@ @ECORE_CFLAGS@ @ECORE_CON_CFLAGS@
bin_efl_efl_debugd_LDADD = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@
bin_efl_efl_debugd_LDADD = @EFL_LIBS@ @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@
bin_efl_efl_debugd_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@
bin_efl_efl_debug_SOURCES = \
@ -89,6 +98,6 @@ bin/efl/efl_debug.c \
bin/efl/efl_debug_common.c \
bin/efl/efl_debug_common.h
bin_efl_efl_debug_CPPFLAGS = -I$(top_builddir)/src/bin/efl @EINA_CFLAGS@ @ECORE_CFLAGS@ @ECORE_CON_CFLAGS@
bin_efl_efl_debug_LDADD = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@
bin_efl_efl_debug_LDADD = @EFL_LIBS@ @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@
bin_efl_efl_debug_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@

View File

@ -148,6 +148,7 @@ lib/evas/canvas/evas_object_box.c \
lib/evas/canvas/evas_object_table.c \
lib/evas/canvas/evas_object_text.c \
lib/evas/canvas/evas_object_textblock.c \
lib/evas/canvas/evas_textblock_hyphenation.x \
lib/evas/canvas/evas_object_textgrid.c \
lib/evas/canvas/evas_object_grid.c \
lib/evas/canvas/evas_font_dir.c \
@ -223,7 +224,8 @@ lib/evas/canvas/evas_canvas3d_node_callback.h
lib_evas_libevas_la_SOURCES += \
lib/evas/common3d/save_load/evas_model_load.c \
lib/evas/common3d/save_load/evas_model_save.c \
lib/evas/common3d/save_load/evas_model_common.c \
lib/evas/common3d/save_load/evas_model_load_save_common.c \
lib/evas/common3d/save_load/evas_model_load_save_common.h \
modules/evas/model_loaders/eet/evas_model_load_eet.c \
modules/evas/model_loaders/md2/evas_model_load_md2.c \
modules/evas/model_loaders/obj/evas_model_load_obj.c \
@ -257,6 +259,10 @@ lib/evas/canvas/evas_vg_gradient_radial.c \
lib/evas/canvas/evas_vg_utils.c \
lib/evas/canvas/evas_vg_shape.c
# Static draw lib
lib_evas_libevas_la_SOURCES += \
static_libs/draw/draw_alpha_main.c
# Engine
lib_evas_libevas_la_SOURCES += \
lib/evas/common/evas_op_copy_main_.c \
@ -265,7 +271,6 @@ lib/evas/common/evas_op_add_main_.c \
lib/evas/common/evas_op_sub_main_.c \
lib/evas/common/evas_op_mask_main_.c \
lib/evas/common/evas_op_mul_main_.c \
lib/evas/common/evas_alpha_main.c \
lib/evas/common/evas_blend_main.c \
lib/evas/common/evas_blit_main.c \
lib/evas/common/evas_convert_color.c \
@ -347,6 +352,7 @@ lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/evas/file \
-I$(top_srcdir)/src/lib/evas/include \
-I$(top_srcdir)/src/static_libs/libunibreak \
-I$(top_srcdir)/src/static_libs/draw \
-I$(top_builddir)/src/lib/evas/canvas \
-I$(top_builddir)/src/modules/evas/engines/software_generic \
-I$(top_builddir)/src/modules/evas/engines/gl_generic \
@ -552,19 +558,10 @@ lib/evas/filters/blur/blur_box_rgba_i386.c \
lib/evas/filters/blur/blur_box_rgba_sse3.c \
lib/evas/filters/blur/blur_box_rgba_neon.c
### Vector surface helper
EXTRA_DIST += \
modules/evas/engines/software_generic/ector_cairo_software_surface.eo \
modules/evas/engines/gl_generic/ector_cairo_software_surface.eo
### Engines
if EVAS_STATIC_BUILD_SOFTWARE_GENERIC
BUILT_SOURCES += \
modules/evas/engines/software_generic/ector_cairo_software_surface.eo.c \
modules/evas/engines/software_generic/ector_cairo_software_surface.eo.h
lib_evas_libevas_la_SOURCES += modules/evas/engines/software_generic/evas_engine.c modules/evas/engines/software_generic/ector_surface.c modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
lib_evas_libevas_la_SOURCES += modules/evas/engines/software_generic/evas_engine.c modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
lib_evas_libevas_la_LIBADD +=
else
enginesoftwaregenericpkgdir = $(libdir)/evas/modules/engines/software_generic/$(MODULE_ARCH)
@ -653,10 +650,6 @@ endif
endif
if BUILD_ENGINE_GL_COMMON
BUILT_SOURCES += \
modules/evas/engines/gl_generic/ector_cairo_software_surface.eo.c \
modules/evas/engines/gl_generic/ector_cairo_software_surface.eo.h
GL_COMMON_SOURCES = \
modules/evas/engines/gl_common/evas_gl_private.h \
modules/evas/engines/gl_common/evas_gl_common.h \
@ -737,7 +730,6 @@ modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x: modules/evas/engi
GL_GENERIC_SOURCES = \
modules/evas/engines/gl_generic/evas_engine.c \
modules/evas/engines/gl_generic/ector_surface.c \
modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
if EVAS_STATIC_BUILD_GL_COMMON
@ -2120,6 +2112,7 @@ tests_evas_evas_suite_SOURCES = \
tests/evas/evas_suite.c \
tests/evas/evas_test_init.c \
tests/evas/evas_test_object.c \
tests/evas/evas_test_object_smart.c \
tests/evas/evas_test_textblock.c \
tests/evas/evas_test_text.c \
tests/evas/evas_test_callbacks.c \
@ -2129,6 +2122,7 @@ tests/evas/evas_test_image.c \
tests/evas/evas_test_mesh.c \
tests/evas/evas_test_mask.c \
tests/evas/evas_test_evasgl.c \
tests/evas/evas_test_matrix.c \
tests/evas/evas_tests_helpers.h \
tests/evas/evas_suite.h

View File

@ -10,6 +10,7 @@ lib/evil/Evil.h \
lib/evil/evil_fcntl.h \
lib/evil/evil_inet.h \
lib/evil/evil_langinfo.h \
lib/evil/evil_locale.h \
lib/evil/evil_macro.h \
lib/evil/evil_macro_pop.h \
lib/evil/evil_main.h \
@ -35,6 +36,7 @@ lib/evil/evil_fnmatch.c \
lib/evil/evil_fnmatch_list_of_states.c \
lib/evil/evil_inet.c \
lib/evil/evil_langinfo.c \
lib/evil/evil_locale.c \
lib/evil/evil_link_xp.cpp \
lib/evil/evil_main.c \
lib/evil/evil_mman.c \

View File

@ -5587,7 +5587,8 @@ st_collections_group_parts_part_norepeat(void)
Specifies whether events with the given flags should be ignored,
i.e., will not have the signals emitted to the parts. Multiple flags
must be separated by spaces, the effect will be ignoring all events
with one of the flags specified. Possible flags:
with one of the flags specified.
Possible flags:
@li NONE (default value, no event will be ignored)
@li ON_HOLD
@endproperty
@ -5610,9 +5611,9 @@ st_collections_group_parts_part_ignore_flags(void)
@parameters
[FLAG] ...
@effect
Masks event flags with the given value, so event propagating from this part
will go with masked flags. Other library, like Elementary, can determine
whether it handles this event. Possible flags:
Masks event flags with the given value, so that the event can be repeated
to the lower object along with masked event flags.
Possible flags:
@li NONE (default value, no event will be masked)
@li ON_HOLD
@endproperty
@ -7524,8 +7525,8 @@ st_collections_group_parts_part_description_min(void)
check_min_arg_count(1);
if (is_param(1)) {
current_desc->min.w = parse_float_range(0, 0, 0x7fffffff);
current_desc->min.h = parse_float_range(1, 0, 0x7fffffff);
current_desc->min.w = parse_int_range(0, 0, 0x7fffffff);
current_desc->min.h = parse_int_range(1, 0, 0x7fffffff);
} else {
char *tmp;
@ -7586,8 +7587,8 @@ st_collections_group_parts_part_description_max(void)
check_min_arg_count(1);
if (is_param(1)) {
current_desc->max.w = parse_float_range(0, -1.0, 0x7fffffff);
current_desc->max.h = parse_float_range(1, -1.0, 0x7fffffff);
current_desc->max.w = parse_int_range(0, -1, 0x7fffffff);
current_desc->max.h = parse_int_range(1, -1, 0x7fffffff);
} else {
char *tmp;

View File

@ -35,8 +35,8 @@ int new_dir = 1;
int decomp(void);
void output(void);
static int compiler_cmd_is_sane();
static int root_filename_is_sane();
static int compiler_cmd_is_sane(void);
static int root_filename_is_sane(void);
static void

View File

@ -86,7 +86,7 @@ do_eet_list(const char *file, Eina_Bool verbose)
if (verbose)
{
printf("*** ***\n");
printf("Total payload size : %lli.\n", total);
printf("Total payload size : %llu.\n", total);
}
eet_close(ef);

View File

@ -534,7 +534,7 @@ icon_changes_listen_recursive(Eina_Inarray *stack, const char *path, Eina_Bool b
if (stat(path, &st) == -1) return;
if (eina_inarray_search(stack, &st, stat_cmp) >= 0) return;
if (!_check_recurse_monitor_sanity(stack, path, 8)) return;
if (!_check_recurse_monitor_sanity(stack, path, 10)) return;
eina_inarray_push(stack, &st);
if ((!S_ISDIR(st.st_mode)) && (base))
@ -573,7 +573,7 @@ desktop_changes_listen_recursive(Eina_Inarray *stack, const char *path, Eina_Boo
if (stat(path, &st) == -1) return;
if (eina_inarray_search(stack, &st, stat_cmp) >= 0) return;
if (!_check_recurse_monitor_sanity(stack, path, 3)) return;
if (!_check_recurse_monitor_sanity(stack, path, 10)) return;
eina_inarray_push(stack, &st);
if ((!S_ISDIR(st.st_mode)) && (base))
@ -698,7 +698,9 @@ error:
static void
read_lists(void)
{
fill_list("extra_desktops.dirs", &desktop_extra_dirs);
// dont use extra dirs as the only way to get extra dirs is by loading a
// specific desktop file at a specific path, and this is wrong
// fill_list("extra_desktops.dirs", &desktop_extra_dirs);
fill_list("extra_icons.dirs", &icon_extra_dirs);
fill_list("icons.exts", &icon_exts);
}

View File

@ -317,7 +317,6 @@ main(int argc, char **argv)
printf(" --help/-h Print that help\n");
printf(" --include/-I Include 'input_dir' as directory to search .eo files into\n");
printf(" --output/-o Force output filename to 'outfile'\n");
printf(" --eo Set generator to eo mode. Must be specified\n");
printf(" --gh Generate C header file [.h]\n");
printf(" --gs Generate C type stubs [.h]\n");
printf(" --gc Generate C source file [.c]\n");
@ -391,4 +390,4 @@ end:
eolian_shutdown();
eina_shutdown();
return ret;
}
}

View File

@ -198,9 +198,8 @@ types_header_generate(const char *eo_filename, Eina_Strbuf *buf, Eina_Bool full,
if (eolian_type_type_get(tp) == EOLIAN_TYPE_ALIAS)
{
const Eolian_Type *btp = eolian_type_base_type_get(tp);
if (eolian_type_type_get(btp) == EOLIAN_TYPE_REGULAR)
if (!strcmp(eolian_type_full_name_get(btp), "__undefined_type"))
continue;
if (eolian_type_type_get(btp) == EOLIAN_TYPE_UNDEFINED)
continue;
}
Eina_Strbuf *tbuf = _type_generate(tp, full, use_legacy);

View File

@ -292,8 +292,8 @@ void cserve2_slave_kill(Slave *s);
void cserve2_message_handler(int fd, Fd_Flags flags, void *data);
void cserve2_shm_init();
void cserve2_shm_shutdown();
void cserve2_shm_init(void);
void cserve2_shm_shutdown(void);
Shm_Handle *cserve2_shm_request(const char *infix, size_t size);
Shm_Handle *cserve2_shm_segment_request(Shm_Handle *shm, size_t size);
Shm_Handle *cserve2_shm_resize(Shm_Handle *shm, size_t newsize);
@ -394,8 +394,8 @@ int cserve2_shared_mempool_generation_id_set(Shared_Mempool *sm, int generation_
Shared_Array *cserve2_shared_mempool_index_get(Shared_Mempool *sm);
// Shared strings
const char *cserve2_shared_strings_table_name_get();
const char *cserve2_shared_strings_index_name_get();
const char *cserve2_shared_strings_table_name_get(void);
const char *cserve2_shared_strings_index_name_get(void);
int cserve2_shared_string_add(const char *str);
int cserve2_shared_string_ref(int id);
void cserve2_shared_string_del(int id);

View File

@ -45,7 +45,7 @@ test_pipe_test(void)
int sockets[2];
struct timeval t;
fd_set rfds;
int ret;
int ret = 0;
data *d;
DWORD thread_id;
HANDLE h;

View File

@ -280,6 +280,7 @@ ffi.cdef [[
const char *eolian_type_file_get(const Eolian_Type *tp);
const Eolian_Type *eolian_type_return_type_get(const Eolian_Type *tp);
const Eolian_Type *eolian_type_base_type_get(const Eolian_Type *tp);
const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp);
const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp);
Eina_Bool eolian_type_is_own(const Eolian_Type *tp);
Eina_Bool eolian_type_is_const(const Eolian_Type *tp);
@ -423,7 +424,8 @@ M.type_type = {
STRUCT_OPAQUE = 7,
ENUM = 8,
ALIAS = 9,
CLASS = 10
CLASS = 10,
UNDEFINED = 11
}
ffi.metatype("Eolian_Struct_Type_Field", {
@ -538,6 +540,12 @@ M.Type = ffi.metatype("Eolian_Type", {
return v
end,
aliased_base_get = function(self)
local v = eolian.eolian_type_aliased_byse_get(self)
if v == nil then return nil end
return v
end,
class_get = function(self)
local v = eolian.eolian_type_class_get(self)
if v == nil then return nil end

View File

@ -144,7 +144,7 @@ main(void)
return -1;
}
cd = (Consumer_Data *)calloc(sizeof(Consumer_Data), 1);
cd = (Consumer_Data *)calloc(1, sizeof(Consumer_Data));
if (!cd || !(cd->consumer = ecore_buffer_consumer_new(name, queue_size, WIDTH, HEIGHT)))
{

View File

@ -244,7 +244,7 @@ main(void)
return -1;
}
pd = (Provider_Data *)calloc(sizeof(Provider_Data), 1);
pd = (Provider_Data *)calloc(1, sizeof(Provider_Data));
if (!pd || !(pd->provider = ecore_buffer_provider_new(name)))
{

View File

@ -49,7 +49,8 @@ toggle_using_filter.edc \
box_example.edc \
embryo_tween_anim.edc \
embryo_set_state_anim.edc \
bezier-transition-example.edc
bezier-transition-example.edc \
textblock-hyphen.edc
DIST_EDCS = $(EDCS)
@ -106,7 +107,8 @@ edje-basic2.c \
signals2.c \
edje-swallow2.c \
edje-multisense.c \
edje-edit-part-box.c
edje-edit-part-box.c \
edje-textblock-hyphenation.c
EXTRA_DIST = $(DIST_EDCS) $(DATA_FILES)
@ -175,7 +177,8 @@ animations2 \
edje-basic2 \
signals2 \
edje-swallow2 \
edje-edit-part-box
edje-edit-part-box \
edje-textblock-hyphenation
if ENABLE_MULTISENSE
EXTRA_PROGRAMS += edje-multisense

View File

@ -0,0 +1,114 @@
/**
* Edje example for hyphenation option with TEXTBLOCK parts
*
* You'll need at least one Evas engine built for it (excluding the
* buffer one). See stdout/stderr for output.
*
* @verbatim
* edje_cc swallow.edc && gcc -o edje-textblock-hyphenation edje-textblock-hyphenation.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
* @endverbatim
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#else
# define EINA_UNUSED
#endif
#ifndef PACKAGE_DATA_DIR
#define PACKAGE_DATA_DIR "."
#endif
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Edje.h>
#include <locale.h>
#define WIDTH (300)
#define HEIGHT (300)
static void
_on_delete(Ecore_Evas *ee EINA_UNUSED)
{
ecore_main_loop_quit();
}
/* here just to keep our example's window size and background image's
* size in synchrony */
static void
_on_canvas_resize(Ecore_Evas *ee)
{
Evas_Object *bg, *edj;
int w;
int h;
ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
bg = ecore_evas_data_get(ee, "background");
evas_object_resize(bg, w, h);
edj = ecore_evas_data_get(ee, "edje_obj");
evas_object_resize(edj, w, h);
}
int
main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
{
const char *edje_file = PACKAGE_DATA_DIR"/textblock-hyphen.edj";
Ecore_Evas *ee;
Evas *evas;
Evas_Object *bg;
Evas_Object *edje_obj;
if (!ecore_evas_init())
return EXIT_FAILURE;
if (!edje_init())
goto shutdown_ecore_evas;
/* this will give you a window with an Evas canvas under the first
* engine available */
ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
if (!ee) goto shutdown_edje;
ecore_evas_callback_delete_request_set(ee, _on_delete);
ecore_evas_callback_resize_set(ee, _on_canvas_resize);
ecore_evas_title_set(ee, "Edje Textblock Hyphenation");
evas = ecore_evas_get(ee);
bg = evas_object_rectangle_add(evas);
evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
evas_object_move(bg, 0, 0); /* at canvas' origin */
evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
evas_object_show(bg);
ecore_evas_data_set(ee, "background", bg);
setlocale(LC_MESSAGES, "en_US.UTF-8");
edje_obj = edje_object_add(evas);
edje_object_file_set(edje_obj, edje_file, "example_textblock_hyphenation");
evas_object_move(edje_obj, 0, 0); /* at canvas' origin */
evas_object_resize(edje_obj, WIDTH, HEIGHT);
evas_object_show(edje_obj);
ecore_evas_data_set(ee, "edje_obj", edje_obj);
edje_object_part_text_set(edje_obj, "text_part", "Hello world hyphenation world");
ecore_evas_show(ee);
ecore_main_loop_begin();
ecore_evas_free(ee);
ecore_evas_shutdown();
edje_shutdown();
return EXIT_SUCCESS;
shutdown_edje:
edje_shutdown();
shutdown_ecore_evas:
ecore_evas_shutdown();
return EXIT_FAILURE;
}

View File

@ -0,0 +1,29 @@
collections {
styles {
style { name: "entry_style";
base: "font="DejavuSans" font_size=10 color=#000 wrap=hyphenation left_margin=2 right_margin=2";
}
}
group {
name: "example_textblock_hyphenation";
min: 10 50;
parts {
part {
name: "text_part"; type: TEXTBLOCK;
description {
min: 10 50;
state: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
text {
style: "entry_style";
min: 0 1;
align: 0.0 0.0;
}
}
}
}
}
}

View File

@ -17,6 +17,7 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
char *time_arr;
time_t curr_time;
struct tm *info;
char *b64;
eina_init();
@ -68,6 +69,10 @@ int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
printf("Today's Date: %s\n", time_arr);
free(time_arr);
b64 = eina_str_base64_encode((unsigned char *)"Enlightenment", 9);
printf("%s\n", b64);
free(b64);
eina_shutdown();
return 0;

View File

@ -141,10 +141,10 @@ eolian_cxx_complex_types_01_SOURCES = eolian_cxx_complex_types_01.cc
true $<
%.eo.c: %.eo
$(AM_V_EOL)$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
$(AM_V_EOL)$(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
%.eo.h: %.eo
$(AM_V_EOL)$(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o $@ $<
$(AM_V_EOL)$(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o $@ $<
examples: $(ECXX_EXAMPLE_EOS) $(GENERATED) $(EXTRA_PROGRAMS)

View File

@ -28,10 +28,10 @@ all: $(OBJS) examples
codegen:
$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourable.eo -o colourable.eo.hh
$(EOLIAN_CXX) $(EOLIAN_FLAGS) -I./colourablesquare.eo -o colourablesquare.eo.hh
$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourable.eo.c colourable.eo
$(EOLIAN_GEN) --eo --legacy $(EOLIAN_FLAGS) --gc -o colourablesquare.eo.c colourablesquare.eo
$(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourable.eo.h colourable.eo
$(EOLIAN_GEN) --eo $(EOLIAN_FLAGS) --gh -o colourablesquare.eo.h colourablesquare.eo
$(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gc -o colourable.eo.c colourable.eo
$(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gc -o colourablesquare.eo.c colourablesquare.eo
$(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o colourable.eo.h colourable.eo
$(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o colourablesquare.eo.h colourablesquare.eo
$(OBJS): codegen
$(CC) -c colourable.c $(COMMON_FLAGS)

View File

@ -5,7 +5,7 @@
* one). See stdout/stderr for output.
*
* @verbatim
* gcc -o evas_vg_simple evas-vg-simple.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl`
* gcc -o evas_vg_simple evas-vg-simple.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` -lm
* @endverbatim
*/
@ -370,9 +370,9 @@ void _arcto(Efl_VG *obj, int x, int y, int width, int height, int startAngle, in
for (i = 0; i < point_count; i += 3)
{
evas_vg_shape_shape_append_cubic_to(obj,
pts[i+2].x, pts[i+2].y,
pts[i].x, pts[i].y,
pts[i+1].x, pts[i+1].y);
pts[i+1].x, pts[i+1].y,
pts[i+2].x, pts[i+2].y);
}
evas_vg_shape_shape_append_close(obj);
}

View File

@ -1,3 +1,10 @@
/**
* @file Ecore_Cocoa.h
*
* @brief Ecore_Cocoa Wrapper Library to interact with the Cocoa
* envirnement (Mac OS X) from the E environment
*
*/
#ifndef __ECORE_COCOA_H__
#define __ECORE_COCOA_H__
@ -26,27 +33,58 @@
#endif
#include <Eina.h>
#include "Ecore_Cocoa_Cursor.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @typedef Ecore_Cocoa_Window
* Opaque handler to manipulate a Cocoa Window through Ecore
*/
#ifndef _ECORE_COCOA_WINDOW_PREDEF
typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
#endif /* ! _ECORE_COCOA_WINDOW_PREDEF */
/**
* @typedef Ecore_Cocoa_Screen
* Opaque handler to manipulate a Cocoa Screen through Ecore
*/
typedef struct _Ecore_Cocoa_Screen Ecore_Cocoa_Screen;
/**
* @typedef Ecore_Cocoa_Window_Id
* Opaque handler to reference the actual Cocoa window
*/
typedef void * Ecore_Cocoa_Window_Id;
/**
* @typedef Ecore_Cocoa_Event_Video_Resize
* Type of event thrown when a window is resized
*/
typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
/** Event triggered when a window receives focus */
EAPI extern int ECORE_COCOA_EVENT_GOT_FOCUS;
/** Event triggered when a window loses focus */
EAPI extern int ECORE_COCOA_EVENT_LOST_FOCUS;
/** Event triggered when a window is resized */
EAPI extern int ECORE_COCOA_EVENT_RESIZE;
EAPI extern int ECORE_COCOA_EVENT_EXPOSE;
EAPI extern int ECORE_COCOA_EVENT_WINDOW_DESTROY;
typedef void * Ecore_Cocoa_Window_Id;
typedef struct _Ecore_Cocoa_Event_Video_Resize Ecore_Cocoa_Event_Video_Resize;
/**
* @struct _Ecore_Cocoa_Event_Video_Resize
* Data available when a window is resized
*/
struct _Ecore_Cocoa_Event_Video_Resize
{
int w;
int h;
Ecore_Cocoa_Window_Id wid;
int w; /**< Current width of the window */
int h; /**< Current height of the window */
Ecore_Cocoa_Window_Id wid; /**< Handler of the Cocoa window */
};
typedef struct _Ecore_Cocoa_Event_Window Ecore_Cocoa_Event_Window;
@ -60,35 +98,106 @@ struct _Ecore_Cocoa_Screen
int dummy;
};
/* Core */
/**
* @typedef Ecore_Cocoa_Cnp_Type
* Type used to interact with the Cocoa pasteboard.
* It hold types that can apply to a context.
*/
typedef enum
{
ECORE_COCOA_CNP_TYPE_UNKNOWN = 0, /**< Undefined type */
ECORE_COCOA_CNP_TYPE_STRING = (1 << 0), /**< String type (pure text) */
ECORE_COCOA_CNP_TYPE_MARKUP = (1 << 1), /**< Elementary markup */
ECORE_COCOA_CNP_TYPE_IMAGE = (1 << 2), /**< Image (all formats) */
ECORE_COCOA_CNP_TYPE_HTML = (1 << 3) /**< HTML */
} Ecore_Cocoa_Cnp_Type;
EAPI int ecore_cocoa_init(void);
EAPI int ecore_cocoa_shutdown(void);
EAPI Eina_Bool ecore_cocoa_feed_events(void *anEvent);
/* Screen */
/*============================================================================*
* Core *
*============================================================================*/
/**
* Inits the Ecore_Cocoa library
* @return How many times Ecore_Cocoa has been initted
*/
EAPI int ecore_cocoa_init(void);
/**
* Shuts the Ecore_Cocoa library down
* @return How many times Ecore_Cocoa has been initted
*/
EAPI int ecore_cocoa_shutdown(void);
/*============================================================================*
* Screen *
*============================================================================*/
/**
* Retrieves the size of a Cocoa screen
* @param screen The screen which size must be retrieved
* @param [out] w The width of the screen
* @param [out] h The height of the screen
*/
EAPI void ecore_cocoa_screen_size_get(Ecore_Cocoa_Screen *screen, int *w, int *h);
/* Window */
/*============================================================================*
* Window *
*============================================================================*/
/**
* Creates a Cocoa window
* @param x The origin (X) where the window must be created
* @param y The origin (Y) where the window must be created
* @param width The width of the window
* @param height The height of the window
* @return A handler on the window. NULL on failure
*/
EAPI Ecore_Cocoa_Window *ecore_cocoa_window_new(int x,
int y,
int width,
int height);
/**
* Releases a Cocoa window
* @param window The window to be released
*/
EAPI void ecore_cocoa_window_free(Ecore_Cocoa_Window *window);
EAPI void *ecore_cocoa_window_hwnd_get(Ecore_Cocoa_Window *window);
/**
* Moves a Cocoa window to a given point
* @param window The window to be moved
* @param x The new origin of the window (X)
* @param y The new origin of the window (Y)
*/
EAPI void ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
int x,
int y);
/**
* Resizes a Cocoa window to a given size
* @param window The window to be moved
* @param width The new width of the window
* @param height The new height of the window
*/
EAPI void ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
int width,
int height);
/**
* Moves and resizes a Cocoa window to a given point and size
* @param window The window to be moved
* @param x The new origin of the window (X)
* @param y The new origin of the window (Y)
* @param width The new width of the window
* @param height The new height of the window
* @see ecore_cocoa_window_resize()
* @see ecore_cocoa_window_move()
*/
EAPI void ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window,
int x,
int y,
@ -163,7 +272,18 @@ EAPI void ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
EAPI int ecore_cocoa_titlebar_height_get(void);
EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window);
EAPI Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window);
EAPI Eina_Bool ecore_cocoa_selection_clipboard_set(const void *data, int size, Ecore_Cocoa_Cnp_Type type);
EAPI void *ecore_cocoa_selection_clipboard_get(int *size, Ecore_Cocoa_Cnp_Type type,
Ecore_Cocoa_Cnp_Type *retrieved_types);
EAPI void ecore_cocoa_selection_clipboard_clear(void);
EAPI void ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win, Ecore_Cocoa_Cursor c);
EAPI void ecore_cocoa_window_cursor_show(Ecore_Cocoa_Window *win, Eina_Bool show);
#ifdef __cplusplus
}

View File

@ -0,0 +1,32 @@
#ifndef __ECORE_COCOA_CURSOR_H__
#define __ECORE_COCOA_CURSOR_H__
typedef enum
{
ECORE_COCOA_CURSOR_ARROW = 0,
ECORE_COCOA_CURSOR_CONTEXTUAL_MENU,
ECORE_COCOA_CURSOR_CLOSED_HAND,
ECORE_COCOA_CURSOR_CROSSHAIR,
ECORE_COCOA_CURSOR_DISAPPEARING_ITEM,
ECORE_COCOA_CURSOR_DRAG_COPY,
ECORE_COCOA_CURSOR_DRAG_LINK,
ECORE_COCOA_CURSOR_IBEAM,
ECORE_COCOA_CURSOR_OPEN_HAND,
ECORE_COCOA_CURSOR_OPERATION_NOT_ALLOWED,
ECORE_COCOA_CURSOR_POINTING_HAND,
ECORE_COCOA_CURSOR_RESIZE_DOWN,
ECORE_COCOA_CURSOR_RESIZE_LEFT,
ECORE_COCOA_CURSOR_RESIZE_LEFT_RIGHT,
ECORE_COCOA_CURSOR_RESIZE_RIGHT,
ECORE_COCOA_CURSOR_RESIZE_UP,
ECORE_COCOA_CURSOR_RESIZE_UP_DOWN,
ECORE_COCOA_CURSOR_IBEAM_VERTICAL,
__ECORE_COCOA_CURSOR_LAST, /* Sentinel */
ECORE_COCOA_CURSOR_DEFAULT = ECORE_COCOA_CURSOR_ARROW
} Ecore_Cocoa_Cursor;
#endif /* ! __ECORE_COCOA_CURSOR_H__ */

View File

@ -12,13 +12,16 @@
#include <Ecore_Input.h>
#include "Ecore_Cocoa.h"
#include "Ecore_Cocoa_Keys.h"
#define _ECORE_COCOA_KEYS_MANUAL_GUARD_
#include "ecore_cocoa_keys.h"
#undef _ECORE_COCOA_KEYS_MANUAL_GUARD_
#include "ecore_cocoa_private.h"
EAPI int ECORE_COCOA_EVENT_GOT_FOCUS = 0;
EAPI int ECORE_COCOA_EVENT_LOST_FOCUS = 0;
EAPI int ECORE_COCOA_EVENT_RESIZE = 0;
EAPI int ECORE_COCOA_EVENT_EXPOSE = 0;
EAPI int ECORE_COCOA_EVENT_WINDOW_DESTROY = 0;
static int _ecore_cocoa_init_count = 0;
@ -47,13 +50,13 @@ ecore_cocoa_init(void)
}
DBG("");
ECORE_COCOA_EVENT_GOT_FOCUS = ecore_event_type_new();
ECORE_COCOA_EVENT_LOST_FOCUS = ecore_event_type_new();
ECORE_COCOA_EVENT_RESIZE = ecore_event_type_new();
ECORE_COCOA_EVENT_EXPOSE = ecore_event_type_new();
ECORE_COCOA_EVENT_WINDOW_DESTROY = ecore_event_type_new();
/* Init the Application handler */
[Ecore_Cocoa_Application sharedApplication];
[NSApp setDelegate:[Ecore_Cocoa_AppDelegate appDelegate]];
@ -61,6 +64,9 @@ ecore_cocoa_init(void)
/* Start events monitoring */
[NSApp run];
if (!_ecore_cocoa_window_init())
return --_ecore_cocoa_init_count;
return _ecore_cocoa_init_count;
}
@ -85,7 +91,7 @@ ecore_cocoa_shutdown(void)
}
static unsigned int
_ecore_cocoa_event_modifiers(unsigned int mod)
_ecore_cocoa_event_modifiers(NSUInteger mod)
{
unsigned int modifiers = 0;
@ -95,13 +101,15 @@ _ecore_cocoa_event_modifiers(unsigned int mod)
if(mod & NSCommandKeyMask) modifiers |= ECORE_EVENT_MODIFIER_WIN;
if(mod & NSNumericPadKeyMask) modifiers |= ECORE_EVENT_LOCK_NUM;
DBG("key modifiers: %d, %d", mod, modifiers);
DBG("key modifiers: 0x%lx, %u", mod, modifiers);
return modifiers;
}
static inline Ecore_Event_Key*
_ecore_cocoa_event_key(NSEvent *event, int keyType)
static Ecore_Event_Key*
_ecore_cocoa_event_key(NSEvent *event,
NSEventType keyType,
unsigned int time)
{
static Eina_Bool compose = EINA_FALSE;
static NSText *edit;
@ -113,7 +121,7 @@ _ecore_cocoa_event_key(NSEvent *event, int keyType)
NSString *keychar = [event charactersIgnoringModifiers];
NSString *keycharRaw = [event characters];
DBG("Event Key, keyTpe : %d", keyType);
DBG("Event Key, keyType : %lu", keyType);
ev = calloc(1, sizeof (Ecore_Event_Key));
if (!ev) return NULL;
@ -124,6 +132,7 @@ _ecore_cocoa_event_key(NSEvent *event, int keyType)
compose=EINA_FALSE;
}
ev->timestamp = time;
ev->modifiers = _ecore_cocoa_event_modifiers([event modifierFlags]);
ev->keycode = event.keyCode;
@ -163,8 +172,8 @@ _ecore_cocoa_event_key(NSEvent *event, int keyType)
return ev;
}
EAPI Eina_Bool
ecore_cocoa_feed_events(void *anEvent)
Eina_Bool
_ecore_cocoa_feed_events(void *anEvent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(anEvent, EINA_FALSE);
@ -194,10 +203,9 @@ ecore_cocoa_feed_events(void *anEvent)
{
Ecore_Event_Key *ev;
ev = _ecore_cocoa_event_key(event, NSKeyDown);
ev = _ecore_cocoa_event_key(event, NSKeyDown, time);
if (ev == NULL) return EINA_TRUE;
ev->timestamp = time;
ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
break;
@ -206,17 +214,16 @@ ecore_cocoa_feed_events(void *anEvent)
{
Ecore_Event_Key *ev;
ev = _ecore_cocoa_event_key(event, NSKeyUp);
ev = _ecore_cocoa_event_key(event, NSKeyUp, time);
if (ev == NULL) return EINA_TRUE;
ev->timestamp = time;
ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
break;
}
case NSFlagsChanged:
{
int flags = [event modifierFlags];
NSUInteger flags = [event modifierFlags];
Ecore_Event_Key *evDown = NULL;
Ecore_Event_Key *evUp = NULL;
@ -254,7 +261,7 @@ ecore_cocoa_feed_events(void *anEvent)
return pass;
}
int changed_flags = flags ^ old_flags;
NSUInteger changed_flags = flags ^ old_flags;
// Turn special key flags off
if (changed_flags & NSShiftKeyMask)
@ -280,37 +287,6 @@ ecore_cocoa_feed_events(void *anEvent)
break;
}
case NSAppKitDefined:
{
if ([event subtype] == NSApplicationActivatedEventType)
{
Ecore_Cocoa_Event_Window *ev;
ev = malloc(sizeof(Ecore_Cocoa_Event_Window));
if (!ev)
{
pass = EINA_FALSE;
break;
}
ev->wid = [event window];
ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, ev, NULL, NULL);
}
else if ([event subtype] == NSApplicationDeactivatedEventType)
{
Ecore_Cocoa_Event_Window *ev;
ev = malloc(sizeof(Ecore_Cocoa_Event_Window));
if (!ev)
{
pass = EINA_FALSE;
break;
}
ev->wid = [event window];
ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, ev, NULL, NULL);
}
pass = EINA_TRUE; // pass along AppKit events, for window manager
break;
}
case NSScrollWheel:
{
DBG("Scroll Wheel");

View File

@ -18,13 +18,15 @@
- (id)init;
- (void)internalUpdate;
- (void) pauseNSRunLoopMonitoring;
- (void) resumeNSRunLoopMonitoring;
@end
@interface Ecore_Cocoa_AppDelegate : NSObject <NSApplicationDelegate>
+ (Ecore_Cocoa_AppDelegate *)appDelegate;
- (id)init;
@end

View File

@ -52,10 +52,17 @@ _ecore_cocoa_run_loop_cb(void *data EINA_UNUSED)
{
self = [super init];
if (self == nil) {
// XXX Critical error. Abort right now! Log?
return nil;
CRI("Failed to [super init]");
return nil;
}
NSApp = self; // NSApp is used EVERYWHERE! Set it right now!
/* Set the process to be a foreground process,
* without that it prevents the window to become the key window and
* receive all mouse mouve events. */
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp activateIgnoringOtherApps:YES];
return NSApp;
}
@ -83,11 +90,26 @@ _ecore_cocoa_run_loop_cb(void *data EINA_UNUSED)
/* Some events shall be handled by Ecore (like single non-command keys).
* If we dispatch all events right to NSApplication, it will complain
* with NSBeep() when an event is not authorized */
to_super = ecore_cocoa_feed_events(anEvent);
to_super = _ecore_cocoa_feed_events(anEvent);
if (to_super)
[super sendEvent:anEvent];
}
- (void) pauseNSRunLoopMonitoring
{
/*
* After calling this method, we will run an iteration of
* the main loop. We don't want this timer to be fired while
* calling manually the ecore loop, because it will query the
* NSRunLoop, which blocks during live resize.
*/
ecore_timer_freeze(_timer);
}
- (void) resumeNSRunLoopMonitoring
{
ecore_timer_thaw(_timer);
}
@end
@ -105,13 +127,7 @@ static Ecore_Cocoa_AppDelegate *_appDelegate = nil;
return _appDelegate;
}
- (id)init
{
self = [super init];
return self;
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *) EINA_UNUSED sender
{
// XXX This should be alterable (by Elm_Window policy)
return YES;

View File

@ -0,0 +1,173 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Eina.h>
#include <Evas.h>
#import <Cocoa/Cocoa.h>
#import "ecore_cocoa_window.h"
#include "ecore_cocoa_private.h"
#import "ecore_cocoa_app.h"
EAPI Eina_Bool
ecore_cocoa_selection_clipboard_set(const void *data,
int size,
Ecore_Cocoa_Cnp_Type type)
{
NSMutableArray *objects;
NSString *str = nil;
BOOL ok = YES;
objects = [[NSMutableArray alloc] init];
if (type & ECORE_COCOA_CNP_TYPE_STRING)
{
str = [[NSString alloc] initWithBytes: data
length: size
encoding: NSUTF8StringEncoding];
[objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
{
char *utf8;
utf8 = evas_textblock_text_markup_to_utf8(NULL, (const char *)data);
str = [[NSString alloc] initWithBytes: utf8
length: strlen(utf8) // XXX strlen() ?
encoding: NSUTF8StringEncoding];
free(utf8);
[objects addObject: str];
}
if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
{
WRN("Image CNP: NOT IMPLEMENTED");
}
if (type & ECORE_COCOA_CNP_TYPE_HTML)
{
WRN("HTML CNP: NOT IMPLEMENTED");
}
/* Write to pasteboard */
if ([objects count] > 0)
{
NSPasteboard *pb;
pb = [NSPasteboard generalPasteboard];
[pb clearContents];
ok = [pb writeObjects: objects];
[objects removeAllObjects];
}
return (ok) ? EINA_TRUE : EINA_FALSE;
}
EAPI void *
ecore_cocoa_selection_clipboard_get(int *size,
Ecore_Cocoa_Cnp_Type type,
Ecore_Cocoa_Cnp_Type *retrieved_types)
{
NSMutableArray *classes;
void *data;
NSDictionary *options;
NSPasteboard *pb;
NSArray *items;
unsigned int len;
BOOL string_class = NO;
Ecore_Cocoa_Cnp_Type types = 0;
classes = [[NSMutableArray alloc] init];
if ((type & ECORE_COCOA_CNP_TYPE_STRING) ||
(type & ECORE_COCOA_CNP_TYPE_MARKUP))
{
string_class = YES;
[classes addObject: [NSString class]];
}
if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
{
WRN("Image CNP: NOT IMPLEMENTED");
}
if (type & ECORE_COCOA_CNP_TYPE_HTML)
{
WRN("HTML CNP: NOT IMPLEMENTED");
}
if ([classes count] <= 0)
{
ERR("No registered classes... got nothing from pasteboard");
goto fail;
}
pb = [NSPasteboard generalPasteboard];
options = [NSDictionary dictionary];
items = [pb readObjectsForClasses: classes
options: options];
if (!items)
{
ERR("No items in the clipboard");
goto remove_fail;
}
if ([items count] != 1)
{
ERR("%lu items in pasteboard. Only one at the time can be handled",
[items count]);
goto fail;
}
if (string_class)
{
NSString *str = [items objectAtIndex: 0];
data = (void *)[str UTF8String];
len = [str lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
data = strndup((const char *)data, len);
if (EINA_UNLIKELY(!data))
{
CRI("Failed to strndup() string \"%s\" (len: %u)",
(const char *)data, len);
goto remove_fail;
}
types |= ECORE_COCOA_CNP_TYPE_STRING;
#if 0
if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
{
char *markup;
markup = evas_textblock_text_utf8_to_markup(NULL, data);
free(data);
data = markup;
if (EINA_UNLIKELY(!data))
{
CRI("Failed to retrieve markup from UTF8");
goto remove_fail;
}
len = strlen(markup);
}
#endif
}
if (!types)
{
ERR("No types retrieved!");
goto remove_fail;
}
[classes removeAllObjects];
if (size) *size = len;
if (retrieved_types) *retrieved_types = types;
return data;
remove_fail:
[classes removeAllObjects];
fail:
if (size) *size = 0;
if (retrieved_types) *retrieved_types = 0;
return NULL;
}
EAPI void
ecore_cocoa_selection_clipboard_clear(void)
{
[[NSPasteboard generalPasteboard] clearContents];
}

View File

@ -1,6 +1,12 @@
#ifndef ECORE_COCOA_KEYS_H__
#define ECORE_COCOA_KEYS_H__
/* Prevent innocent devs to include this directly. */
#ifndef _ECORE_COCOA_KEYS_MANUAL_GUARD_
# error This header must be be included directly!
#endif
struct _ecore_cocoa_keys_s
{
int code;

View File

@ -62,4 +62,11 @@ struct _Ecore_Cocoa_Window
};
/* Internal init */
Eina_Bool _ecore_cocoa_window_init(void);
Eina_Bool _ecore_cocoa_feed_events(void *anEvent);
#endif

View File

@ -6,9 +6,14 @@
#include <Ecore.h>
#include <Ecore_Cocoa.h>
#include <Ecore_Cocoa_Cursor.h>
#import "ecore_cocoa_window.h"
#import "ecore_cocoa_app.h"
#include "ecore_cocoa_private.h"
static NSCursor *_cursors[__ECORE_COCOA_CURSOR_LAST];
@implementation EcoreCocoaWindow
@synthesize ecore_window_data;
@ -18,19 +23,19 @@
backing: (NSBackingStoreType) bufferingType
defer: (BOOL) flag
{
if (![super initWithContentRect: contentRect
styleMask: aStyle
backing: bufferingType
defer: flag]) return nil;
if (![super initWithContentRect: contentRect
styleMask: aStyle
backing: bufferingType
defer: flag]) return nil;
[self setBackgroundColor: [NSColor whiteColor]];
[self makeKeyWindow];
[self setDelegate:self];
[self setAcceptsMouseMovedEvents:YES];
[self setBackgroundColor: [NSColor whiteColor]];
[self makeKeyWindow];
[self setDelegate:self];
[self setAcceptsMouseMovedEvents:YES];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
[self setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
return self;
return self;
}
- (BOOL)isFullScreen
@ -45,34 +50,33 @@
- (BOOL)canBecomeKeyWindow
{
return YES;
return YES;
}
- (void)windowWillClose:(NSNotification *) EINA_UNUSED notification
- (void)windowWillClose:(NSNotification *) notification
{
NSLog(@"window is going to be closed");
Ecore_Cocoa_Event_Window *event;
event = malloc(sizeof(Ecore_Cocoa_Event_Window));
if (event == NULL)
event = malloc(sizeof(*event));
if (EINA_UNLIKELY(event == NULL))
{
// FIXME Use Eina_Log
printf("Failed to allocate Ecore_Cocoa_Event_Window_destroy\n");
return;
CRI("Failed to allocate Ecore_Cocoa_Event_Window");
return;
}
event->wid = [notification object];
ecore_event_add(ECORE_COCOA_EVENT_WINDOW_DESTROY, event, NULL, NULL);
}
- (void)windowDidResize:(NSNotification *) EINA_UNUSED notif
- (void)windowDidResize:(NSNotification *) notif
{
Ecore_Cocoa_Event_Video_Resize *event;
NSSize size = self.frame.size;
event = malloc(sizeof(Ecore_Cocoa_Event_Video_Resize));
if (event == NULL)
event = malloc(sizeof(*event));
if (EINA_UNLIKELY(event == NULL))
{
DBG("Failed to allocate Ecore_Cocoa_Event_Video_Resize\n");
CRI("Failed to allocate Ecore_Cocoa_Event_Video_Resize");
return;
}
event->w = size.width;
@ -80,34 +84,55 @@
(([self isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
event->wid = [notif object];
ecore_event_add(ECORE_COCOA_EVENT_RESIZE, event, NULL, NULL);
/*
* During live resize, NSRunLoop blocks, and prevent the ecore_main_loop
* to be run.
* This, combined with the -pauseNSRunLoopMonitoring and
* -resumeNSRunLoopMonitoring methods invoked in
* -windowWillStartLiveResize and -windowDidEndLiveResize
* allow the ecore_main_loop to run withing NSRunLoop during the
* live resizing of a window.
*/
ecore_main_loop_iterate();
}
- (void)windowDidBecomeKey:(NSNotification *)notification
{
Ecore_Cocoa_Event_Window *e;
Ecore_Cocoa_Event_Window *e;
e = malloc(sizeof(Ecore_Cocoa_Event_Window));
if (!e)
{
DBG("GOT_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");
return;
}
e->wid = [notification object];
ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, e, NULL, NULL);
e = malloc(sizeof(*e));
if (EINA_UNLIKELY(e == NULL))
{
CRI("Failed to allocate Ecore_Cocoa_Event_Window");
return;
}
e->wid = [notification object];
ecore_event_add(ECORE_COCOA_EVENT_GOT_FOCUS, e, NULL, NULL);
}
- (void) windowWillStartLiveResize:(NSNotification *) EINA_UNUSED notification
{
[NSApp pauseNSRunLoopMonitoring];
}
- (void) windowDidEndLiveResize:(NSNotification *) EINA_UNUSED notification
{
[NSApp resumeNSRunLoopMonitoring];
}
- (void)windowDidResignKey:(NSNotification *)notification
{
Ecore_Cocoa_Event_Window *e;
Ecore_Cocoa_Event_Window *e;
e = malloc(sizeof(Ecore_Cocoa_Event_Window));
if (!e)
{
DBG("LOST_FOCUS: Failed to allocate Ecore_Cocoa_Event_Window\n");
return;
}
e->wid = [notification object];
ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, e, NULL, NULL);
e = malloc(sizeof(*e));
if (EINA_UNLIKELY(e == NULL))
{
CRI("Failed to allocate Ecore_Cocoa_Event_Window");
return;
}
e->wid = [notification object];
ecore_event_add(ECORE_COCOA_EVENT_LOST_FOCUS, e, NULL, NULL);
}
- (void) mouseDown:(NSEvent*) event
@ -129,7 +154,12 @@
}
Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
if (!ev) return;
if (EINA_UNLIKELY(!ev))
{
CRI("Failed to allocate Ecore_Event_Mouse_Button");
return;
}
ev->x = x;
ev->y = y;
@ -161,12 +191,12 @@
- (void) rightMouseDown:(NSEvent*) event
{
[self mouseDown: event];
[self mouseDown: event];
}
- (void) otherMouseDown:(NSEvent*) event
{
[self mouseDown: event];
[self mouseDown: event];
}
- (void) mouseUp:(NSEvent*) event
@ -181,8 +211,12 @@
int x = pt.x;
int y = h - pt.y;
Ecore_Event_Mouse_Button * ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
if (!ev) return;
Ecore_Event_Mouse_Button *ev = calloc(1, sizeof(*ev));
if (EINA_UNLIKELY(!ev))
{
CRI("Failed to allocate Ecore_Event_Mouse_Button");
return;
}
ev->x = x;
ev->y = y;
@ -214,19 +248,23 @@
- (void) rightMouseUp:(NSEvent*) event
{
[self mouseUp: event];
[self mouseUp: event];
}
- (void) otherMouseUp:(NSEvent*) event
{
[self mouseUp: event];
[self mouseUp: event];
}
- (void) mouseMoved:(NSEvent*) event
{
unsigned int time = (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff);
Ecore_Event_Mouse_Move * ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
if (!ev) return;
Ecore_Event_Mouse_Move *ev = calloc(1, sizeof(*ev));
if (EINA_UNLIKELY(!ev))
{
CRI("Failed to allocate Ecore_Event_Mouse_Move");
return;
}
NSView *view = [self contentView];
NSPoint event_location = [event locationInWindow];
@ -251,202 +289,196 @@
@end
Ecore_Cocoa_Window *
EAPI Ecore_Cocoa_Window *
ecore_cocoa_window_new(int x,
int y,
int width,
int height)
int y,
int width,
int height)
{
Ecore_Cocoa_Window *w;
Ecore_Cocoa_Window *w;
EcoreCocoaWindow *window;
NSRect frame = NSMakeRect(x, y, width, height);
NSUInteger style =
NSTitledWindowMask |
NSClosableWindowMask |
NSResizableWindowMask |
NSMiniaturizableWindowMask;
EcoreCocoaWindow *window = [[EcoreCocoaWindow alloc] initWithContentRect:NSMakeRect(x, y, width, height)
styleMask:(NSTitledWindowMask |
NSClosableWindowMask |
NSResizableWindowMask |
NSMiniaturizableWindowMask)
backing:NSBackingStoreBuffered
defer:NO];
window = [[EcoreCocoaWindow alloc] initWithContentRect:frame
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
if (EINA_UNLIKELY(!window))
{
CRI("Failed to create EcoreCocoaWindow");
return NULL;
}
if (!window)
return NULL;
w = calloc(1, sizeof(Ecore_Cocoa_Window));
if (EINA_UNLIKELY(w == NULL))
{
CRI("Failed to allocate Ecore_Cocoa_Window");
[window release];
return NULL;
}
w->window = window;
w->borderless = 0;
//Set the process to be a foreground process,
//without that it prevents the window to become the key window and
//receive all mouse mouve events.
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp activateIgnoringOtherApps:YES];
window.ecore_window_data = w;
w = calloc(1, sizeof(Ecore_Cocoa_Window));
if (w == NULL)
{
return NULL;
}
w->window = window;
w->borderless = 0;
window.ecore_window_data = w;
return w;
return w;
}
void
EAPI void
ecore_cocoa_window_free(Ecore_Cocoa_Window *window)
{
if (!window)
return;
if (!window)
return;
[window->window release];
free(window);
[window->window release];
free(window);
}
void
EAPI void
ecore_cocoa_window_size_min_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentMinSize = size;
EINA_SAFETY_ON_NULL_RETURN(window);
NSSize size = {w,h};
window->window.contentMinSize = size;
}
void
EAPI void
ecore_cocoa_window_size_max_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentMaxSize = size;
EINA_SAFETY_ON_NULL_RETURN(window);
NSSize size = {w,h};
window->window.contentMaxSize = size;
}
void
EAPI void
ecore_cocoa_window_size_step_set(Ecore_Cocoa_Window *window,
unsigned int w,
unsigned int h)
{
if (!window)
return;
NSSize size = {w,h};
window->window.contentResizeIncrements = size;
EINA_SAFETY_ON_NULL_RETURN(window);
NSSize size = {w,h};
window->window.contentResizeIncrements = size;
}
void
EAPI void
ecore_cocoa_window_move(Ecore_Cocoa_Window *window,
int x,
int y)
int x,
int y)
{
NSRect win_frame;
EINA_SAFETY_ON_NULL_RETURN(window);
if (!window)
return;
NSRect win_frame;
win_frame = [window->window frame];
win_frame.origin.x = x;
win_frame.origin.y = y;
win_frame = [window->window frame];
win_frame.origin.x = x;
win_frame.origin.y = y;
[window->window setFrame:win_frame display:YES];
[window->window setFrame:win_frame display:YES];
}
void
EAPI void
ecore_cocoa_window_resize(Ecore_Cocoa_Window *window,
int width,
int height)
int width,
int height)
{
if (!window) return;
EINA_SAFETY_ON_NULL_RETURN(window);
NSRect win_frame;
NSRect win_frame;
win_frame = [window->window frame];
win_frame.size.height = height +
(([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
win_frame.size.width = width;
win_frame = [window->window frame];
win_frame.size.height = height +
(([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
win_frame.size.width = width;
[window->window setFrame:win_frame display:YES];
[window->window setFrame:win_frame display:YES];
}
void
EAPI void
ecore_cocoa_window_move_resize(Ecore_Cocoa_Window *window,
int x,
int y,
int width,
int height)
int x,
int y,
int width,
int height)
{
if (!window) return;
EINA_SAFETY_ON_NULL_RETURN(window);
NSRect win_frame;
NSRect win_frame;
win_frame = [window->window frame];
win_frame.size.height = height +
(([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
win_frame.size.width = width;
win_frame.origin.x = x;
win_frame.origin.y = y;
win_frame = [window->window frame];
win_frame.size.height = height +
(([window->window isFullScreen] == YES) ? 0 : ecore_cocoa_titlebar_height_get());
win_frame.size.width = width;
win_frame.origin.x = x;
win_frame.origin.y = y;
[window->window setFrame:win_frame display:YES];
[window->window setFrame:win_frame display:YES];
}
void
EAPI void
ecore_cocoa_window_title_set(Ecore_Cocoa_Window *window, const char *title)
{
if (!window || !title)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
EINA_SAFETY_ON_NULL_RETURN(title);
[window->window setTitle:[NSString stringWithUTF8String:title]];
[window->window setTitle:[NSString stringWithUTF8String:title]];
}
void
EAPI void
ecore_cocoa_window_show(Ecore_Cocoa_Window *window)
{
if (!window || [window->window isVisible])
{
DBG("Window(%p) is not visible\n", window->window);
return;
}
EINA_SAFETY_ON_NULL_RETURN(window);
[window->window makeKeyAndOrderFront:NSApp];
if (![window->window isVisible])
[window->window makeKeyAndOrderFront:NSApp];
}
void
EAPI void
ecore_cocoa_window_hide(Ecore_Cocoa_Window *window)
{
if (!window || ![window->window isVisible])
return;
EINA_SAFETY_ON_NULL_RETURN(window);
[window->window orderOut:NSApp];
if (![window->window isVisible])
[window->window orderOut:NSApp];
}
void ecore_cocoa_window_raise(Ecore_Cocoa_Window *window)
EAPI void
ecore_cocoa_window_raise(Ecore_Cocoa_Window *window)
{
if (!window)
return;
[window->window orderFront:nil];
EINA_SAFETY_ON_NULL_RETURN(window);
[window->window orderFront:nil];
}
void ecore_cocoa_window_lower(Ecore_Cocoa_Window *window)
EAPI void
ecore_cocoa_window_lower(Ecore_Cocoa_Window *window)
{
if (!window)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
[window->window orderBack:nil];
}
void ecore_cocoa_window_activate(Ecore_Cocoa_Window *window)
EAPI void
ecore_cocoa_window_activate(Ecore_Cocoa_Window *window)
{
if (!window)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
[window->window makeKeyAndOrderFront:nil];
}
void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window,
int on)
EAPI void
ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window,
int on)
{
if (!window)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
if (on)
{
@ -458,46 +490,91 @@ void ecore_cocoa_window_iconified_set(Ecore_Cocoa_Window *window,
}
}
void
EAPI void
ecore_cocoa_window_borderless_set(Ecore_Cocoa_Window *window,
int on)
{
if (!window)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
if (on)
[window->window setContentBorderThickness:0.0
forEdge:NSMinXEdge | NSMinYEdge | NSMaxXEdge | NSMaxYEdge];
if (on)
[window->window setContentBorderThickness:0.0
forEdge:NSMinXEdge | NSMinYEdge | NSMaxXEdge | NSMaxYEdge];
}
void
EAPI void
ecore_cocoa_window_view_set(Ecore_Cocoa_Window *window,
void *view)
void *view)
{
if (!window || !view)
return;
EINA_SAFETY_ON_NULL_RETURN(window);
EINA_SAFETY_ON_NULL_RETURN(view);
//[[window->window contentView] addSubview:view];
NSView *v = view;
[window->window setContentView:view];
//[[window->window contentView] addSubview:view];
NSView *v = view;
[window->window setContentView:view];
NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:[v frame]
options:NSTrackingMouseMoved |
NSTrackingActiveInActiveApp |
NSTrackingInVisibleRect
owner:v
userInfo:nil];
[v addTrackingArea:area];
NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:[v frame]
options:NSTrackingMouseMoved |
NSTrackingActiveInActiveApp |
NSTrackingInVisibleRect
owner:v
userInfo:nil];
[v addTrackingArea:area];
[area release];
[area release];
}
Ecore_Cocoa_Window_Id ecore_cocoa_window_get_window_id(Ecore_Cocoa_Window *window)
EAPI Ecore_Cocoa_Window_Id
ecore_cocoa_window_get_window_id(const Ecore_Cocoa_Window *window)
{
if (!window)
return 0;
DBG("Return : %p", window->window);
return window->window;
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
return window->window;
}
EAPI void
ecore_cocoa_window_cursor_set(Ecore_Cocoa_Window *win,
Ecore_Cocoa_Cursor c)
{
EINA_SAFETY_ON_NULL_RETURN(win);
EINA_SAFETY_ON_FALSE_RETURN((c >= 0) && (c <= __ECORE_COCOA_CURSOR_LAST));
NSCursor *cursor = _cursors[c];
DBG("Setting cursor %i (%s)", c, [[cursor description] UTF8String]);
[cursor set];
}
EAPI void
ecore_cocoa_window_cursor_show(Ecore_Cocoa_Window *win,
Eina_Bool show)
{
EINA_SAFETY_ON_NULL_RETURN(win);
if (show) [NSCursor unhide];
else [NSCursor hide];
}
Eina_Bool
_ecore_cocoa_window_init(void)
{
_cursors[ECORE_COCOA_CURSOR_ARROW] = [NSCursor arrowCursor];
_cursors[ECORE_COCOA_CURSOR_CONTEXTUAL_MENU] = [NSCursor contextualMenuCursor];
_cursors[ECORE_COCOA_CURSOR_CLOSED_HAND] = [NSCursor closedHandCursor];
_cursors[ECORE_COCOA_CURSOR_CROSSHAIR] = [NSCursor crosshairCursor];
_cursors[ECORE_COCOA_CURSOR_DISAPPEARING_ITEM] = [NSCursor disappearingItemCursor];
_cursors[ECORE_COCOA_CURSOR_DRAG_COPY] = [NSCursor dragCopyCursor];
_cursors[ECORE_COCOA_CURSOR_DRAG_LINK] = [NSCursor dragLinkCursor];
_cursors[ECORE_COCOA_CURSOR_IBEAM] = [NSCursor IBeamCursor];
_cursors[ECORE_COCOA_CURSOR_OPEN_HAND] = [NSCursor openHandCursor];
_cursors[ECORE_COCOA_CURSOR_OPERATION_NOT_ALLOWED] = [NSCursor operationNotAllowedCursor];
_cursors[ECORE_COCOA_CURSOR_POINTING_HAND] = [NSCursor pointingHandCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_DOWN] = [NSCursor resizeDownCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_LEFT] = [NSCursor resizeLeftCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_LEFT_RIGHT] = [NSCursor resizeLeftRightCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_RIGHT] = [NSCursor resizeRightCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_UP] = [NSCursor resizeUpCursor];
_cursors[ECORE_COCOA_CURSOR_RESIZE_UP_DOWN] = [NSCursor resizeUpDownCursor];
_cursors[ECORE_COCOA_CURSOR_IBEAM_VERTICAL] = [NSCursor IBeamCursorForVerticalLayout];
return EINA_TRUE;
}

View File

@ -2360,6 +2360,7 @@ _ecore_con_svr_udp_handler(void *data,
EINA_SAFETY_ON_NULL_RETURN_VAL(cl, ECORE_CALLBACK_RENEW);
cl->host_server = svr_obj;
cl->fd = -1;
cl->client_addr = malloc(client_addr_len);
if (!cl->client_addr)
{

View File

@ -442,12 +442,12 @@ ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y)
{
EINA_LIST_FOREACH(seat->devices, ll, edev)
{
if (!libinput_device_has_capability(edev->device,
if (!libinput_device_has_capability(edev->device,
LIBINPUT_DEVICE_CAP_POINTER))
continue;
if (x) *x = edev->mouse.dx;
if (y) *y = edev->mouse.dy;
if (x) *x = seat->ptr.dx;
if (y) *y = seat->ptr.dy;
return;
}

View File

@ -80,40 +80,10 @@ _device_output_set(Ecore_Drm_Evdev *edev)
if (libinput_device_has_capability(edev->device,
LIBINPUT_DEVICE_CAP_POINTER))
{
Ecore_Drm_Input *pointer_input;
Ecore_Event_Mouse_Move *ev;
edev->mouse.dx = edev->output->current_mode->width / 2;
edev->mouse.dy = edev->output->current_mode->height / 2;
/* send a fake motion event to let other know the initial pos of mouse */
if (!(pointer_input = edev->seat->input)) return;
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
ev->window = (Ecore_Window)pointer_input->dev->window;
ev->event_window = (Ecore_Window)pointer_input->dev->window;
ev->root_window = (Ecore_Window)pointer_input->dev->window;
_device_modifiers_update(edev);
ev->modifiers = edev->xkb.modifiers;
ev->same_screen = 1;
ev->x = edev->mouse.dx;
ev->y = edev->mouse.dy;
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->multi.device = edev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = 1;
ev->multi.radius_y = 1;
ev->multi.pressure = 1.0;
ev->multi.angle = 0.0;
ev->multi.x = ev->x;
ev->multi.y = ev->y;
ev->multi.root.x = ev->x;
ev->multi.root.y = ev->y;
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
edev->seat->ptr.ix = edev->seat->ptr.dx = edev->output->current_mode->width / 2;
edev->seat->ptr.iy = edev->seat->ptr.dy = edev->output->current_mode->height / 2;
edev->mouse.dx = edev->seat->ptr.dx;
edev->mouse.dy = edev->seat->ptr.dy;
}
}
@ -391,15 +361,18 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
if (edev->mouse.ix < edev->mouse.minx)
edev->mouse.dx = edev->mouse.ix = edev->mouse.minx;
else if (edev->mouse.ix >= (edev->mouse.minx + edev->mouse.maxw))
edev->mouse.dx = edev->mouse.ix = (edev->mouse.minx + edev->mouse.maxw - 1);
if (edev->seat->ptr.ix < edev->mouse.minx)
edev->seat->ptr.dx = edev->seat->ptr.ix = edev->mouse.minx;
else if (edev->seat->ptr.ix >= (edev->mouse.minx + edev->mouse.maxw))
edev->seat->ptr.dx = edev->seat->ptr.ix = (edev->mouse.minx + edev->mouse.maxw - 1);
if (edev->mouse.iy < edev->mouse.miny)
edev->mouse.dy = edev->mouse.iy = edev->mouse.miny;
else if (edev->mouse.iy >= (edev->mouse.miny + edev->mouse.maxh))
edev->mouse.dy = edev->mouse.iy = (edev->mouse.miny + edev->mouse.maxh - 1);
if (edev->seat->ptr.iy < edev->mouse.miny)
edev->seat->ptr.dy = edev->seat->ptr.iy = edev->mouse.miny;
else if (edev->seat->ptr.iy >= (edev->mouse.miny + edev->mouse.maxh))
edev->seat->ptr.dy = edev->seat->ptr.iy = (edev->mouse.miny + edev->mouse.maxh - 1);
edev->mouse.dx = edev->seat->ptr.dx;
edev->mouse.dy = edev->seat->ptr.dy;
ev->window = (Ecore_Window)input->dev->window;
ev->event_window = (Ecore_Window)input->dev->window;
@ -410,8 +383,8 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
_device_modifiers_update(edev);
ev->modifiers = edev->xkb.modifiers;
ev->x = edev->mouse.ix;
ev->y = edev->mouse.iy;
ev->x = edev->seat->ptr.ix;
ev->y = edev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
@ -436,14 +409,17 @@ _device_handle_pointer_motion(struct libinput_device *device, struct libinput_ev
if (!(edev = libinput_device_get_user_data(device))) return;
edev->mouse.dx += libinput_event_pointer_get_dx(event);
edev->mouse.dy += libinput_event_pointer_get_dy(event);
edev->seat->ptr.dx += libinput_event_pointer_get_dx(event);
edev->seat->ptr.dy += libinput_event_pointer_get_dy(event);
if (floor(edev->mouse.dx) == edev->mouse.ix &&
floor(edev->mouse.dy) == edev->mouse.iy) return;
edev->mouse.dx = edev->seat->ptr.dx;
edev->mouse.dy = edev->seat->ptr.dy;
edev->mouse.ix = edev->mouse.dx;
edev->mouse.iy = edev->mouse.dy;
if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
floor(edev->seat->ptr.dy) == edev->seat->ptr.iy) return;
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
_device_pointer_motion(edev, event);
}
@ -454,16 +430,18 @@ _device_handle_pointer_motion_absolute(struct libinput_device *device, struct li
if (!(edev = libinput_device_get_user_data(device))) return;
edev->mouse.dx =
edev->mouse.dx = edev->seat->ptr.dx =
libinput_event_pointer_get_absolute_x_transformed(event,
edev->output->current_mode->width);
edev->mouse.dy =
edev->mouse.dy = edev->seat->ptr.dy =
libinput_event_pointer_get_absolute_y_transformed(event,
edev->output->current_mode->height);
if (floor(edev->mouse.dx) == edev->mouse.ix &&
floor(edev->mouse.dy) == edev->mouse.iy) return;
if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
floor(edev->seat->ptr.dy) == edev->seat->ptr.iy) return;
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
_device_pointer_motion(edev, event);
}
@ -498,8 +476,8 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
_device_modifiers_update(edev);
ev->modifiers = edev->xkb.modifiers;
ev->x = edev->mouse.ix;
ev->y = edev->mouse.iy;
ev->x = edev->seat->ptr.ix;
ev->y = edev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
@ -580,8 +558,8 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
_device_modifiers_update(edev);
ev->modifiers = edev->xkb.modifiers;
ev->x = edev->mouse.ix;
ev->y = edev->mouse.iy;
ev->x = edev->seat->ptr.ix;
ev->y = edev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
@ -691,8 +669,8 @@ _device_handle_touch_event_send(Ecore_Drm_Evdev *edev, struct libinput_event_tou
_device_modifiers_update(edev);
ev->modifiers = edev->xkb.modifiers;
ev->x = edev->mouse.ix;
ev->y = edev->mouse.iy;
ev->x = edev->seat->ptr.ix;
ev->y = edev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
@ -766,8 +744,8 @@ _device_handle_touch_motion_send(Ecore_Drm_Evdev *edev, struct libinput_event_to
ev->modifiers = edev->xkb.modifiers;
ev->modifiers = 0;
ev->x = edev->mouse.ix;
ev->y = edev->mouse.iy;
ev->x = edev->seat->ptr.ix;
ev->y = edev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
@ -792,9 +770,9 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_
if (!(edev = libinput_device_get_user_data(device))) return;
edev->mouse.ix = edev->mouse.dx =
edev->mouse.dx = edev->seat->ptr.ix = edev->seat->ptr.dx =
libinput_event_touch_get_x_transformed(event, edev->output->current_mode->width);
edev->mouse.iy = edev->mouse.dy =
edev->mouse.dy = edev->seat->ptr.iy = edev->seat->ptr.dy =
libinput_event_touch_get_y_transformed(event, edev->output->current_mode->height);
edev->mt_slot = libinput_event_touch_get_seat_slot(event);
@ -810,16 +788,16 @@ _device_handle_touch_motion(struct libinput_device *device, struct libinput_even
if (!(edev = libinput_device_get_user_data(device))) return;
edev->mouse.dx =
edev->mouse.dx = edev->seat->ptr.dx =
libinput_event_touch_get_x_transformed(event, edev->output->current_mode->width);
edev->mouse.dy =
edev->mouse.dy = edev->seat->ptr.dy =
libinput_event_touch_get_y_transformed(event, edev->output->current_mode->height);
if (floor(edev->mouse.dx) == edev->mouse.ix &&
floor(edev->mouse.dy) == edev->mouse.iy) return;
if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
floor(edev->seat->ptr.dy) == edev->seat->ptr.iy) return;
edev->mouse.ix = edev->mouse.dx;
edev->mouse.iy = edev->mouse.dy;
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
edev->mt_slot = libinput_event_touch_get_seat_slot(event);

View File

@ -153,6 +153,11 @@ struct _Ecore_Drm_Seat
const char *name;
Ecore_Drm_Input *input;
Eina_List *devices;
struct
{
int ix, iy;
double dx, dy;
} ptr;
};
struct _Ecore_Drm_Input

View File

@ -1316,6 +1316,9 @@ EAPI void ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y);
EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
EAPI void ecore_evas_wayland_type_set(Ecore_Evas *ee, int type);
EAPI Ecore_Wl_Window *ecore_evas_wayland_window_get(const Ecore_Evas *ee);
EAPI Ecore_Wl2_Window *ecore_evas_wayland_window_get2(const Ecore_Evas *ee);
EAPI Ecore_Cocoa_Window *ecore_evas_cocoa_window_get(const Ecore_Evas *ee);
EAPI Ecore_Evas *ecore_evas_drm_new(const char *device, unsigned int parent, int x, int y, int w, int h);
EAPI Ecore_Evas *ecore_evas_gl_drm_new(const char *device, unsigned int parent, int x, int y, int w, int h); /** @since 1.12 */

View File

@ -33,6 +33,7 @@ typedef struct _Ecore_WinCE_Window Ecore_WinCE_Window;
#endif
#ifndef __ECORE_COCOA_H__
# define _ECORE_COCOA_WINDOW_PREDEF
typedef struct _Ecore_Cocoa_Window Ecore_Cocoa_Window;
#endif
@ -47,6 +48,11 @@ typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for s
typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
#endif
#ifndef _ECORE_WL2_H_
#define _ECORE_WAYLAND_WINDOW_PREDEF
typedef struct _Ecore_Wl2_Window Ecore_Wl2_Window;
#endif
#ifndef _ECORE_GETOPT_PREDEF
typedef struct _Ecore_Getopt Ecore_Getopt;
#define _ECORE_GETOPT_PREDEF 1

View File

@ -30,6 +30,7 @@
#include "ecore_evas_private.h"
#include "ecore_evas_x11.h"
#include "ecore_evas_wayland.h"
#include "ecore_evas_cocoa.h"
#include "ecore_evas_extn.h"
#include "ecore_evas_win32.h"
@ -3983,6 +3984,25 @@ ecore_evas_wayland_window_get(const Ecore_Evas *ee)
return iface->window_get(ee);
}
EAPI Ecore_Wl2_Window *
ecore_evas_wayland_window_get2(const Ecore_Evas *ee)
{
Ecore_Evas_Interface_Wayland *iface;
iface = (Ecore_Evas_Interface_Wayland *)_ecore_evas_interface_get(ee, "wayland");
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
return iface->window_get2(ee);
}
EAPI Ecore_Cocoa_Window *
ecore_evas_cocoa_window_get(const Ecore_Evas *ee)
{
Ecore_Evas_Interface_Cocoa *iface;
iface = (Ecore_Evas_Interface_Cocoa *)_ecore_evas_interface_get(ee, "opengl_cocoa");
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
return iface->window_get(ee);
}
EAPI Ecore_Evas *
ecore_evas_drm_new(const char *disp_name, unsigned int parent,
int x, int y, int w, int h)

View File

@ -0,0 +1,14 @@
#ifndef __ECORE_EVAS_COCOA_H__
#define __ECORE_EVAS_COCOA_H__
typedef struct _Ecore_Evas_Interface_Cocoa Ecore_Evas_Interface_Cocoa;
struct _Ecore_Evas_Interface_Cocoa
{
Ecore_Evas_Interface base;
Ecore_Cocoa_Window *(*window_get)(const Ecore_Evas *ee);
};
#endif /* ! __ECORE_EVAS_COCOA_H__ */

View File

@ -12,6 +12,7 @@ struct _Ecore_Evas_Interface_Wayland
void (*pointer_set)(Ecore_Evas *ee, int hot_x, int hot_y);
void (*type_set)(Ecore_Evas *ee, int type);
Ecore_Wl_Window* (*window_get)(const Ecore_Evas *ee);
Ecore_Wl2_Window *(*window_get2)(const Ecore_Evas *ee);
void (*pre_post_swap_callback_set)(const Ecore_Evas *ee, void *data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e));
};

View File

@ -29,7 +29,6 @@
/*
* FIXME: the following functions will certainly not work on Windows:
* ecore_file_file_get()
* ecore_file_app_exe_get()
* ecore_file_escape_name()
*/
@ -773,6 +772,23 @@ ecore_file_file_get(const char *path)
char *result = NULL;
if (!path) return NULL;
#ifdef _WIN32
{
char buf[MAX_PATH];
memcpy(buf, path, strlen(path) + 1);
EVIL_PATH_SEP_UNIX_TO_WIN32(buf);
if ((result = strrchr(buf, '\\')))
{
result++;
return path + (result - buf);
}
else
return path;
}
#endif
if ((result = strrchr(path, '/'))) result++;
else result = (char *)path;

View File

@ -81,7 +81,7 @@ struct _Ecore_Ipc_Client
} prev;
int event_count;
char delete_me : 1;
Eina_Bool delete_me : 1;
};
struct _Ecore_Ipc_Server
@ -99,7 +99,7 @@ struct _Ecore_Ipc_Server
} prev;
int event_count;
char delete_me : 1;
Eina_Bool delete_me : 1;
};
#endif

View File

@ -43,7 +43,7 @@ static void _ecore_wl_init_callback(void *data, struct wl_callback *callback, ui
static int _ecore_wl_init_count = 0;
static Eina_Bool _ecore_wl_animator_busy = EINA_FALSE;
static Eina_Bool _ecore_wl_fatal_error = EINA_FALSE;
static Eina_Bool _ecore_wl_server_mode = EINA_FALSE;
Eina_Bool _ecore_wl_server_mode = EINA_FALSE;
static const struct wl_registry_listener _ecore_wl_registry_listener =
{

View File

@ -22,6 +22,7 @@
# endif
extern int _ecore_wl_log_dom;
extern Eina_Bool _ecore_wl_server_mode;
# ifdef ECORE_WL_DEFAULT_LOG_COLOR
# undef ECORE_WL_DEFAULT_LOG_COLOR

View File

@ -227,6 +227,7 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
win->class_name = NULL;
eina_hash_add(_windows, _ecore_wl_window_id_str_get(win->id), win);
return win;
}
@ -237,7 +238,7 @@ ecore_wl_window_free(Ecore_Wl_Window *win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
eina_hash_del(_windows, _ecore_wl_window_id_str_get(win->id), win);
@ -286,7 +287,7 @@ ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
input = win->keyboard_device;
ecore_wl_window_update_location(win, x, y);
@ -315,7 +316,7 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w EINA_UNUSED, int h EINA_UNUSE
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
input = win->keyboard_device;
@ -342,7 +343,8 @@ ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
if (win->surface) wl_surface_damage(win->surface, x, y, w, h);
}
@ -351,7 +353,7 @@ ecore_wl_window_commit(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
if ((win->surface))// && (win->has_buffer))
wl_surface_commit(win->surface);
@ -362,7 +364,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
switch (win->buffer_type)
{
@ -391,7 +393,8 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
if (win->surface) return win->surface;
if (_ecore_wl_disp->wl.session_recovery)
session_recovery_add_listener(_ecore_wl_disp->wl.session_recovery, &_ecore_session_recovery_listener, win);
@ -418,7 +421,7 @@ ecore_wl_window_hide(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
if (win->xdg_surface) xdg_surface_destroy(win->xdg_surface);
win->xdg_surface = NULL;
@ -438,7 +441,8 @@ ecore_wl_window_raise(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
/* FIXME: This should raise the xdg surface also */
if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface);
@ -447,40 +451,33 @@ ecore_wl_window_raise(Ecore_Wl_Window *win)
EAPI void
ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized)
{
Eina_Bool prev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
if ((win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED) == maximized) return;
prev = win->maximized;
maximized = !!maximized;
if (prev == maximized) return;
if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL)
if (maximized)
{
if (win->xdg_surface)
{
xdg_surface_set_maximized(win->xdg_surface);
win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
}
xdg_surface_set_maximized(win->xdg_surface);
else if (win->shell_surface)
{
wl_shell_surface_set_maximized(win->shell_surface, NULL);
win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
}
wl_shell_surface_set_maximized(win->shell_surface, NULL);
win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
}
else if (win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED)
else
{
if (win->xdg_surface)
{
xdg_surface_unset_maximized(win->xdg_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
}
xdg_surface_unset_maximized(win->xdg_surface);
else if (win->shell_surface)
{
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
}
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
}
win->maximized = maximized;
}
EAPI Eina_Bool
@ -488,21 +485,24 @@ ecore_wl_window_maximized_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
if (win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED)
return EINA_TRUE;
return EINA_FALSE;
return win->maximized;
}
EAPI void
ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
{
Eina_Bool prev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
if ((win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN) == fullscreen) return;
EINA_SAFETY_ON_NULL_RETURN(win);
prev = win->fullscreen;
fullscreen = !!fullscreen;
if (prev == fullscreen) return;
if (fullscreen)
{
win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN;
@ -523,8 +523,8 @@ ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
}
win->fullscreen = fullscreen;
}
EAPI Eina_Bool
@ -532,9 +532,9 @@ ecore_wl_window_fullscreen_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
return win->fullscreen || (win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN);
return win->fullscreen;
}
EAPI void
@ -542,7 +542,8 @@ ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->transparent = transparent;
if (!win->transparent)
ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y,
@ -556,7 +557,7 @@ ecore_wl_window_alpha_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
return win->alpha;
}
@ -566,7 +567,8 @@ ecore_wl_window_alpha_set(Ecore_Wl_Window *win, Eina_Bool alpha)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->alpha = alpha;
if (!win->alpha)
ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y,
@ -580,7 +582,7 @@ ecore_wl_window_transparent_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
return win->transparent;
}
@ -590,7 +592,8 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->allocation.w = w;
win->allocation.h = h;
if ((!ecore_wl_window_maximized_get(win)) && (!win->fullscreen))
@ -610,7 +613,8 @@ ecore_wl_window_update_location(Ecore_Wl_Window *win, int x, int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->allocation.x = x;
win->allocation.y = y;
@ -625,7 +629,8 @@ ecore_wl_window_surface_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
return win->surface;
}
@ -635,7 +640,8 @@ ecore_wl_window_shell_surface_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
return win->shell_surface;
}
@ -645,7 +651,8 @@ ecore_wl_window_xdg_surface_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
return win->xdg_surface;
}
@ -664,7 +671,8 @@ ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->type = type;
}
@ -675,7 +683,7 @@ ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, in
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->pointer.surface = surface;
win->pointer.hot_x = hot_x;
@ -693,7 +701,7 @@ ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_na
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->pointer.set = EINA_FALSE;
@ -713,7 +721,7 @@ ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->pointer.set = EINA_FALSE;
@ -727,6 +735,8 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
EINA_SAFETY_ON_NULL_RETURN(win);
win->parent = parent;
}
@ -734,20 +744,22 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
EAPI void
ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
{
Eina_Bool prev;
struct wl_array states;
uint32_t *s;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
prev = win->minimized;
iconified = !!iconified;
if (prev == iconified) return;
if (iconified)
{
if (win->xdg_surface)
{
xdg_surface_set_minimized(win->xdg_surface);
win->minimized = iconified;
}
xdg_surface_set_minimized(win->xdg_surface);
else if (win->shell_surface)
{
/* TODO: handle case of iconifying a wl_shell surface */
@ -757,7 +769,6 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
{
if (win->xdg_surface)
{
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
@ -765,12 +776,12 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
wl_array_release(&states);
}
else if (win->shell_surface)
{
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
}
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
}
win->minimized = iconified;
}
EAPI Eina_Bool
@ -778,7 +789,8 @@ ecore_wl_window_iconified_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE);
return win->minimized;
}
@ -789,6 +801,8 @@ ecore_wl_window_surface_find(struct wl_surface *surface)
Ecore_Wl_Window *win = NULL;
void *data;
EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
itr = eina_hash_iterator_data_new(_windows);
while (eina_iterator_next(itr, &data))
{
@ -810,7 +824,7 @@ ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->input.x = x;
win->input.y = y;
@ -853,7 +867,7 @@ ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->opaque.x = x;
win->opaque.y = y;
@ -891,7 +905,8 @@ ecore_wl_window_rotation_set(Ecore_Wl_Window *win, int rotation)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
win->rotation = rotation;
}
@ -901,7 +916,8 @@ ecore_wl_window_rotation_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, 0);
return win->rotation;
}
@ -911,7 +927,8 @@ ecore_wl_window_id_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, 0);
return win->id;
}
@ -921,7 +938,8 @@ ecore_wl_window_surface_id_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, 0);
return win->surface_id;
}
@ -931,7 +949,8 @@ ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
eina_stringshare_replace(&win->title, title);
if ((win->xdg_surface) && (win->title))
@ -946,7 +965,8 @@ ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
EINA_SAFETY_ON_NULL_RETURN(win);
eina_stringshare_replace(&win->class_name, class_name);
if ((win->xdg_surface) && (win->class_name))
@ -962,7 +982,8 @@ ecore_wl_window_keyboard_get(Ecore_Wl_Window *win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, 0);
return win->keyboard_device;
}

View File

@ -116,6 +116,91 @@ typedef enum
ECORE_WIN32_CURSOR_SHAPE_WAIT /**< Hourglass */
} Ecore_Win32_Cursor_Shape;
/**
* @typedef Ecore_Win32_Cursor_X11_Shape
* Shape of an X11 cursor.
*/
typedef enum
{
ECORE_WIN32_CURSOR_X11_SHAPE_X,
ECORE_WIN32_CURSOR_X11_SHAPE_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_BASED_ARROW_DOWN,
ECORE_WIN32_CURSOR_X11_SHAPE_UP,
ECORE_WIN32_CURSOR_X11_SHAPE_BOAT,
ECORE_WIN32_CURSOR_X11_SHAPE_BOGOSITY,
ECORE_WIN32_CURSOR_X11_SHAPE_BOTTOM_LEFT_CORNER,
ECORE_WIN32_CURSOR_X11_SHAPE_BOTTOM_RIGHT_CORNER,
ECORE_WIN32_CURSOR_X11_SHAPE_BOTTOM_SIDE,
ECORE_WIN32_CURSOR_X11_SHAPE_BOTTOM_TEE,
ECORE_WIN32_CURSOR_X11_SHAPE_BOX_SPIRAL,
ECORE_WIN32_CURSOR_X11_SHAPE_CENTER_PTR,
ECORE_WIN32_CURSOR_X11_SHAPE_CIRCLE,
ECORE_WIN32_CURSOR_X11_SHAPE_CLOCK,
ECORE_WIN32_CURSOR_X11_SHAPE_COFFEE_MUG,
ECORE_WIN32_CURSOR_X11_SHAPE_CROSS,
ECORE_WIN32_CURSOR_X11_SHAPE_CROSS_REVERSE,
ECORE_WIN32_CURSOR_X11_SHAPE_CROSSHAIR,
ECORE_WIN32_CURSOR_X11_SHAPE_DIAMOND_CROSS,
ECORE_WIN32_CURSOR_X11_SHAPE_DOT,
ECORE_WIN32_CURSOR_X11_SHAPE_DOT_BOX_MASK,
ECORE_WIN32_CURSOR_X11_SHAPE_DOUBLE_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_DRAFT_LARGE,
ECORE_WIN32_CURSOR_X11_SHAPE_DRAFT_SMALL,
ECORE_WIN32_CURSOR_X11_SHAPE_DRAPED_BOX,
ECORE_WIN32_CURSOR_X11_SHAPE_EXCHANGE,
ECORE_WIN32_CURSOR_X11_SHAPE_FLEUR,
ECORE_WIN32_CURSOR_X11_SHAPE_GOBBLER,
ECORE_WIN32_CURSOR_X11_SHAPE_GUMBY,
ECORE_WIN32_CURSOR_X11_SHAPE_HAND1,
ECORE_WIN32_CURSOR_X11_SHAPE_HAND2,
ECORE_WIN32_CURSOR_X11_SHAPE_HEART,
ECORE_WIN32_CURSOR_X11_SHAPE_ICON,
ECORE_WIN32_CURSOR_X11_SHAPE_IRON_CROSS,
ECORE_WIN32_CURSOR_X11_SHAPE_LEFT_PTR,
ECORE_WIN32_CURSOR_X11_SHAPE_LEFT_SIDE,
ECORE_WIN32_CURSOR_X11_SHAPE_LEFT_TEE,
ECORE_WIN32_CURSOR_X11_SHAPE_LEFTBUTTON,
ECORE_WIN32_CURSOR_X11_SHAPE_LL_ANGLE,
ECORE_WIN32_CURSOR_X11_SHAPE_LR_ANGLE,
ECORE_WIN32_CURSOR_X11_SHAPE_MAN,
ECORE_WIN32_CURSOR_X11_SHAPE_MIDDLEBUTTON,
ECORE_WIN32_CURSOR_X11_SHAPE_MOUSE,
ECORE_WIN32_CURSOR_X11_SHAPE_PENCIL,
ECORE_WIN32_CURSOR_X11_SHAPE_PIRATE,
ECORE_WIN32_CURSOR_X11_SHAPE_PLUS,
ECORE_WIN32_CURSOR_X11_SHAPE_QUESTION_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_RIGHT_PTR,
ECORE_WIN32_CURSOR_X11_SHAPE_RIGHT_SIDE,
ECORE_WIN32_CURSOR_X11_SHAPE_RIGHT_TEE,
ECORE_WIN32_CURSOR_X11_SHAPE_RIGHTBUTTON,
ECORE_WIN32_CURSOR_X11_SHAPE_RTL_LOGO,
ECORE_WIN32_CURSOR_X11_SHAPE_SAILBOAT,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_DOWN_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_H_DOUBLE_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_LEFT_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_RIGHT_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_UP_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SB_V_DOUBLE_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_SHUTTLE,
ECORE_WIN32_CURSOR_X11_SHAPE_SIZING,
ECORE_WIN32_CURSOR_X11_SHAPE_SPIDER,
ECORE_WIN32_CURSOR_X11_SHAPE_SPRAYCAN,
ECORE_WIN32_CURSOR_X11_SHAPE_STAR,
ECORE_WIN32_CURSOR_X11_SHAPE_TARGET,
ECORE_WIN32_CURSOR_X11_SHAPE_TCROSS,
ECORE_WIN32_CURSOR_X11_SHAPE_TOP_LEFT_ARROW,
ECORE_WIN32_CURSOR_X11_SHAPE_TOP_LEFT_CORNER,
ECORE_WIN32_CURSOR_X11_SHAPE_TOP_RIGHT_CORNER,
ECORE_WIN32_CURSOR_X11_SHAPE_TOP_SIDE,
ECORE_WIN32_CURSOR_X11_SHAPE_TOP_TEE,
ECORE_WIN32_CURSOR_X11_SHAPE_TREK,
ECORE_WIN32_CURSOR_X11_SHAPE_UL_ANGLE,
ECORE_WIN32_CURSOR_X11_SHAPE_UMBRELLA,
ECORE_WIN32_CURSOR_X11_SHAPE_UR_ANGLE,
ECORE_WIN32_CURSOR_X11_SHAPE_WATCH,
ECORE_WIN32_CURSOR_X11_SHAPE_XTERM,
} Ecore_Win32_Cursor_X11_Shape;
/**
* @typedef Ecore_Win32_DnD_State
* State of a DnD operation.
@ -128,6 +213,21 @@ typedef enum
ECORE_WIN32_DND_EVENT_DROP = 4 /**< Drop */
} Ecore_Win32_DnD_State;
/**
* @typedef Ecore_Win32_Selection
* Type of the selection.
*
* @since 1.16
*/
typedef enum
{
ECORE_WIN32_SELECTION_PRIMARY,
ECORE_WIN32_SELECTION_SECONDARY,
ECORE_WIN32_SELECTION_DND,
ECORE_WIN32_SELECTION_CLIPBOARD,
ECORE_WIN32_SELECTION_OTHER
} Ecore_Win32_Selection;
/**
* @typedef Ecore_Win32_Window
* Abstract type for a window.
@ -213,6 +313,22 @@ typedef struct _Ecore_Win32_Event_Window_Resize Ecore_Win32_Event_Window
*/
typedef struct _Ecore_Win32_Event_Window_Delete_Request Ecore_Win32_Event_Window_Delete_Request;
/**
* @typedef Ecore_Win32_Event_Selection_Clear
* Event sent when the content of the clipboard has been removed.
*
* @since 1.16
*/
typedef struct _Ecore_Win32_Event_Selection_Clear Ecore_Win32_Event_Selection_Clear;
/**
* @typedef Ecore_Win32_Event_Selection_Notify
* Event sent when the content of the clipboard has been added.
*
* @since 1.16
*/
typedef struct _Ecore_Win32_Event_Selection_Notify Ecore_Win32_Event_Selection_Notify;
/**
* @struct _Ecore_Win32_Event_Mouse_In
* Event sent when the mouse enters the window.
@ -350,6 +466,33 @@ struct _Ecore_Win32_Event_Window_Delete_Request
unsigned long timestamp; /**< The time the event occurred */
};
/**
* @struct _Ecore_Win32_Event_Selection_Clear
* Event sent when the content of the clipboard has been removed.
*
* @since 1.16
*/
struct _Ecore_Win32_Event_Selection_Clear
{
Ecore_Win32_Window *window; /**< The window that received the event */
unsigned long timestamp; /**< The time the event occurred */
Ecore_Win32_Selection selection; /**< The type of the selection */
};
/**
* @struct _Ecore_Win32_Event_Selection_Notify
* Event sent when the content of the clipboard has been added.
*
* @since 1.16
*/
struct _Ecore_Win32_Event_Selection_Notify
{
Ecore_Win32_Window *window; /**< The window that received the event */
unsigned long timestamp; /**< The time the event occurred */
Ecore_Win32_Selection selection; /**< The type of the selection */
void *data; /**< The data of the selection */
};
/**
* @typedef Ecore_Win32_Dnd_DropTarget_Callback
* Callback type for Drop operations. See ecore_win32_dnd_register_drop_target().
@ -368,6 +511,8 @@ EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the Ecore_Wi
EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the Ecore_Win32_Event_Configure event */
EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the Ecore_Win32_Event_Resize event */
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
EAPI extern int ECORE_WIN32_EVENT_SELECTION_CLEAR; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Clear event @since 1.16 */
EAPI extern int ECORE_WIN32_EVENT_SELECTION_NOTIFY; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Notify event @since 1.16 */
/* Core */
@ -503,6 +648,8 @@ EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
EAPI const Ecore_Win32_Cursor *ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape);
EAPI void ecore_win32_cursor_size_get(int *width, int *height);
@ -516,6 +663,60 @@ EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window
Ecore_Win32_Dnd_DropTarget_Callback callback);
EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
/* Clipboard */
/**
* @brief Set data to the clipboard.
*
* @param[in] window The window that owns the clipboard.
* @param[in] data The data to set.
* @param[in] size The size of the data.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function sets @p data of size @p size in the clipboard owned by
* @p window. This function returns #EINA_TRUE on success, and
* #EINA_FALSE otherwise. If @p window or @p data are @c NULL, or @p size
* is less than or equal to 0, this function returns #EINA_FALSE.
*
* @since 1.16
*/
EAPI Eina_Bool ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
const void *data,
int size);
/**
* @brief Get data from the clipboard.
*
* @param[in] window The window that owns the clipboard.
* @param[out] data The retrieved data.
* @param[out] size The size of the data.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function gets @p data of size @p size from the clipboard owned by
* @p window. This function returns #EINA_TRUE on success, and
* #EINA_FALSE otherwise. If @p window is @c NULL, this function returns
* #EINA_FALSE. @p data and @p size must be valid buffers.
*
* @since 1.16
*/
EAPI Eina_Bool ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
void **data,
int *size);
/**
* @brief Cleat the clipboard.
*
* @param[in] window The window that owns the clipboard.
* @return #EINA_TRUE on success, #EINA_FALSE otherwise.
*
* This function clears the clipboard owned by @p window. This
* function returns #EINA_TRUE on success, and #EINA_FALSE otherwise.
* If @p window is @c NULL, this function returns #EINA_FALSE.
*
* @since 1.16
*/
EAPI Eina_Bool ecore_win32_clipboard_clear(const Ecore_Win32_Window *window);
/**
* @}
*/

View File

@ -24,10 +24,18 @@
* @cond LOCAL
*/
/* FIXME: uncomment when mingw-w64 will be updated in win-builds */
/* #if _WIN32_WINNT >= 0x0600 */
/* # ifndef WM_CLIPBOARDUPDATE */
# define WM_CLIPBOARDUPDATE 0x031D
/* # endif */
/* #endif */
/* OLE IID for Drag'n Drop */
# define INITGUID
# include <basetyps.h>
#define INITGUID
#include <basetyps.h>
DEFINE_OLEGUID(IID_IEnumFORMATETC, 0x00000103L, 0, 0);
DEFINE_OLEGUID(IID_IDataObject, 0x0000010EL, 0, 0);
DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
@ -36,7 +44,10 @@ DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
#define IDI_ICON 101
static int _ecore_win32_init_count = 0;
typedef BOOL WINAPI (*efl_AddClipboardFormatListener)(_In_ HWND hwnd);
typedef BOOL WINAPI (*efl_RemoveClipboardFormatListener)(_In_ HWND hwnd);
static int _ecore_win32_init_count = 0;
LRESULT CALLBACK
_ecore_win32_window_procedure(HWND window,
@ -194,13 +205,33 @@ _ecore_win32_window_procedure(HWND window,
return 0;
/* Window notifications */
case WM_CREATE:
INF("create window message");
{
efl_AddClipboardFormatListener acfl;
INF("create window message");
acfl = (efl_AddClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"),
"AddClipboardFormatListener");
if (acfl)
{
if (!acfl(window))
INF("can not create clipboard format listener; no clipboard notification will be sent");
}
_ecore_win32_event_handle_create_notify(data);
return 0;
}
case WM_DESTROY:
INF("destroy window message");
_ecore_win32_event_handle_destroy_notify(data);
return 0;
{
efl_RemoveClipboardFormatListener rcfl;
INF("destroy window message");
_ecore_win32_event_handle_destroy_notify(data);
rcfl = (efl_RemoveClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"),
"RemoveClipboardFormatListener");
if (rcfl)
rcfl(window);
return 0;
}
case WM_SHOWWINDOW:
INF("show window message");
if ((data->data_param == SW_OTHERUNZOOM) ||
@ -299,6 +330,23 @@ _ecore_win32_window_procedure(HWND window,
return 0;
}
return DefWindowProc(window, message, window_param, data_param);
case WM_CLIPBOARDUPDATE:
INF("clipboard data updated");
_ecore_win32_event_handle_selection_notify(data);
return 0;
case WM_SETCURSOR:
{
Ecore_Win32_Window *w;
INF("SetCursor");
w = (Ecore_Win32_Window *)GetWindowLongPtr(window, GWLP_USERDATA);
if (w && w->cursor)
{
SetCursor(w->cursor);
return 1;
}
return 0;
}
/* GDI notifications */
case WM_PAINT:
{
@ -340,11 +388,12 @@ _ecore_win32_window_procedure(HWND window,
*============================================================================*/
HINSTANCE _ecore_win32_instance = NULL;
double _ecore_win32_double_click_time = 0.25;
unsigned long _ecore_win32_event_last_time = 0;
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
int _ecore_win32_log_dom_global = -1;
HINSTANCE _ecore_win32_instance = NULL;
double _ecore_win32_double_click_time = 0.25;
unsigned long _ecore_win32_event_last_time = 0;
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
int _ecore_win32_log_dom_global = -1;
Ecore_Win32_Cursor *_ecore_win32_cursor_x[77];
int ECORE_WIN32_EVENT_MOUSE_IN = 0;
int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
@ -358,6 +407,8 @@ int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
int ECORE_WIN32_EVENT_WINDOW_CONFIGURE = 0;
int ECORE_WIN32_EVENT_WINDOW_RESIZE = 0;
int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = 0;
int ECORE_WIN32_EVENT_SELECTION_CLEAR = 0;
int ECORE_WIN32_EVENT_SELECTION_NOTIFY = 0;
/*============================================================================*
* API *
@ -419,6 +470,7 @@ ecore_win32_init()
WNDCLASSEX wc;
HICON icon;
HICON icon_sm;
int i;
if (++_ecore_win32_init_count != 1)
return _ecore_win32_init_count;
@ -504,8 +556,13 @@ ecore_win32_init()
ECORE_WIN32_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
ECORE_WIN32_EVENT_WINDOW_RESIZE = ecore_event_type_new();
ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST = ecore_event_type_new();
ECORE_WIN32_EVENT_SELECTION_CLEAR = ecore_event_type_new();
ECORE_WIN32_EVENT_SELECTION_NOTIFY = ecore_event_type_new();
}
for (i = 0; i < 77; i++)
_ecore_win32_cursor_x[i] = _ecore_win32_cursor_x11_shaped_new(i);
return _ecore_win32_init_count;
unregister_class:
@ -535,9 +592,14 @@ ecore_win32_init()
EAPI int
ecore_win32_shutdown()
{
int i;
if (--_ecore_win32_init_count != 0)
return _ecore_win32_init_count;
for (i = 0; i < 77; i++)
ecore_win32_cursor_free(_ecore_win32_cursor_x[i]);
ecore_win32_dnd_shutdown();
if (!UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance))

View File

@ -0,0 +1,188 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <Eina.h>
#include "Ecore_Win32.h"
#include "ecore_win32_private.h"
/*============================================================================*
* Local *
*============================================================================*/
/**
* @cond LOCAL
*/
/**
* @endcond
*/
/*============================================================================*
* Global *
*============================================================================*/
/*============================================================================*
* API *
*============================================================================*/
EAPI Eina_Bool
ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
const void *data,
int size)
{
HGLOBAL global;
char *d;
/*
* See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.aspx#_win32_Copying_Information_to_the_Clipboard
* 1. Open the clipboard
* 2. Empty the clipboard
* 3. Set the data
* 4. Close the clipboard
*/
INF("setting data to the clipboard");
if (!window || !data || (size <= 0))
return EINA_FALSE;
if (!OpenClipboard(window->window))
return EINA_FALSE;
if (!EmptyClipboard())
goto close_clipboard;
global = GlobalAlloc(GMEM_MOVEABLE, size + 1);
if (!global)
goto close_clipboard;
d = (char *)GlobalLock(global);
if (!d)
goto unlock_global;
memcpy(d, data, size);
d[size] = '\0';
GlobalUnlock(global);
SetClipboardData(CF_TEXT, global);
CloseClipboard();
return EINA_TRUE;
unlock_global:
GlobalUnlock(global);
close_clipboard:
CloseClipboard();
return EINA_FALSE;
}
EAPI Eina_Bool
ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
void **data,
int *size)
{
HGLOBAL global;
void *d;
void *p;
/*
* See https://msdn.microsoft.com/en-us/library/windows/desktop/ms649016%28v=vs.85%29.aspx#_win32_Pasting_Information_from_the_Clipboard
* 1. Open Clipboard
* 2. Determine format
* 3. Retrieve data
* 4. Manage data
* 5. Close clipboard
*/
INF("getting data from the clipboard");
if (!window)
return EINA_FALSE;
if (!IsClipboardFormatAvailable(CF_TEXT))
return EINA_FALSE;
if (!OpenClipboard(window->window))
goto set_val;
/* { */
/* UINT fmt = 0; */
/* while (1) */
/* { */
/* fmt = EnumClipboardFormats(fmt); */
/* printf(" $ Format : %x\n", fmt); */
/* if (!fmt) */
/* break; */
/* } */
/* } */
global = GetClipboardData(CF_TEXT);
if (!global)
goto close_clipboard;
d = GlobalLock(global);
if (!d)
goto unlock_global;
*size = strlen(d);
p = malloc(*size);
if (!p)
goto unlock_global;
memcpy(p, d, *size);
*data = p;
GlobalUnlock(global);
CloseClipboard();
return EINA_TRUE;
unlock_global:
GlobalUnlock(global);
close_clipboard:
CloseClipboard();
set_val:
*data = NULL;
*size = 0;
return EINA_FALSE;
}
EAPI Eina_Bool
ecore_win32_clipboard_clear(const Ecore_Win32_Window *window)
{
INF("clearing the clipboard");
if (!window)
return EINA_FALSE;
if (!OpenClipboard(window->window))
return EINA_FALSE;
if (!EmptyClipboard())
goto close_clipboard;
CloseClipboard();
return EINA_TRUE;
close_clipboard:
CloseClipboard();
return EINA_FALSE;
}
/**
* @}
*/

View File

@ -10,12 +10,30 @@
#include "Ecore_Win32.h"
#include "ecore_win32_private.h"
#include "ecore_win32_cursor_x11.h"
/*============================================================================*
* Local *
*============================================================================*/
Ecore_Win32_Cursor *
_ecore_win32_cursor_x11_shaped_new(Ecore_Win32_Cursor_X11_Shape shape)
{
INF("creating X11 shaped cursor");
if ((shape < ECORE_WIN32_CURSOR_X11_SHAPE_X) ||
(shape > ECORE_WIN32_CURSOR_X11_SHAPE_XTERM))
return NULL;
return ecore_win32_cursor_new(_ecore_win32_cursors_x11[shape].mask_and,
_ecore_win32_cursors_x11[shape].mask_xor,
32, 32,
_ecore_win32_cursors_x11[shape].hotspot_x,
_ecore_win32_cursors_x11[shape].hotspot_y);
}
/*============================================================================*
* Global *
*============================================================================*/
@ -157,7 +175,11 @@
* };
*
* Ecore_Win32_Cursor *cursor = ecore_win32_cursor_new(pixels_and, pixels_xor, 32, 32, 19, 2);
* ecore_win32_window_cursor_set(window, cursor);
* @endcode
*
* @see ecore_win32_cursor_free()
* @see ecore_win32_window_cursor_set()
*/
EAPI Ecore_Win32_Cursor *
ecore_win32_cursor_new(const void *pixels_and,
@ -199,13 +221,19 @@ ecore_win32_cursor_new(const void *pixels_and,
* @param cursor The cursor to free.
*
* This function free @p cursor. @p cursor must have been obtained
* with ecore_win32_cursor_new().
* with ecore_win32_cursor_new() or ecore_win32_cursor_x11_shaped_new().
*
* @see ecore_win32_cursor_new()
* @see ecore_win32_cursor_x11_shaped_new()
*/
EAPI void
ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
{
INF("destroying cursor");
if (!cursor)
return;
DestroyCursor(cursor);
}
@ -217,7 +245,7 @@ ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
*
* This function returns a pre-defined cursor with a specified
* @p shape. This cursor does not need to be freed, as it is loaded
* from an existing resource.
* from an existing resource. On error @c NULL is returned.
*/
EAPI Ecore_Win32_Cursor *
ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
@ -281,6 +309,33 @@ ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
return cursor;
}
/**
* @brief Retrieve a X11 cursor from a X Id.
*
* @param[in] shape The defined X11 shape of the cursor.
* @return The new cursor.
*
* This function returns a defined cursor with a specified X11
* @p shape. Do not use ecore_win32_cursor_free() to free the
* ressources as it is created once the libray is initialized and
* detroyed when it is shut down.
*
* @see ecore_win32_cursor_new()
*
* @since 1.16
*/
EAPI const Ecore_Win32_Cursor *
ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape)
{
INF("getting X11 shaped cursor");
if ((shape < ECORE_WIN32_CURSOR_X11_SHAPE_X) ||
(shape > ECORE_WIN32_CURSOR_X11_SHAPE_XTERM))
return NULL;
return _ecore_win32_cursor_x[shape];
}
/**
* @brief Retrieve the size of a valid cursor.
*

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,7 @@ static int _ecore_win32_mouse_down_did_triple = 0;
static int _ecore_win32_mouse_up_count = 0;
static Ecore_Win32_Key_Mask _ecore_win32_key_mask = 0;
static Eina_Bool _ecore_win32_ctrl_fake = EINA_FALSE;
static Eina_Bool _ecore_win32_clipboard_has_data = EINA_FALSE;
static unsigned int
_ecore_win32_modifiers_get(void)
@ -1895,3 +1896,72 @@ _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg)
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST, e, NULL, NULL);
}
void
_ecore_win32_event_handle_selection_notify(Ecore_Win32_Callback_Data *msg)
{
Ecore_Win32_Event_Selection_Notify *e;
HGLOBAL global;
char *str;
INF("selection_notify");
/*
* we have text data in clipboard but no data before,
* so text data has just been added
*/
if (IsClipboardFormatAvailable(CF_TEXT) && !_ecore_win32_clipboard_has_data)
{
e = calloc(1, sizeof(Ecore_Win32_Event_Selection_Notify));
if (!e) return;
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
e->timestamp = _ecore_win32_event_last_time;
e->selection = ECORE_WIN32_SELECTION_CLIPBOARD;
if (!OpenClipboard(msg->window))
goto free_e;
global = GetClipboardData(CF_TEXT);
if (!global)
goto close_clipboard;
str = GlobalLock(global);
if (str)
{
e->data = strdup(str);
GlobalUnlock(global);
}
CloseClipboard();
ecore_event_add(ECORE_WIN32_EVENT_SELECTION_NOTIFY, e, NULL, NULL);
_ecore_win32_clipboard_has_data = EINA_TRUE;
}
/*
* we have no more text data in clipboard and data before,
* so text data has just been removed
*/
if (!IsClipboardFormatAvailable(CF_TEXT) && _ecore_win32_clipboard_has_data)
{
e = calloc(1, sizeof(Ecore_Win32_Event_Selection_Clear));
if (!e) return;
e->window = (void *)GetWindowLongPtr(msg->window, GWLP_USERDATA);
e->timestamp = _ecore_win32_event_last_time;
e->selection = ECORE_WIN32_SELECTION_CLIPBOARD;
ecore_event_add(ECORE_WIN32_EVENT_SELECTION_CLEAR, e, NULL, NULL);
_ecore_win32_clipboard_has_data = EINA_FALSE;
}
return;
close_clipboard:
CloseClipboard();
free_e:
free(e);
}

View File

@ -74,6 +74,8 @@ struct _Ecore_Win32_Window
DWORD style; /* used to go fullscreen to normal */
RECT rect; /* used to go fullscreen to normal */
Ecore_Win32_Cursor *cursor;
struct {
Ecore_Win32_Pos_Hints_Flags flags;
int min_width;
@ -145,6 +147,7 @@ extern HINSTANCE _ecore_win32_instance;
extern double _ecore_win32_double_click_time;
extern unsigned long _ecore_win32_event_last_time;
extern Ecore_Win32_Window *_ecore_win32_event_last_window;
extern Ecore_Win32_Cursor *_ecore_win32_cursor_x[77];
void _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg);
@ -164,6 +167,7 @@ void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_configure_notify(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_resize(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_delete_request(Ecore_Win32_Callback_Data *msg);
void _ecore_win32_event_handle_selection_notify(Ecore_Win32_Callback_Data *msg);
void *_ecore_win32_dnd_data_object_new(void *fmtetc, void *stgmeds, int count);
void _ecore_win32_dnd_data_object_free(void *data_object);
@ -173,7 +177,9 @@ void *_ecore_win32_dnd_register_drop_window(HWND hwnd,
Ecore_Win32_Dnd_DropTarget_Callback callback, void *ptr);
void _ecore_win32_dnd_unregister_drop_window(HWND hwnd, void *drop_target);
Eina_Bool ecore_win32_window_drag(Ecore_Win32_Window *w, int ptx, int pty);
Eina_Bool ecore_win32_window_drag(Ecore_Win32_Window *w, int ptx, int pty);
Ecore_Win32_Cursor *_ecore_win32_cursor_x11_shaped_new(Ecore_Win32_Cursor_X11_Shape shape);
#ifdef __cplusplus

View File

@ -155,6 +155,8 @@ _ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
w->drag.current_mouse_x = -32768;
w->drag.current_mouse_y = -32768;
w->cursor = LoadCursor (NULL, IDC_ARROW);
return w;
}
@ -1436,8 +1438,13 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
*
* This function sets @p cursor to @p window. @p cursor must have been
* obtained by ecore_win32_cursor_new() or
* ecore_win32_cursor_shaped_new(). If @p window or @p cursor is
* ecore_win32_cursor_shaped_new() or
* ecore_win32_cursor_x11_shaped_new(). If @p window or @p cursor is
* @c NULL, the function does nothing.
*
* @see ecore_win32_cursor_new()
* @see ecore_win32_cursor_shaped_new()
* @see ecore_win32_cursor_x11_shaped_new()
*/
EAPI void
ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
@ -1448,11 +1455,7 @@ ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
if (!window || !cursor)
return;
if (!SetClassLongPtr(window->window,
GCLP_HCURSOR, (LONG_PTR)cursor))
{
ERR("SetClassLong() failed");
}
window->cursor = cursor;
}
/**

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
/* local variables */
static int _ecore_wl2_init_count = 0;
/* external variables */
int _ecore_wl2_log_dom = -1;
/* public API variables */
EAPI int ECORE_WL2_EVENT_GLOBAL_ADDED = 0;
EAPI int ECORE_WL2_EVENT_GLOBAL_REMOVED = 0;
EAPI int ECORE_WL2_EVENT_FOCUS_IN = 0;
EAPI int ECORE_WL2_EVENT_FOCUS_OUT = 0;
EAPI int ECORE_WL2_EVENT_DND_ENTER = 0;
EAPI int ECORE_WL2_EVENT_DND_LEAVE = 0;
EAPI int ECORE_WL2_EVENT_DND_MOTION = 0;
EAPI int ECORE_WL2_EVENT_DND_DROP = 0;
EAPI int ECORE_WL2_EVENT_DND_END = 0;
EAPI int ECORE_WL2_EVENT_DATA_SOURCE_CANCELLED = 0;
EAPI int ECORE_WL2_EVENT_DATA_SOURCE_TARGET = 0;
EAPI int ECORE_WL2_EVENT_DATA_SOURCE_SEND = 0;
EAPI int ECORE_WL2_EVENT_SELECTION_DATA_READY = 0;
EAPI int ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0;
/* public API functions */
EAPI int
ecore_wl2_init(void)
{
if (++_ecore_wl2_init_count != 1) return _ecore_wl2_init_count;
/* try to initialize Eina */
if (!eina_init()) return --_ecore_wl2_init_count;
/* try to create Eina logging domain */
_ecore_wl2_log_dom =
eina_log_domain_register("ecore_wl2", ECORE_WL2_DEFAULT_LOG_COLOR);
if (_ecore_wl2_log_dom < 0)
{
EINA_LOG_ERR("Cannot create a log domain for Ecore Wl2");
goto eina_err;
}
/* try to initialize Ecore */
if (!ecore_init())
{
ERR("Could not initialize Ecore");
goto ecore_err;
}
/* try to initialize Ecore_Event */
if (!ecore_event_init())
{
ERR("Could not initialize Ecore_Event");
goto ecore_event_err;
}
/* handle creating new Ecore_Wl2 event types */
if (!ECORE_WL2_EVENT_GLOBAL_ADDED)
{
ECORE_WL2_EVENT_GLOBAL_ADDED = ecore_event_type_new();
ECORE_WL2_EVENT_GLOBAL_REMOVED = ecore_event_type_new();
ECORE_WL2_EVENT_FOCUS_IN = ecore_event_type_new();
ECORE_WL2_EVENT_FOCUS_OUT = ecore_event_type_new();
ECORE_WL2_EVENT_DND_ENTER = ecore_event_type_new();
ECORE_WL2_EVENT_DND_LEAVE = ecore_event_type_new();
ECORE_WL2_EVENT_DND_MOTION = ecore_event_type_new();
ECORE_WL2_EVENT_DND_DROP = ecore_event_type_new();
ECORE_WL2_EVENT_DND_END = ecore_event_type_new();
ECORE_WL2_EVENT_DATA_SOURCE_CANCELLED = ecore_event_type_new();
ECORE_WL2_EVENT_DATA_SOURCE_TARGET = ecore_event_type_new();
ECORE_WL2_EVENT_DATA_SOURCE_SEND = ecore_event_type_new();
ECORE_WL2_EVENT_SELECTION_DATA_READY = ecore_event_type_new();
ECORE_WL2_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
}
return _ecore_wl2_init_count;
ecore_event_err:
ecore_shutdown();
ecore_err:
eina_log_domain_unregister(_ecore_wl2_log_dom);
_ecore_wl2_log_dom = -1;
eina_err:
eina_shutdown();
return --_ecore_wl2_init_count;
}
EAPI int
ecore_wl2_shutdown(void)
{
if (_ecore_wl2_init_count < 1)
{
ERR("Ecore_Wl2 shutdown called without Ecore_Wl2 Init");
return 0;
}
if (--_ecore_wl2_init_count != 0) return _ecore_wl2_init_count;
/* reset events */
ECORE_WL2_EVENT_GLOBAL_ADDED = 0;
ECORE_WL2_EVENT_GLOBAL_REMOVED = 0;
ECORE_WL2_EVENT_FOCUS_IN = 0;
ECORE_WL2_EVENT_FOCUS_OUT = 0;
ECORE_WL2_EVENT_DND_ENTER = 0;
ECORE_WL2_EVENT_DND_LEAVE = 0;
ECORE_WL2_EVENT_DND_MOTION = 0;
ECORE_WL2_EVENT_DND_DROP = 0;
ECORE_WL2_EVENT_DND_END = 0;
ECORE_WL2_EVENT_DATA_SOURCE_CANCELLED = 0;
ECORE_WL2_EVENT_DATA_SOURCE_TARGET = 0;
ECORE_WL2_EVENT_DATA_SOURCE_SEND = 0;
ECORE_WL2_EVENT_SELECTION_DATA_READY = 0;
ECORE_WL2_EVENT_WINDOW_CONFIGURE = 0;
/* shutdown Ecore_Event */
ecore_event_shutdown();
/* shutdown Ecore */
ecore_shutdown();
/* unregister logging domain */
eina_log_domain_unregister(_ecore_wl2_log_dom);
_ecore_wl2_log_dom = -1;
/* shutdown eina */
eina_shutdown();
return _ecore_wl2_init_count;
}

View File

@ -0,0 +1,745 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
static Eina_Bool _fatal_error = EINA_FALSE;
static Eina_Hash *_server_displays = NULL;
static Eina_Hash *_client_displays = NULL;
static void
_ecore_wl2_display_signal_exit(void)
{
Ecore_Event_Signal_Exit *ev;
ev = calloc(1, sizeof(Ecore_Event_Signal_Exit));
if (!ev) return;
ev->quit = EINA_TRUE;
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, ev, NULL, NULL);
}
static void
_xdg_shell_cb_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
{
xdg_shell_pong(shell, serial);
}
static const struct xdg_shell_listener _xdg_shell_listener =
{
_xdg_shell_cb_ping
};
static void
_cb_global_event_free(void *data EINA_UNUSED, void *event)
{
Ecore_Wl2_Event_Global *ev;
ev = event;
eina_stringshare_del(ev->interface);
free(ev);
}
static void
_cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const char *interface, unsigned int version)
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Event_Global *ev;
ewd = data;
/* test to see if we have already added this global to our hash */
if (!eina_hash_find(ewd->globals, &id))
{
Ecore_Wl2_Global *global;
/* allocate space for new global */
global = calloc(1, sizeof(Ecore_Wl2_Global));
if (!global) return;
global->id = id;
global->interface = eina_stringshare_add(interface);
global->version = version;
/* add this global to our hash */
if (!eina_hash_add(ewd->globals, &global->id, global))
{
eina_stringshare_del(global->interface);
free(global);
}
}
else
goto event;
if (!strcmp(interface, "wl_compositor"))
{
ewd->wl.compositor =
wl_registry_bind(registry, id, &wl_compositor_interface, 3);
}
else if (!strcmp(interface, "wl_subcompositor"))
{
ewd->wl.subcompositor =
wl_registry_bind(registry, id, &wl_subcompositor_interface, 1);
}
else if (!strcmp(interface, "wl_shm"))
{
ewd->wl.shm =
wl_registry_bind(registry, id, &wl_shm_interface, 1);
}
else if (!strcmp(interface, "wl_data_device_manager"))
{
ewd->wl.data_device_manager =
wl_registry_bind(registry, id, &wl_data_device_manager_interface, 1);
}
else if (!strcmp(interface, "wl_shell"))
{
ewd->wl.wl_shell =
wl_registry_bind(registry, id, &wl_shell_interface, 1);
}
else if ((!strcmp(interface, "xdg_shell")) &&
(!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
{
ewd->wl.xdg_shell =
wl_registry_bind(registry, id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(ewd->wl.xdg_shell, XDG_VERSION);
xdg_shell_add_listener(ewd->wl.xdg_shell, &_xdg_shell_listener, NULL);
}
else if (!strcmp(interface, "wl_output"))
_ecore_wl2_output_add(ewd, id);
else if (!strcmp(interface, "wl_seat"))
_ecore_wl2_input_add(ewd, id, version);
event:
/* allocate space for event structure */
ev = calloc(1, sizeof(Ecore_Wl2_Event_Global));
if (!ev) return;
ev->id = id;
ev->display = ewd;
ev->version = version;
ev->interface = eina_stringshare_add(interface);
/* raise an event saying a new global has been added */
ecore_event_add(ECORE_WL2_EVENT_GLOBAL_ADDED, ev,
_cb_global_event_free, NULL);
}
static void
_cb_global_remove(void *data, struct wl_registry *registry EINA_UNUSED, unsigned int id)
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Global *global;
Ecore_Wl2_Event_Global *ev;
ewd = data;
/* try to find this global in our hash */
global = eina_hash_find(ewd->globals, &id);
if (!global) return;
/* allocate space for event structure */
ev = calloc(1, sizeof(Ecore_Wl2_Event_Global));
if (!ev) return;
ev->id = id;
ev->display = ewd;
ev->version = global->version;
ev->interface = eina_stringshare_add(global->interface);
/* raise an event saying a global has been removed */
ecore_event_add(ECORE_WL2_EVENT_GLOBAL_REMOVED, ev,
_cb_global_event_free, NULL);
/* delete this global from our hash */
if (ewd->globals) eina_hash_del_by_key(ewd->globals, &id);
}
static const struct wl_registry_listener _registry_listener =
{
_cb_global_add,
_cb_global_remove
};
static Eina_Bool
_cb_create_data(void *data, Ecore_Fd_Handler *hdl)
{
Ecore_Wl2_Display *ewd;
struct wl_event_loop *loop;
ewd = data;
if (_fatal_error) return ECORE_CALLBACK_CANCEL;
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_ERROR))
{
ERR("Received Fatal Error on Wayland Display");
_fatal_error = EINA_TRUE;
_ecore_wl2_display_signal_exit();
return ECORE_CALLBACK_CANCEL;
}
loop = wl_display_get_event_loop(ewd->wl.display);
wl_event_loop_dispatch(loop, 0);
/* wl_display_flush_clients(ewd->wl.display); */
return ECORE_CALLBACK_RENEW;
}
static void
_cb_create_prepare(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
Ecore_Wl2_Display *ewd;
ewd = data;
wl_display_flush_clients(ewd->wl.display);
}
static Eina_Bool
_cb_connect_data(void *data, Ecore_Fd_Handler *hdl)
{
Ecore_Wl2_Display *ewd;
int ret = 0;
ewd = data;
if (_fatal_error) return ECORE_CALLBACK_CANCEL;
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_ERROR))
{
ERR("Received Fatal Error on Wayland Display");
_fatal_error = EINA_TRUE;
_ecore_wl2_display_signal_exit();
return ECORE_CALLBACK_CANCEL;
}
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_READ))
{
ret = wl_display_dispatch(ewd->wl.display);
if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
{
ERR("Received Fatal Error on Wayland Display");
_fatal_error = EINA_TRUE;
_ecore_wl2_display_signal_exit();
return ECORE_CALLBACK_CANCEL;
}
}
if (ecore_main_fd_handler_active_get(hdl, ECORE_FD_WRITE))
{
ret = wl_display_flush(ewd->wl.display);
if (ret == 0)
ecore_main_fd_handler_active_set(hdl, ECORE_FD_READ);
if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
{
ERR("Received Fatal Error on Wayland Display");
_fatal_error = EINA_TRUE;
_ecore_wl2_display_signal_exit();
return ECORE_CALLBACK_CANCEL;
}
}
return ECORE_CALLBACK_RENEW;
}
static void
_cb_globals_hash_del(void *data)
{
Ecore_Wl2_Global *global;
global = data;
eina_stringshare_del(global->interface);
free(global);
}
static Eina_Bool
_cb_connect_idle(void *data)
{
Ecore_Wl2_Display *ewd;
int ret = 0;
ewd = data;
if (!ewd) return ECORE_CALLBACK_RENEW;
if (_fatal_error) return ECORE_CALLBACK_CANCEL;
ret = wl_display_get_error(ewd->wl.display);
if (ret < 0) goto err;
ret = wl_display_dispatch_pending(ewd->wl.display);
if (ret < 0) goto err;
ret = wl_display_flush(ewd->wl.display);
if ((ret < 0) && (errno == EAGAIN))
ecore_main_fd_handler_active_set(ewd->fd_hdl,
(ECORE_FD_READ | ECORE_FD_WRITE));
return ECORE_CALLBACK_RENEW;
err:
if ((ret < 0) && ((errno != EAGAIN) && (errno != EINVAL)))
{
ERR("Wayland Socket Error: %s", strerror(errno));
_fatal_error = EINA_TRUE;
_ecore_wl2_display_signal_exit();
return ECORE_CALLBACK_CANCEL;
}
return ECORE_CALLBACK_RENEW;
}
static void
_cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
{
Ecore_Wl2_Display *ewd;
ewd = data;
ewd->sync_done = EINA_TRUE;
wl_callback_destroy(cb);
}
static const struct wl_callback_listener _sync_listener =
{
_cb_sync_done
};
static void
_ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
{
Ecore_Wl2_Output *output;
Ecore_Wl2_Input *input;
Eina_Inlist *tmp;
if (--ewd->refs) return;
if (ewd->xkb_context) xkb_context_unref(ewd->xkb_context);
/* free each input */
EINA_INLIST_FOREACH_SAFE(ewd->inputs, tmp, input)
_ecore_wl2_input_del(input);
/* free each output */
EINA_INLIST_FOREACH_SAFE(ewd->outputs, tmp, output)
_ecore_wl2_output_del(output);
if (ewd->idle_enterer) ecore_idle_enterer_del(ewd->idle_enterer);
if (ewd->fd_hdl) ecore_main_fd_handler_del(ewd->fd_hdl);
eina_hash_free(ewd->globals);
if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell);
if (ewd->wl.wl_shell) wl_shell_destroy(ewd->wl.wl_shell);
if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
if (ewd->wl.data_device_manager)
wl_data_device_manager_destroy(ewd->wl.data_device_manager);
if (ewd->wl.compositor) wl_compositor_destroy(ewd->wl.compositor);
if (ewd->wl.subcompositor) wl_subcompositor_destroy(ewd->wl.subcompositor);
if (ewd->wl.registry) wl_registry_destroy(ewd->wl.registry);
wl_display_flush(ewd->wl.display);
if (ewd->name) free(ewd->name);
/* remove this client display from hash */
if (_client_displays) eina_hash_del(_client_displays, ewd->name, ewd);
}
Ecore_Wl2_Window *
_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface)
{
Ecore_Wl2_Window *window;
if ((!display) || (!wl_surface)) return NULL;
EINA_INLIST_FOREACH(display->windows, window)
{
if ((window->surface) &&
(window->surface == wl_surface))
return window;
}
return NULL;
}
EAPI Ecore_Wl2_Display *
ecore_wl2_display_create(const char *name)
{
Ecore_Wl2_Display *ewd;
struct wl_event_loop *loop;
const char *n;
if (!_server_displays)
_server_displays = eina_hash_string_superfast_new(NULL);
if (!name)
{
/* someone wants to create a new server */
n = getenv("WAYLAND_DISPLAY");
if (n)
{
/* we have a default wayland display */
/* check hash of cached server displays for this name */
ewd = eina_hash_find(_server_displays, n);
if (ewd) goto found;
}
}
else
{
/* someone wants to create a server with a specific display */
/* check hash of cached server displays for this name */
ewd = eina_hash_find(_server_displays, name);
if (ewd) goto found;
}
/* allocate space for display structure */
ewd = calloc(1, sizeof(Ecore_Wl2_Display));
if (!ewd) return NULL;
ewd->refs++;
ewd->pid = getpid();
/* try to create new wayland display */
ewd->wl.display = wl_display_create();
if (!ewd->wl.display)
{
ERR("Could not create wayland display: %m");
goto create_err;
}
if (!name)
{
const char *n;
n = wl_display_add_socket_auto(ewd->wl.display);
if (!n)
{
ERR("Failed to add display socket: %m");
goto socket_err;
}
ewd->name = strdup(n);
}
else
{
if (wl_display_add_socket(ewd->wl.display, name))
{
ERR("Failed to add display socket: %m");
goto socket_err;
}
ewd->name = strdup(name);
}
setenv("WAYLAND_DISPLAY", ewd->name, 1);
DBG("WAYLAND_DISPLAY: %s", ewd->name);
loop = wl_display_get_event_loop(ewd->wl.display);
ewd->fd_hdl =
ecore_main_fd_handler_add(wl_event_loop_get_fd(loop),
ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
_cb_create_data, ewd, NULL, NULL);
ecore_main_fd_handler_prepare_callback_set(ewd->fd_hdl,
_cb_create_prepare, ewd);
/* add this new server display to hash */
eina_hash_add(_server_displays, ewd->name, ewd);
return ewd;
socket_err:
wl_display_destroy(ewd->wl.display);
create_err:
free(ewd);
return NULL;
found:
ewd->refs++;
return ewd;
}
static Eina_Bool
_ecore_wl2_display_sync_get(void)
{
Ecore_Wl2_Display *sewd;
Eina_Iterator *itr;
Eina_Bool ret = EINA_TRUE;
void *data;
if (eina_hash_population(_server_displays) < 1) return ret;
itr = eina_hash_iterator_data_new(_server_displays);
while (eina_iterator_next(itr, &data))
{
sewd = (Ecore_Wl2_Display *)data;
if (sewd->pid == getpid())
{
ret = EINA_FALSE;
break;
}
}
eina_iterator_free(itr);
return ret;
}
EAPI Ecore_Wl2_Display *
ecore_wl2_display_connect(const char *name)
{
Ecore_Wl2_Display *ewd;
Eina_Bool sync = EINA_TRUE;
struct wl_callback *cb;
const char *n;
if (!_client_displays)
_client_displays = eina_hash_string_superfast_new(NULL);
if (!name)
{
/* client wants to connect to default display */
n = getenv("WAYLAND_DISPLAY");
if (n)
{
/* we have a default wayland display */
/* check hash of cached client displays for this name */
ewd = eina_hash_find(_client_displays, n);
if (ewd) goto found;
}
}
else
{
/* client wants to connect to specific display */
/* check hash of cached client displays for this name */
ewd = eina_hash_find(_client_displays, name);
if (ewd) goto found;
}
if ((!name) && (!n))
{
ERR("No Wayland Display Running");
goto name_err;
}
/* allocate space for display structure */
ewd = calloc(1, sizeof(Ecore_Wl2_Display));
if (!ewd) return NULL;
ewd->refs++;
if (name)
ewd->name = strdup(name);
else if (n)
ewd->name = strdup(n);
ewd->globals = eina_hash_int32_new(_cb_globals_hash_del);
/* try to connect to wayland display with this name */
ewd->wl.display = wl_display_connect(ewd->name);
if (!ewd->wl.display)
{
ERR("Could not connect to display %s: %m", ewd->name);
goto connect_err;
}
ewd->fd_hdl =
ecore_main_fd_handler_add(wl_display_get_fd(ewd->wl.display),
ECORE_FD_READ | ECORE_FD_ERROR,
_cb_connect_data, ewd, NULL, NULL);
ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd);
ewd->wl.registry = wl_display_get_registry(ewd->wl.display);
wl_registry_add_listener(ewd->wl.registry, &_registry_listener, ewd);
ewd->xkb_context = xkb_context_new(0);
if (!ewd->xkb_context) goto context_err;
/* add this new client display to hash */
eina_hash_add(_client_displays, ewd->name, ewd);
/* check server display hash and match on pid. If match, skip sync */
sync = _ecore_wl2_display_sync_get();
cb = wl_display_sync(ewd->wl.display);
wl_callback_add_listener(cb, &_sync_listener, ewd);
if (sync)
{
/* NB: If we are connecting (as a client), then we will need to setup
* a callback for display_sync and wait for it to complete. There is no
* other option here as we need the compositor, shell, etc, to be setup
* before we can allow a user to make use of the API functions */
while (!ewd->sync_done)
wl_display_dispatch(ewd->wl.display);
}
else
{
/* this client is on same pid as server so we need to iterate
* main loop until the "server" advertises it's globals
*
* NB: DO NOT REMOVE THIS !!
*
* This is NEEDED for E's internal dialogs to function because the
* "server" and "client" are on the same PID
* and thus the "server" never advertises out it's globals
* (wl_compositor, wl_shm, etc) unless we sit here and iterate the
* main loop until it's done.
*
* If we remove this, E will never show an internal dialog as it
* just sits and waits for the globals */
while (!ewd->sync_done)
ecore_main_loop_iterate();
}
return ewd;
context_err:
ecore_main_fd_handler_del(ewd->fd_hdl);
wl_registry_destroy(ewd->wl.registry);
wl_display_disconnect(ewd->wl.display);
connect_err:
eina_hash_free(ewd->globals);
free(ewd->name);
free(ewd);
return NULL;
name_err:
eina_hash_free(_client_displays);
return NULL;
found:
ewd->refs++;
return ewd;
}
EAPI void
ecore_wl2_display_disconnect(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN(display);
_ecore_wl2_display_cleanup(display);
if (display->refs <= 0)
{
wl_display_disconnect(display->wl.display);
free(display);
}
}
EAPI void
ecore_wl2_display_destroy(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN(display);
_ecore_wl2_display_cleanup(display);
if (display->refs <= 0)
{
wl_display_destroy(display->wl.display);
free(display);
}
}
EAPI void
ecore_wl2_display_terminate(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN(display);
wl_display_terminate(display->wl.display);
}
EAPI struct wl_display *
ecore_wl2_display_get(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
return display->wl.display;
}
EAPI struct wl_shm *
ecore_wl2_display_shm_get(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
return display->wl.shm;
}
EAPI Eina_Iterator *
ecore_wl2_display_globals_get(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
return eina_hash_iterator_data_new(display->globals);
}
EAPI void
ecore_wl2_display_screen_size_get(Ecore_Wl2_Display *display, int *w, int *h)
{
Ecore_Wl2_Output *output;
int ow = 0, oh = 0;
EINA_SAFETY_ON_NULL_RETURN(display);
if (w) *w = 0;
if (h) *h = 0;
EINA_INLIST_FOREACH(display->outputs, output)
{
switch (output->transform)
{
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
ow += output->geometry.h;
oh += output->geometry.w;
break;
default:
ow += output->geometry.w;
oh += output->geometry.h;
break;
}
}
if (w) *w = ow;
if (h) *h = oh;
}
EAPI Ecore_Wl2_Window *
ecore_wl2_display_window_find(Ecore_Wl2_Display *display, unsigned int id)
{
Ecore_Wl2_Window *window;
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
EINA_INLIST_FOREACH(display->windows, window)
if (window->id == (int)id) return window;
return NULL;
}
EAPI struct wl_registry *
ecore_wl2_display_registry_get(Ecore_Wl2_Display *display)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
return display->wl.registry;
}

View File

@ -0,0 +1,627 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <unistd.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include "ecore_wl2_private.h"
struct _dnd_task
{
void *data;
Ecore_Fd_Cb cb;
};
struct _dnd_read_ctx
{
int epoll_fd;
struct epoll_event *ep;
};
static void
_offer_cb_offer(void *data, struct wl_data_offer *offer EINA_UNUSED, const char *type)
{
Ecore_Wl2_Dnd_Source *source;
char **t;
source = data;
if ((!source) || (!type)) return;
t = wl_array_add(&source->types, sizeof(*t));
if (t) *t = strdup(type);
}
static const struct wl_data_offer_listener _offer_listener =
{
_offer_cb_offer
};
static void
_source_cb_target_free(void *data EINA_UNUSED, void *event)
{
Ecore_Wl2_Event_Data_Source_Target *ev;
ev = event;
if (!ev) return;
free(ev->type);
free(ev);
}
static void
_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type)
{
Ecore_Wl2_Input *input;
Ecore_Wl2_Event_Data_Source_Target *ev;
input = data;
if (!input) return;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_Target));
if (!ev) return;
if (mime_type) ev->type = strdup(mime_type);
ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_TARGET, ev,
_source_cb_target_free, NULL);
}
static void
_source_cb_send_free(void *data EINA_UNUSED, void *event)
{
Ecore_Wl2_Event_Data_Source_Send *ev;
ev = event;
if (!ev) return;
free(ev->type);
free(ev);
}
static void
_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd)
{
Ecore_Wl2_Input *input;
Ecore_Wl2_Event_Data_Source_Send *ev;
input = data;
if (!input) return;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_Send));
if (!ev) return;
ev->fd = fd;
ev->type = strdup(mime_type);
ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND, ev,
_source_cb_send_free, NULL);
}
static void
_source_cb_cancelled(void *data, struct wl_data_source *source)
{
Ecore_Wl2_Input *input;
Ecore_Wl2_Event_Data_Source_Cancelled *ev;
input = data;
if (!input) return;
if (input->data.source == source) input->data.source = NULL;
wl_data_source_destroy(source);
ev = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_Cancelled));
if (!ev) return;
if (input->focus.pointer)
ev->win = input->focus.pointer->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_CANCELLED, ev, NULL, NULL);
}
static const struct wl_data_source_listener _source_listener =
{
_source_cb_target,
_source_cb_send,
_source_cb_cancelled
};
static void
_selection_data_ready_cb_free(void *data EINA_UNUSED, void *event)
{
Ecore_Wl2_Event_Selection_Data_Ready *ev;
ev = event;
if (!ev) return;
free(ev->data);
free(ev);
}
static Eina_Bool
_selection_data_read(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
{
int len;
char buffer[PATH_MAX];
Ecore_Wl2_Dnd_Source *source;
Ecore_Wl2_Event_Selection_Data_Ready *event;
Eina_Bool ret;
source = data;
len = read(source->fd, buffer, sizeof buffer);
event = calloc(1, sizeof(Ecore_Wl2_Event_Selection_Data_Ready));
if (!event) return ECORE_CALLBACK_CANCEL;
if (len <= 0)
{
close(source->fd);
_ecore_wl2_dnd_del(source);
event->done = EINA_TRUE;
event->data = NULL;
event->len = 0;
ret = ECORE_CALLBACK_CANCEL;
}
else
{
event->data = malloc(len);
if (!event->data)
{
free(event);
return ECORE_CALLBACK_CANCEL;
}
memcpy(event->data, buffer, len);
event->len = len;
event->done = EINA_FALSE;
ret = ECORE_CALLBACK_RENEW;
}
ecore_event_add(ECORE_WL2_EVENT_SELECTION_DATA_READY, event,
_selection_data_ready_cb_free, NULL);
return ret;
}
static Eina_Bool
_selection_cb_idle(void *data)
{
struct _dnd_read_ctx *ctx;
struct _dnd_task *task;
int count, i;
ctx = data;
count = epoll_wait(ctx->epoll_fd, ctx->ep, 1, 0);
for (i = 0; i < count; i++)
{
task = ctx->ep->data.ptr;
if (task->cb(task->data, NULL) == ECORE_CALLBACK_CANCEL)
{
free(ctx->ep);
free(task);
free(ctx);
return ECORE_CALLBACK_CANCEL;
}
}
return ECORE_CALLBACK_RENEW;
}
static void
_selection_data_receive(Ecore_Wl2_Dnd_Source *source, const char *type)
{
int epoll_fd;
struct epoll_event *ep = NULL;
struct _dnd_task *task = NULL;
struct _dnd_read_ctx *read_ctx = NULL;
int p[2];
if (pipe2(p, O_CLOEXEC) == -1)
return;
wl_data_offer_receive(source->offer, type, p[1]);
close(p[1]);
/* Due to http://trac.enlightenment.org/e/ticket/1208,
* use epoll and idle handler instead of ecore_main_fd_handler_add() */
ep = calloc(1, sizeof(struct epoll_event));
if (!ep) goto err;
task = calloc(1, sizeof(struct _dnd_task));
if (!task) goto err;
read_ctx = calloc(1, sizeof(struct _dnd_read_ctx));
if (!read_ctx) goto err;
epoll_fd = epoll_create1(0);
if (epoll_fd < 0) goto err;
task->data = source;
task->cb = _selection_data_read;
ep->events = EPOLLIN;
ep->data.ptr = task;
if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, p[0], ep) < 0) goto err;
read_ctx->epoll_fd = epoll_fd;
read_ctx->ep = ep;
if (!ecore_idler_add(_selection_cb_idle, read_ctx)) goto err;
source->refcount++;
source->fd = p[0];
return;
err:
if (ep) free(ep);
if (task) free(task);
if (read_ctx) free(read_ctx);
close(p[0]);
return;
}
void
_ecore_wl2_dnd_add(Ecore_Wl2_Input *input, struct wl_data_offer *offer)
{
Ecore_Wl2_Dnd_Source *source;
source = calloc(1, sizeof(Ecore_Wl2_Dnd_Source));
if (!source) return;
wl_array_init(&source->types);
source->refcount = 1;
source->input = input;
source->offer = offer;
wl_data_offer_add_listener(source->offer, &_offer_listener, source);
}
void
_ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct wl_surface *surface, int x, int y, unsigned int timestamp)
{
Ecore_Wl2_Window *window;
Ecore_Wl2_Event_Dnd_Enter *ev;
char **types;
int num = 0;
window = _ecore_wl2_display_window_surface_find(input->display, surface);
if (!window) return;
if (offer)
{
input->drag.source = wl_data_offer_get_user_data(offer);
num = (input->drag.source->types.size / sizeof(char *));
types = input->drag.source->types.data;
}
else
{
input->drag.source = NULL;
types = NULL;
}
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Enter));
if (!ev) return;
ev->win = window->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
ev->x = x;
ev->y = y;
ev->offer = offer;
ev->serial = timestamp;
ev->num_types = num;
ev->types = types;
ecore_event_add(ECORE_WL2_EVENT_DND_ENTER, ev, NULL, NULL);
}
void
_ecore_wl2_dnd_leave(Ecore_Wl2_Input *input)
{
Ecore_Wl2_Event_Dnd_Leave *ev;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Leave));
if (!ev) return;
if (input->focus.pointer)
ev->win = input->focus.pointer->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, NULL, NULL);
}
void
_ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timestamp)
{
Ecore_Wl2_Event_Dnd_Motion *ev;
input->pointer.sx = x;
input->pointer.sy = y;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Motion));
if (!ev) return;
if (input->focus.pointer)
ev->win = input->focus.pointer->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
ev->x = x;
ev->y = y;
ev->serial = timestamp;
ecore_event_add(ECORE_WL2_EVENT_DND_MOTION, ev, NULL, NULL);
}
void
_ecore_wl2_dnd_drop(Ecore_Wl2_Input *input)
{
Ecore_Wl2_Event_Dnd_Drop *ev;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Drop));
if (!ev) return;
if (input->drag.source)
{
if (input->focus.pointer)
ev->win = input->focus.pointer->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
}
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
ecore_event_add(ECORE_WL2_EVENT_DND_DROP, ev, NULL, NULL);
}
void
_ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer *offer)
{
if (input->selection.source) _ecore_wl2_dnd_del(input->selection.source);
input->selection.source = NULL;
if (offer)
{
char **t;
input->selection.source = wl_data_offer_get_user_data(offer);
t = wl_array_add(&input->selection.source->types, sizeof(*t));
*t = NULL;
}
}
void
_ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
{
if (!source) return;
source->refcount--;
if (source->refcount == 0)
{
wl_data_offer_destroy(source->offer);
wl_array_release(&source->types);
free(source);
}
}
EAPI void
ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **types)
{
struct wl_data_device_manager *manager;
const char **type;
char **t;
EINA_SAFETY_ON_NULL_RETURN(input);
EINA_SAFETY_ON_NULL_RETURN(input->display);
manager = input->display->wl.data_device_manager;
if (input->data.types.data)
{
wl_array_for_each(t, &input->data.types)
free(*t);
wl_array_release(&input->data.types);
wl_array_init(&input->data.types);
}
if (input->data.source) wl_data_source_destroy(input->data.source);
input->data.source = NULL;
input->data.source = wl_data_device_manager_create_data_source(manager);
if (!input->data.source)
{
ERR("Could not create data source: %m");
return;
}
for (type = types; *type; type++)
{
if (!*type) continue;
t = wl_array_add(&input->data.types, sizeof(*t));
if (t)
{
*t = strdup(*type);
wl_data_source_offer(input->data.source, *t);
}
}
}
EAPI void
ecore_wl2_dnd_drag_start(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, Ecore_Wl2_Window *drag_window)
{
struct wl_surface *dsurface, *osurface;
EINA_SAFETY_ON_NULL_RETURN(input);
EINA_SAFETY_ON_NULL_RETURN(input->data.source);
EINA_SAFETY_ON_NULL_RETURN(drag_window);
dsurface = ecore_wl2_window_surface_get(drag_window);
_ecore_wl2_input_ungrab(input);
wl_data_source_add_listener(input->data.source, &_source_listener, input);
osurface = ecore_wl2_window_surface_get(window);
if (osurface)
{
wl_data_device_start_drag(input->data.device, input->data.source,
osurface, dsurface, input->display->serial);
ecore_wl2_window_cursor_from_name_set(window, "move");
}
}
EAPI Eina_Bool
ecore_wl2_dnd_drag_get(Ecore_Wl2_Input *input, const char *type)
{
char **t;
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(input->drag.source, EINA_FALSE);
wl_array_for_each(t, &input->drag.source->types)
if (!strcmp(type, *t)) break;
if (!*t) return EINA_FALSE;
_selection_data_receive(input->drag.source, type);
return EINA_TRUE;
}
EAPI void
ecore_wl2_dnd_drag_end(Ecore_Wl2_Input *input)
{
Ecore_Wl2_Event_Dnd_End *ev;
EINA_SAFETY_ON_NULL_RETURN(input);
if (input->data.types.data)
{
char **t;
wl_array_for_each(t, &input->data.types)
free(*t);
wl_array_release(&input->data.types);
wl_array_init(&input->data.types);
}
if (input->data.source) wl_data_source_destroy(input->data.source);
input->data.source = NULL;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_End));
if (!ev) return;
if (input->focus.pointer)
ev->win = input->focus.pointer->id;
if (input->focus.keyboard)
ev->source = input->focus.keyboard->id;
if (!ev->win) ev->win = ev->source;
ecore_event_add(ECORE_WL2_EVENT_DND_END, ev, NULL, NULL);
}
EAPI Eina_Bool
ecore_wl2_dnd_selection_owner_has(Ecore_Wl2_Input *input)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
return (input->selection.source != NULL);
}
EAPI Eina_Bool
ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **types)
{
struct wl_data_device_manager *manager;
const char **type;
char **t;
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE);
manager = input->display->wl.data_device_manager;
if (input->data.types.data)
{
wl_array_for_each(t, &input->data.types)
free(*t);
wl_array_release(&input->data.types);
wl_array_init(&input->data.types);
}
input->data.source = NULL;
if (!types[0]) return EINA_FALSE;
input->data.source = wl_data_device_manager_create_data_source(manager);
if (!input->data.source)
{
ERR("Could not create data source: %m");
return EINA_FALSE;
}
for (type = types; *type; type++)
{
if (!*type) continue;
t = wl_array_add(&input->data.types, sizeof(*t));
if (t)
{
*t = strdup(*type);
wl_data_source_offer(input->data.source, *t);
}
}
wl_data_source_add_listener(input->data.source, &_source_listener, input);
wl_data_device_set_selection(input->data.device, input->data.source,
input->display->serial);
return EINA_TRUE;
}
EAPI Eina_Bool
ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input, const char *type)
{
char **t;
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(input->selection.source, EINA_FALSE);
for (t = input->selection.source->types.data; *t; t++)
if (!strcmp(type, *t)) break;
if (!*t) return EINA_FALSE;
_selection_data_receive(input->selection.source, type);
return EINA_TRUE;
}
EAPI Eina_Bool
ecore_wl2_dnd_selection_clear(Ecore_Wl2_Input *input)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(input->data.device, EINA_FALSE);
wl_data_device_set_selection(input->data.device,
NULL, input->display->serial);
return EINA_TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,110 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
static void
_cb_geometry(void *data, struct wl_output *wl_output EINA_UNUSED, int x, int y, int w, int h, int subpixel EINA_UNUSED, const char *make, const char *model, int transform)
{
Ecore_Wl2_Output *output;
output = data;
if (!output) return;
output->mw = w;
output->mh = h;
output->geometry.x = x;
output->geometry.y = y;
output->transform = transform;
eina_stringshare_replace(&output->make, make);
eina_stringshare_replace(&output->model, model);
}
static void
_cb_mode(void *data, struct wl_output *wl_output EINA_UNUSED, unsigned int flags, int w, int h, int refresh EINA_UNUSED)
{
Ecore_Wl2_Output *output;
output = data;
if (!output) return;
if (flags & WL_OUTPUT_MODE_CURRENT)
{
output->geometry.w = w;
output->geometry.h = h;
}
}
static void
_cb_done(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED)
{
/* NB: Use this event to raise any "output (re)configured events" */
}
static void
_cb_scale(void *data EINA_UNUSED, struct wl_output *output EINA_UNUSED, int scale EINA_UNUSED)
{
}
static const struct wl_output_listener _output_listener =
{
_cb_geometry,
_cb_mode,
_cb_done,
_cb_scale
};
void
_ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id)
{
Ecore_Wl2_Output *output;
output = calloc(1, sizeof(Ecore_Wl2_Output));
if (!output) return;
output->display = display;
output->wl_output =
wl_registry_bind(display->wl.registry, id, &wl_output_interface, 2);
display->outputs =
eina_inlist_append(display->outputs, EINA_INLIST_GET(output));
wl_output_add_listener(output->wl_output, &_output_listener, output);
}
void
_ecore_wl2_output_del(Ecore_Wl2_Output *output)
{
Ecore_Wl2_Display *display;
if (!output) return;
display = output->display;
if (output->wl_output) wl_output_destroy(output->wl_output);
if (output->make) eina_stringshare_del(output->make);
if (output->model) eina_stringshare_del(output->model);
display->outputs =
eina_inlist_remove(display->outputs, EINA_INLIST_GET(output));
free(output);
}
EAPI int
ecore_wl2_output_dpi_get(Ecore_Wl2_Output *output)
{
int w, mw;
EINA_SAFETY_ON_NULL_RETURN_VAL(output, 75);
mw = output->mw;
if (mw <= 0) return 75;
w = output->geometry.w;
return (((w * 254) / mw) + 5) / 10;
}

View File

@ -0,0 +1,403 @@
#ifndef _ECORE_WL2_PRIVATE_H
# define _ECORE_WL2_PRIVATE_H
# include <unistd.h>
# include "Ecore_Wl2.h"
# include "Ecore_Input.h"
/* NB: Test if subsurface protocol is part of wayland code, if not then
* include our own copy */
# ifndef WL_SUBSURFACE_ERROR_ENUM
# include "subsurface-client-protocol.h"
# endif
# include "xdg-shell-client-protocol.h"
# define XDG_VERSION 5
extern int _ecore_wl2_log_dom;
# ifdef ECORE_WL2_DEFAULT_LOG_COLOR
# undef ECORE_WL2_DEFAULT_LOG_COLOR
# endif
# define ECORE_WL2_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
# ifdef ERR
# undef ERR
# endif
# define ERR(...) EINA_LOG_DOM_ERR(_ecore_wl2_log_dom, __VA_ARGS__)
# ifdef DBG
# undef DBG
# endif
# define DBG(...) EINA_LOG_DOM_DBG(_ecore_wl2_log_dom, __VA_ARGS__)
# ifdef INF
# undef INF
# endif
# define INF(...) EINA_LOG_DOM_INFO(_ecore_wl2_log_dom, __VA_ARGS__)
# ifdef WRN
# undef WRN
# endif
# define WRN(...) EINA_LOG_DOM_WARN(_ecore_wl2_log_dom, __VA_ARGS__)
# ifdef CRI
# undef CRI
# endif
# define CRI(...) EINA_LOG_DOM_CRIT(_ecore_wl2_log_dom, __VA_ARGS__)
struct _Ecore_Wl2_Display
{
int refs;
char *name;
pid_t pid;
struct
{
struct wl_display *display;
struct wl_registry *registry;
struct wl_compositor *compositor;
struct wl_subcompositor *subcompositor;
struct wl_data_device_manager *data_device_manager;
struct wl_shm *shm;
struct wl_shell *wl_shell;
struct xdg_shell *xdg_shell;
} wl;
uint32_t serial;
struct xkb_context *xkb_context;
Ecore_Idle_Enterer *idle_enterer;
Ecore_Fd_Handler *fd_hdl;
Eina_Hash *globals;
Eina_Inlist *windows;
Eina_Inlist *outputs;
Eina_Inlist *inputs;
Eina_Inlist *seats;
Eina_Bool sync_done : 1;
};
struct _Ecore_Wl2_Subsurface
{
EINA_INLIST;
int x, y;
Ecore_Wl2_Window *parent;
struct
{
struct wl_surface *surface;
struct wl_subsurface *subsurface;
} wl;
Eina_Bool sync : 1;
};
struct _Ecore_Wl2_Window
{
EINA_INLIST;
Ecore_Wl2_Display *display;
Ecore_Wl2_Input *input;
Ecore_Wl2_Window *parent;
int id, rotation, surface_id;
const char *title;
const char *class;
const char *cursor;
struct wl_surface *surface;
struct wl_shell_surface *wl_shell_surface;
struct xdg_surface *xdg_surface;
struct xdg_popup *xdg_popup;
Eina_Rectangle saved;
Eina_Rectangle geometry;
Eina_Rectangle opaque;
Eina_Rectangle input_rect;
Ecore_Wl2_Window_Type type;
Eina_Inlist *subsurfs;
Eina_Bool moving : 1;
Eina_Bool minimized : 1;
Eina_Bool maximized : 1;
Eina_Bool fullscreen : 1;
Eina_Bool focused : 1;
Eina_Bool resizing : 1;
Eina_Bool alpha : 1;
Eina_Bool transparent : 1;
};
struct _Ecore_Wl2_Output
{
EINA_INLIST;
Ecore_Wl2_Display *display;
struct wl_output *wl_output;
int mw, mh, transform;
const char *make, *model;
Eina_Rectangle geometry;
};
typedef struct _Ecore_Wl2_Dnd_Source
{
Ecore_Wl2_Input *input;
int refcount, fd, x, y;
struct wl_data_offer *offer;
struct wl_array types;
} Ecore_Wl2_Dnd_Source;
/** TODO: Refactor ALL Input code :(
*
* wl_seat is a GROUP of Input Devices (such as):
* keyboards, pointers, touch devices
*/
struct _Ecore_Wl2_Pointer
{
EINA_INLIST;
Ecore_Wl2_Seat *seat;
double sx, sy;
unsigned int button;
unsigned int enter_serial;
struct
{
const char *name, *theme_name;
unsigned int index, size;
struct wl_cursor *wl_cursor;
struct wl_cursor_theme *theme;
struct wl_surface *surface;
struct wl_callback *frame_cb;
Ecore_Timer *timer;
} cursor;
struct
{
unsigned int button, count, timestamp;
Ecore_Wl2_Window *window;
} grab;
Ecore_Wl2_Window *focus;
Eina_List *resources;
};
struct _Ecore_Wl2_Keyboard
{
EINA_INLIST;
Ecore_Wl2_Seat *seat;
unsigned int modifiers;
struct
{
struct xkb_keymap *keymap;
struct xkb_state *state;
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
xkb_mod_mask_t win_mask;
xkb_mod_mask_t scroll_mask;
xkb_mod_mask_t num_mask;
xkb_mod_mask_t caps_mask;
xkb_mod_mask_t altgr_mask;
unsigned int mods_depressed;
unsigned int mods_latched;
unsigned int mods_locked;
unsigned int mods_group;
} xkb;
struct
{
Ecore_Timer *tmr;
unsigned int sym, key, time;
double rate, delay;
Eina_Bool enabled : 1;
} repeat;
struct
{
unsigned int button, count, timestamp;
Ecore_Wl2_Window *window;
} grab;
Ecore_Wl2_Window *focus;
Eina_List *resources;
};
struct _Ecore_Wl2_Touch
{
EINA_INLIST;
struct
{
unsigned int button, count, timestamp;
Ecore_Wl2_Window *window;
} grab;
};
struct _Ecore_Wl2_Seat
{
EINA_INLIST;
uint32_t id;
uint32_t version;
const char *name;
struct wl_global *global;
const struct wl_seat_interface *implementation;
struct
{
struct wl_global *global;
struct wl_resource *resource;
} im;
Ecore_Wl2_Bind_Cb bind_cb;
Ecore_Wl2_Unbind_Cb unbind_cb;
Ecore_Wl2_Pointer *pointer;
int pointer_count;
Ecore_Wl2_Keyboard *keyboard;
int keyboard_count;
Ecore_Wl2_Touch *touch;
int touch_count;
Eina_List *resources;
};
struct _Ecore_Wl2_Input
{
EINA_INLIST;
Ecore_Wl2_Display *display;
unsigned int timestamp;
struct
{
struct wl_seat *seat;
struct wl_pointer *pointer;
struct wl_keyboard *keyboard;
struct wl_touch *touch;
} wl;
struct
{
struct wl_data_device *device;
struct wl_data_source *source;
struct wl_array types;
} data;
struct
{
const char *name, *theme_name;
unsigned int index, size;
struct wl_cursor *wl_cursor;
struct wl_cursor_theme *theme;
struct wl_surface *surface;
struct wl_callback *frame_cb;
Ecore_Timer *timer;
} cursor;
struct
{
double sx, sy;
unsigned int button;
unsigned int enter_serial;
} pointer;
struct
{
unsigned int modifiers;
} keyboard;
struct
{
Ecore_Wl2_Window *pointer;
Ecore_Wl2_Window *keyboard;
Ecore_Wl2_Window *touch;
} focus;
struct
{
unsigned int button, count, timestamp;
Ecore_Wl2_Window *window;
} grab;
struct
{
struct xkb_keymap *keymap;
struct xkb_state *state;
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
xkb_mod_mask_t win_mask;
xkb_mod_mask_t scroll_mask;
xkb_mod_mask_t num_mask;
xkb_mod_mask_t caps_mask;
xkb_mod_mask_t altgr_mask;
unsigned int mods_depressed;
unsigned int mods_latched;
unsigned int mods_locked;
unsigned int mods_group;
} xkb;
struct
{
Ecore_Timer *timer;
unsigned int sym, key, time;
double rate, delay;
Eina_Bool enabled : 1;
} repeat;
struct
{
Ecore_Wl2_Dnd_Source *source;
} drag, selection;
unsigned int seat_version;
};
Ecore_Wl2_Window *_ecore_wl2_display_window_surface_find(Ecore_Wl2_Display *display, struct wl_surface *wl_surface);
void _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id);
void _ecore_wl2_output_del(Ecore_Wl2_Output *output);
void _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int version);
void _ecore_wl2_input_del(Ecore_Wl2_Input *input);
void _ecore_wl2_input_ungrab(Ecore_Wl2_Input *input);
void _ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button);
void _ecore_wl2_input_cursor_set(Ecore_Wl2_Input *input, const char *cursor);
void _ecore_wl2_input_cursor_update_stop(Ecore_Wl2_Input *input);
void _ecore_wl2_dnd_add(Ecore_Wl2_Input *input, struct wl_data_offer *offer);
void _ecore_wl2_dnd_enter(Ecore_Wl2_Input *input, struct wl_data_offer *offer, struct wl_surface *surface, int x, int y, unsigned int timestamp);
void _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input);
void _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timestamp);
void _ecore_wl2_dnd_drop(Ecore_Wl2_Input *input);
void _ecore_wl2_dnd_selection(Ecore_Wl2_Input *input, struct wl_data_offer *offer);
void _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source);
void _ecore_wl2_subsurf_free(Ecore_Wl2_Subsurface *subsurf);
#endif

View File

@ -0,0 +1,350 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
static void
_seat_cb_unbind(struct wl_resource *resource)
{
Ecore_Wl2_Seat *seat;
DBG("Seat Unbind");
seat = wl_resource_get_user_data(resource);
if (!seat) return;
seat->resources = eina_list_remove(seat->resources, resource);
if (seat->unbind_cb) seat->unbind_cb(resource);
}
static void
_seat_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
Ecore_Wl2_Seat *seat;
struct wl_resource *res;
seat = data;
seat->id = id;
DBG("Seat Bind");
res = wl_resource_create(client, &wl_seat_interface, version, id);
if (!res)
{
ERR("Failed to create seat resource: %m");
return;
}
seat->resources = eina_list_append(seat->resources, res);
wl_resource_set_implementation(res, seat->implementation, seat,
_seat_cb_unbind);
if (version >= WL_SEAT_NAME_SINCE_VERSION)
wl_seat_send_name(res, seat->name);
if (seat->bind_cb) seat->bind_cb(client, seat, version, id);
}
static void
_pointer_cb_unbind(struct wl_resource *resource)
{
Ecore_Wl2_Pointer *ptr;
DBG("Pointer Unbind");
ptr = wl_resource_get_user_data(resource);
if (!ptr) return;
ptr->resources = eina_list_remove(ptr->resources, resource);
/* wl_pointer_release(); */
}
static Ecore_Wl2_Pointer *
_ecore_wl2_seat_pointer_create(Ecore_Wl2_Seat *seat)
{
Ecore_Wl2_Pointer *ptr;
ptr = calloc(1, sizeof(Ecore_Wl2_Pointer));
if (!ptr) return NULL;
/* FIXME: Init pointer fields */
ptr->seat = seat;
return ptr;
}
static void
_ecore_wl2_seat_pointer_destroy(Ecore_Wl2_Pointer *ptr)
{
/* FIXME: Free pointer fields */
free(ptr);
}
static void
_keyboard_cb_unbind(struct wl_resource *resource)
{
Ecore_Wl2_Keyboard *kbd;
DBG("Keyboard Unbind");
kbd = wl_resource_get_user_data(resource);
if (!kbd) return;
kbd->resources = eina_list_remove(kbd->resources, resource);
/* wl_keyboard_release(); */
}
static Ecore_Wl2_Keyboard *
_ecore_wl2_seat_keyboard_create(Ecore_Wl2_Seat *seat)
{
Ecore_Wl2_Keyboard *kbd;
kbd = calloc(1, sizeof(Ecore_Wl2_Keyboard));
if (!kbd) return NULL;
/* FIXME: Init keyboard fields */
kbd->seat = seat;
return kbd;
}
static void
_ecore_wl2_seat_keyboard_destroy(Ecore_Wl2_Keyboard *kbd)
{
/* FIXME: Free keyboard fields */
free(kbd);
}
EAPI Ecore_Wl2_Seat *
ecore_wl2_seat_create(Ecore_Wl2_Display *display, const char *name, const struct wl_seat_interface *implementation, int version, Ecore_Wl2_Bind_Cb bind_cb, Ecore_Wl2_Unbind_Cb unbind_cb)
{
Ecore_Wl2_Seat *seat;
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
if (!name) name = "default";
EINA_INLIST_FOREACH(display->seats, seat)
{
if (!strcmp(seat->name, name))
return seat;
}
seat = calloc(1, sizeof(Ecore_Wl2_Seat));
if (!seat) return NULL;
seat->version = version;
seat->implementation = implementation;
seat->bind_cb = bind_cb;
seat->unbind_cb = unbind_cb;
eina_stringshare_replace(&seat->name, name);
seat->global =
wl_global_create(display->wl.display, &wl_seat_interface, seat->version,
seat, _seat_cb_bind);
if (!seat->global)
{
ERR("Could not create seat global: %m");
free(seat);
return NULL;
}
return seat;
}
EAPI void
ecore_wl2_seat_destroy(Ecore_Wl2_Seat *seat)
{
EINA_SAFETY_ON_NULL_RETURN(seat);
eina_stringshare_del(seat->name);
if (seat->pointer) _ecore_wl2_seat_pointer_destroy(seat->pointer);
if (seat->keyboard) _ecore_wl2_seat_keyboard_destroy(seat->keyboard);
/* NB: Hmmm, should we iterate and free resources here ?? */
wl_global_destroy(seat->global);
free(seat);
}
EAPI void
ecore_wl2_seat_capabilities_send(Ecore_Wl2_Seat *seat, enum wl_seat_capability caps)
{
Eina_List *l;
struct wl_resource *res;
EINA_SAFETY_ON_NULL_RETURN(seat);
EINA_LIST_FOREACH(seat->resources, l, res)
wl_seat_send_capabilities(res, caps);
}
EAPI void
ecore_wl2_seat_pointer_release(Ecore_Wl2_Seat *seat)
{
enum wl_seat_capability caps = 0;
EINA_SAFETY_ON_NULL_RETURN(seat);
seat->pointer_count--;
if (seat->pointer_count == 0)
{
if (seat->pointer_count > 0)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (seat->keyboard_count > 0)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
if (seat->touch_count > 0)
caps |= WL_SEAT_CAPABILITY_TOUCH;
ecore_wl2_seat_capabilities_send(seat, caps);
}
}
EAPI Ecore_Wl2_Pointer *
ecore_wl2_pointer_get(Ecore_Wl2_Seat *seat)
{
enum wl_seat_capability caps = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
if (seat->pointer_count > 0)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (seat->keyboard_count > 0)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
if (seat->touch_count > 0)
caps |= WL_SEAT_CAPABILITY_TOUCH;
if (seat->pointer)
{
seat->pointer_count += 1;
if (seat->pointer_count == 1)
{
caps |= WL_SEAT_CAPABILITY_POINTER;
ecore_wl2_seat_capabilities_send(seat, caps);
}
return seat->pointer;
}
seat->pointer = _ecore_wl2_seat_pointer_create(seat);
seat->pointer_count = 1;
caps |= WL_SEAT_CAPABILITY_POINTER;
ecore_wl2_seat_capabilities_send(seat, caps);
return seat->pointer;
}
EAPI Eina_Bool
ecore_wl2_pointer_resource_create(Ecore_Wl2_Pointer *ptr, struct wl_client *client, const struct wl_pointer_interface *implementation, int version, uint32_t id)
{
struct wl_resource *res;
EINA_SAFETY_ON_NULL_RETURN_VAL(ptr, EINA_FALSE);
res = wl_resource_create(client, &wl_pointer_interface, version, id);
if (!res)
{
ERR("Could not create pointer resource: %m");
wl_client_post_no_memory(client);
return EINA_FALSE;
}
wl_resource_set_implementation(res, implementation, ptr, _pointer_cb_unbind);
ptr->resources = eina_list_append(ptr->resources, res);
/* FIXME: Hmmm, should we sent a pointer_enter to ptr->focus'd surface
* here like weston does ? */
return EINA_TRUE;
}
EAPI Ecore_Wl2_Keyboard *
ecore_wl2_keyboard_get(Ecore_Wl2_Seat *seat)
{
enum wl_seat_capability caps = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
if (seat->pointer_count > 0)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (seat->keyboard_count > 0)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
if (seat->touch_count > 0)
caps |= WL_SEAT_CAPABILITY_TOUCH;
if (seat->keyboard)
{
seat->keyboard_count += 1;
if (seat->keyboard_count == 1)
{
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
ecore_wl2_seat_capabilities_send(seat, caps);
}
return seat->keyboard;
}
seat->keyboard = _ecore_wl2_seat_keyboard_create(seat);
seat->keyboard_count = 1;
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
ecore_wl2_seat_capabilities_send(seat, caps);
return seat->keyboard;
}
EAPI Eina_Bool
ecore_wl2_keyboard_resource_create(Ecore_Wl2_Keyboard *kbd, struct wl_client *client, const struct wl_keyboard_interface *implementation, int version, uint32_t id)
{
struct wl_resource *res;
EINA_SAFETY_ON_NULL_RETURN_VAL(kbd, EINA_FALSE);
res = wl_resource_create(client, &wl_keyboard_interface, version, id);
if (!res)
{
ERR("Could not create keyboard resource: %m");
wl_client_post_no_memory(client);
return EINA_FALSE;
}
wl_resource_set_implementation(res, implementation, kbd, _keyboard_cb_unbind);
kbd->resources = eina_list_append(kbd->resources, res);
/* FIXME: Hmmm, should we sent a keyboard_enter to kbd->focus'd surface
* here like weston does ? */
return EINA_TRUE;
}
EAPI void
ecore_wl2_keyboard_repeat_info_set(Ecore_Wl2_Keyboard *kbd, double rate, double delay)
{
struct wl_resource *res;
Eina_List *l;
EINA_SAFETY_ON_NULL_RETURN(kbd);
kbd->repeat.rate = rate;
kbd->repeat.delay = delay;
EINA_LIST_FOREACH(kbd->resources, l, res)
{
if (wl_resource_get_version(res) >=
WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION)
wl_keyboard_send_repeat_info(res, rate, delay);
}
}

View File

@ -0,0 +1,177 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
void
_ecore_wl2_subsurf_free(Ecore_Wl2_Subsurface *subsurf)
{
Ecore_Wl2_Window *parent;
if (subsurf->wl.subsurface) wl_subsurface_destroy(subsurf->wl.subsurface);
if (subsurf->wl.surface) wl_surface_destroy(subsurf->wl.surface);
parent = subsurf->parent;
if (parent)
{
parent->subsurfs =
eina_inlist_remove(parent->subsurfs, EINA_INLIST_GET(subsurf));
}
free(subsurf);
}
EAPI Ecore_Wl2_Subsurface *
ecore_wl2_subsurface_new(Ecore_Wl2_Window *window)
{
Ecore_Wl2_Display *display;
Ecore_Wl2_Subsurface *subsurf;
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(window->surface, NULL);
display = window->display;
EINA_SAFETY_ON_NULL_RETURN_VAL(display->wl.compositor, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(display->wl.subcompositor, NULL);
subsurf = calloc(1, sizeof(Ecore_Wl2_Subsurface));
if (!subsurf) return NULL;
subsurf->parent = window;
subsurf->wl.surface = wl_compositor_create_surface(display->wl.compositor);
if (!subsurf->wl.surface)
{
ERR("Failed to create surface: %m");
goto surf_err;
}
subsurf->wl.subsurface =
wl_subcompositor_get_subsurface(display->wl.subcompositor,
subsurf->wl.surface, window->surface);
if (!subsurf->wl.subsurface)
{
ERR("Could not create subsurface: %m");
goto sub_surf_err;
}
window->subsurfs =
eina_inlist_append(window->subsurfs, EINA_INLIST_GET(subsurf));
return subsurf;
sub_surf_err:
wl_surface_destroy(subsurf->wl.surface);
surf_err:
free(subsurf);
return NULL;
}
EAPI void
ecore_wl2_subsurface_del(Ecore_Wl2_Subsurface *subsurface)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
_ecore_wl2_subsurf_free(subsurface);
}
EAPI struct wl_surface *
ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, NULL);
return subsurface->wl.surface;
}
EAPI void
ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.subsurface);
if ((subsurface->x == x) && (subsurface->y == y)) return;
subsurface->x = x;
subsurface->y = y;
wl_subsurface_set_position(subsurface->wl.subsurface, x, y);
}
EAPI void
ecore_wl2_subsurface_position_get(Ecore_Wl2_Subsurface *subsurface, int *x, int *y)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
if (x) *x = subsurface->x;
if (y) *y = subsurface->y;
}
EAPI void
ecore_wl2_subsurface_place_above(Ecore_Wl2_Subsurface *subsurface, struct wl_surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(surface);
wl_subsurface_place_above(subsurface->wl.subsurface, surface);
}
EAPI void
ecore_wl2_subsurface_place_below(Ecore_Wl2_Subsurface *subsurface, struct wl_surface *surface)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(surface);
wl_subsurface_place_below(subsurface->wl.subsurface, surface);
}
EAPI void
ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_Bool sync)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.subsurface);
sync = !!sync;
if (subsurface->sync == sync) return;
subsurface->sync = sync;
if (subsurface->sync)
wl_subsurface_set_sync(subsurface->wl.subsurface);
else
wl_subsurface_set_desync(subsurface->wl.subsurface);
}
EAPI void
ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h)
{
EINA_SAFETY_ON_NULL_RETURN(subsurface);
EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.subsurface);
if ((w > 0) && (h > 0))
{
Ecore_Wl2_Window *parent;
parent = subsurface->parent;
if (parent)
{
struct wl_region *region;
region =
wl_compositor_create_region(parent->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
return;
}
wl_region_add(region, x, y, w, h);
wl_surface_set_opaque_region(subsurface->wl.surface, region);
wl_region_destroy(region);
}
}
else
wl_surface_set_opaque_region(subsurface->wl.surface, NULL);
}

View File

@ -0,0 +1,869 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ecore_wl2_private.h"
static void
_ecore_wl2_window_configure_send(Ecore_Wl2_Window *window, int w, int h, unsigned int edges)
{
Ecore_Wl2_Event_Window_Configure *ev;
ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Configure));
if (!ev) return;
ev->win = window->id;
ev->event_win = window->id;
ev->x = window->geometry.x;
ev->y = window->geometry.y;
ev->w = w;
ev->h = h;
ev->edges = edges;
ecore_event_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL);
}
static void
_wl_shell_surface_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial)
{
wl_shell_surface_pong(shell_surface, serial);
}
static void
_wl_shell_surface_cb_configure(void *data, struct wl_shell_surface *shell_surface EINA_UNUSED, unsigned int edges, int w, int h)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
if ((w <= 0) || (h <= 0)) return;
if ((w > 0) && (h > 0))
_ecore_wl2_window_configure_send(win, w, h, edges);
}
static void
_wl_shell_surface_cb_popup_done(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface EINA_UNUSED)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
_ecore_wl2_input_ungrab(win->input);
}
static const struct wl_shell_surface_listener _wl_shell_surface_listener =
{
_wl_shell_surface_cb_ping,
_wl_shell_surface_cb_configure,
_wl_shell_surface_cb_popup_done
};
static void
_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
_ecore_wl2_input_ungrab(win->input);
}
static const struct xdg_popup_listener _xdg_popup_listener =
{
_xdg_popup_cb_done,
};
static void
_xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, int32_t w, int32_t h, struct wl_array *states, uint32_t serial)
{
Ecore_Wl2_Window *win;
uint32_t *s;
win = data;
if (!win) return;
win->minimized = EINA_FALSE;
win->maximized = EINA_FALSE;
win->fullscreen = EINA_FALSE;
win->focused = EINA_FALSE;
win->resizing = EINA_FALSE;
wl_array_for_each(s, states)
{
switch (*s)
{
case XDG_SURFACE_STATE_MAXIMIZED:
win->maximized = EINA_TRUE;
break;
case XDG_SURFACE_STATE_FULLSCREEN:
win->fullscreen = EINA_TRUE;
break;
case XDG_SURFACE_STATE_RESIZING:
win->resizing = EINA_TRUE;
break;
case XDG_SURFACE_STATE_ACTIVATED:
win->focused = EINA_TRUE;
win->minimized = EINA_FALSE;
default:
break;
}
}
if ((w > 0) && (h > 0))
_ecore_wl2_window_configure_send(win, w, h, 0);
xdg_surface_ack_configure(win->xdg_surface, serial);
}
static void
_xdg_surface_cb_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
ecore_wl2_window_free(win);
}
static const struct xdg_surface_listener _xdg_surface_listener =
{
_xdg_surface_cb_configure,
_xdg_surface_cb_delete,
};
static void
_ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
{
switch (win->type)
{
case ECORE_WL2_WINDOW_TYPE_FULLSCREEN:
if (win->xdg_surface)
xdg_surface_set_fullscreen(win->xdg_surface, NULL);
else if (win->wl_shell_surface)
wl_shell_surface_set_fullscreen(win->wl_shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL);
break;
case ECORE_WL2_WINDOW_TYPE_MAXIMIZED:
if (win->xdg_surface)
xdg_surface_set_maximized(win->xdg_surface);
else if (win->wl_shell_surface)
wl_shell_surface_set_maximized(win->wl_shell_surface, NULL);
break;
case ECORE_WL2_WINDOW_TYPE_TRANSIENT:
if (win->xdg_surface)
xdg_surface_set_parent(win->xdg_surface, win->parent->xdg_surface);
else if (win->wl_shell_surface)
wl_shell_surface_set_transient(win->wl_shell_surface,
win->parent->surface,
win->geometry.x, win->geometry.y, 0);
break;
case ECORE_WL2_WINDOW_TYPE_MENU:
{
Ecore_Wl2_Input *input;
input = win->input;
if ((!input) && (win->parent))
{
input = win->parent->input;
}
if ((!input) || (!input->wl.seat)) return;
if (win->xdg_surface)
{
win->xdg_popup =
xdg_shell_get_xdg_popup(win->display->wl.xdg_shell,
win->surface, win->parent->surface,
input->wl.seat,
win->display->serial,
win->geometry.x, win->geometry.y);
if (!win->xdg_popup)
{
ERR("Could not create xdg popup: %m");
return;
}
xdg_popup_set_user_data(win->xdg_popup, win);
xdg_popup_add_listener(win->xdg_popup,
&_xdg_popup_listener, win);
}
else if (win->wl_shell_surface)
{
wl_shell_surface_set_popup(win->wl_shell_surface,
input->wl.seat,
win->display->serial,
win->parent->surface,
win->geometry.x,
win->geometry.y, 0);
}
}
break;
case ECORE_WL2_WINDOW_TYPE_TOPLEVEL:
if (win->xdg_surface)
xdg_surface_set_parent(win->xdg_surface, NULL);
else if (win->wl_shell_surface)
wl_shell_surface_set_toplevel(win->wl_shell_surface);
break;
default:
break;
}
}
EAPI Ecore_Wl2_Window *
ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x, int y, int w, int h)
{
Ecore_Wl2_Window *win;
static int _win_id = 1;
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
/* try to allocate space for window structure */
win = calloc(1, sizeof(Ecore_Wl2_Window));
if (!win) return NULL;
win->display = display;
win->parent = parent;
win->id = _win_id++;
win->geometry.x = x;
win->geometry.y = y;
win->geometry.w = w;
win->geometry.h = h;
win->opaque.x = x;
win->opaque.y = y;
win->opaque.w = w;
win->opaque.h = h;
win->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
display->windows =
eina_inlist_append(display->windows, EINA_INLIST_GET(win));
return win;
}
EAPI int
ecore_wl2_window_id_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, -1);
return window->id;
}
EAPI struct wl_surface *
ecore_wl2_window_surface_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
if (!window->surface)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window->display->wl.compositor, NULL);
window->surface =
wl_compositor_create_surface(window->display->wl.compositor);
window->surface_id =
wl_proxy_get_id((struct wl_proxy *)window->surface);
}
return window->surface;
}
EAPI int
ecore_wl2_window_surface_id_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, -1);
return window->surface_id;
}
EAPI void
ecore_wl2_window_show(Ecore_Wl2_Window *window)
{
Ecore_Wl2_Display *disp;
EINA_SAFETY_ON_NULL_RETURN(window);
disp = window->display;
if (!window->surface)
{
window->surface =
wl_compositor_create_surface(window->display->wl.compositor);
}
if ((window->type == ECORE_WL2_WINDOW_TYPE_DND) ||
(window->type == ECORE_WL2_WINDOW_TYPE_NONE))
goto type_set;
if ((disp->wl.xdg_shell) && (!window->xdg_surface))
{
window->xdg_surface =
xdg_shell_get_xdg_surface(disp->wl.xdg_shell, window->surface);
if (!window->xdg_surface) goto surf_err;
if (window->title)
xdg_surface_set_title(window->xdg_surface, window->title);
if (window->class)
xdg_surface_set_app_id(window->xdg_surface, window->class);
xdg_surface_set_user_data(window->xdg_surface, window);
xdg_surface_add_listener(window->xdg_surface,
&_xdg_surface_listener, window);
}
else if ((disp->wl.wl_shell) && (!window->wl_shell_surface))
{
window->wl_shell_surface =
wl_shell_get_shell_surface(disp->wl.wl_shell, window->surface);
if (!window->wl_shell_surface) goto surf_err;
if (window->title)
wl_shell_surface_set_title(window->wl_shell_surface, window->title);
if (window->class)
wl_shell_surface_set_class(window->wl_shell_surface, window->class);
wl_shell_surface_add_listener(window->wl_shell_surface,
&_wl_shell_surface_listener, window);
}
type_set:
_ecore_wl2_window_type_set(window);
return;
surf_err:
ERR("Failed to create surface for window: %m");
}
EAPI void
ecore_wl2_window_hide(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface);
window->xdg_surface = NULL;
if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
window->xdg_popup = NULL;
if (window->wl_shell_surface)
wl_shell_surface_destroy(window->wl_shell_surface);
window->wl_shell_surface = NULL;
if (window->surface) wl_surface_destroy(window->surface);
window->surface = NULL;
}
EAPI void
ecore_wl2_window_free(Ecore_Wl2_Window *window)
{
Ecore_Wl2_Display *display;
Ecore_Wl2_Input *input;
Ecore_Wl2_Subsurface *subsurf;
Eina_Inlist *tmp;
EINA_SAFETY_ON_NULL_RETURN(window);
display = window->display;
EINA_INLIST_FOREACH(display->inputs, input)
{
if ((input->focus.pointer) &&
(input->focus.pointer == window))
input->focus.pointer = NULL;
if ((input->focus.keyboard) &&
(input->focus.keyboard == window))
{
input->focus.keyboard = NULL;
ecore_timer_del(input->repeat.timer);
input->repeat.timer = NULL;
}
}
EINA_INLIST_FOREACH_SAFE(window->subsurfs, tmp, subsurf)
_ecore_wl2_subsurf_free(subsurf);
ecore_wl2_window_hide(window);
if (window->title) eina_stringshare_del(window->title);
if (window->class) eina_stringshare_del(window->class);
display->windows =
eina_inlist_remove(display->windows, EINA_INLIST_GET(window));
free(window);
}
EAPI void
ecore_wl2_window_move(Ecore_Wl2_Window *window, int x EINA_UNUSED, int y EINA_UNUSED)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN(window);
input = window->input;
if ((!input) && (window->parent))
{
input = window->parent->input;
}
if ((!input) || (!input->wl.seat)) return;
window->moving = EINA_TRUE;
if (window->xdg_surface)
xdg_surface_move(window->xdg_surface, input->wl.seat,
window->display->serial);
else if (window->wl_shell_surface)
wl_shell_surface_move(window->wl_shell_surface, input->wl.seat,
window->display->serial);
}
EAPI void
ecore_wl2_window_resize(Ecore_Wl2_Window *window, int w EINA_UNUSED, int h EINA_UNUSED, int location)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN(window);
input = window->input;
if ((!input) && (window->parent))
{
input = window->parent->input;
}
if ((!input) || (!input->wl.seat)) return;
if (window->xdg_surface)
xdg_surface_resize(window->xdg_surface, input->wl.seat,
input->display->serial, location);
else if (window->wl_shell_surface)
wl_shell_surface_resize(window->wl_shell_surface, input->wl.seat,
input->display->serial, location);
}
EAPI void
ecore_wl2_window_raise(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->xdg_surface)
{
struct wl_array states;
uint32_t *s;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
_xdg_surface_cb_configure(window, window->xdg_surface,
window->geometry.w, window->geometry.h,
&states, 0);
wl_array_release(&states);
}
else if (window->wl_shell_surface)
wl_shell_surface_set_toplevel(window->wl_shell_surface);
}
EAPI Eina_Bool
ecore_wl2_window_alpha_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->alpha;
}
EAPI void
ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->alpha == alpha) return;
window->alpha = alpha;
if (!window->alpha)
ecore_wl2_window_opaque_region_set(window, window->opaque.x,
window->opaque.y, window->opaque.w,
window->opaque.h);
else
ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
}
EAPI void
ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->transparent == transparent) return;
window->transparent = transparent;
if (!window->transparent)
ecore_wl2_window_opaque_region_set(window, window->opaque.x,
window->opaque.y, window->opaque.w,
window->opaque.h);
else
ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
}
EAPI void
ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
{
struct wl_region *region;
EINA_SAFETY_ON_NULL_RETURN(window);
window->opaque.x = x;
window->opaque.y = y;
window->opaque.w = w;
window->opaque.h = h;
if ((window->transparent) || (window->alpha)) return;
region = wl_compositor_create_region(window->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
return;
}
switch (window->rotation)
{
case 0:
wl_region_add(region, x, y, w, h);
break;
case 180:
wl_region_add(region, x, x + y, w, h);
break;
case 90:
wl_region_add(region, y, x, h, w);
break;
case 270:
wl_region_add(region, x + y, x, h, w);
break;
}
wl_surface_set_opaque_region(window->surface, region);
wl_region_destroy(region);
}
EAPI void
ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
{
struct wl_region *region;
EINA_SAFETY_ON_NULL_RETURN(window);
window->input_rect.x = x;
window->input_rect.y = y;
window->input_rect.w = w;
window->input_rect.h = h;
if (window->type == ECORE_WL2_WINDOW_TYPE_DND) return;
region = wl_compositor_create_region(window->display->wl.compositor);
if (!region)
{
ERR("Failed to create opaque region: %m");
return;
}
switch (window->rotation)
{
case 0:
wl_region_add(region, x, y, w, h);
break;
case 180:
wl_region_add(region, x, x + y, w, h);
break;
case 90:
wl_region_add(region, y, x, h, w);
break;
case 270:
wl_region_add(region, x + y, x, h, w);
break;
}
wl_surface_set_input_region(window->surface, region);
wl_region_destroy(region);
}
EAPI Eina_Bool
ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->maximized;
}
EAPI void
ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->maximized == maximized) return;
if (window->type == ECORE_WL2_WINDOW_TYPE_TOPLEVEL)
{
window->saved = window->geometry;
if (window->xdg_surface)
xdg_surface_set_maximized(window->xdg_surface);
else if (window->wl_shell_surface)
wl_shell_surface_set_maximized(window->wl_shell_surface, NULL);
window->type = ECORE_WL2_WINDOW_TYPE_MAXIMIZED;
}
else if (window->type == ECORE_WL2_WINDOW_TYPE_MAXIMIZED)
{
if (window->xdg_surface)
xdg_surface_unset_maximized(window->xdg_surface);
else if (window->wl_shell_surface)
wl_shell_surface_set_toplevel(window->wl_shell_surface);
window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
_ecore_wl2_window_configure_send(window, window->saved.w,
window->saved.h, 0);
}
window->maximized = maximized;
}
EAPI Eina_Bool
ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->fullscreen;
}
EAPI void
ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->fullscreen == fullscreen) return;
if (fullscreen)
{
window->saved = window->geometry;
if (window->xdg_surface)
xdg_surface_set_fullscreen(window->xdg_surface, NULL);
else if (window->wl_shell_surface)
wl_shell_surface_set_fullscreen(window->wl_shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL);
window->type = ECORE_WL2_WINDOW_TYPE_FULLSCREEN;
}
else
{
if (window->xdg_surface)
xdg_surface_unset_fullscreen(window->xdg_surface);
else if (window->wl_shell_surface)
wl_shell_surface_set_toplevel(window->wl_shell_surface);
window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
_ecore_wl2_window_configure_send(window, window->saved.w,
window->saved.h, 0);
}
window->fullscreen = fullscreen;
}
EAPI int
ecore_wl2_window_rotation_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, -1);
return window->rotation;
}
EAPI void
ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation)
{
EINA_SAFETY_ON_NULL_RETURN(window);
window->rotation = rotation;
}
EAPI void
ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
{
EINA_SAFETY_ON_NULL_RETURN(window);
eina_stringshare_replace(&window->title, title);
if (!window->title) return;
if (window->xdg_surface)
xdg_surface_set_title(window->xdg_surface, window->title);
else if (window->wl_shell_surface)
wl_shell_surface_set_title(window->wl_shell_surface, window->title);
}
EAPI void
ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
{
EINA_SAFETY_ON_NULL_RETURN(window);
eina_stringshare_replace(&window->class, clas);
if (!window->class) return;
if (window->xdg_surface)
xdg_surface_set_app_id(window->xdg_surface, window->class);
else if (window->wl_shell_surface)
wl_shell_surface_set_class(window->wl_shell_surface, window->class);
}
EAPI void
ecore_wl2_window_geometry_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (x) *x = window->geometry.x;
if (y) *y = window->geometry.y;
if (w) *w = window->geometry.w;
if (h) *h = window->geometry.h;
}
EAPI void
ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if ((window->geometry.x == x) && (window->geometry.y == y) &&
(window->geometry.w == w) && (window->geometry.h == h))
return;
window->geometry.x = x;
window->geometry.y = y;
window->geometry.w = w;
window->geometry.h = h;
if (window->xdg_surface)
xdg_surface_set_window_geometry(window->xdg_surface, x, y, w, h);
}
EAPI Eina_Bool
ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->minimized;
}
EAPI void
ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if (window->minimized == iconified) return;
if (iconified)
{
if (window->xdg_surface)
xdg_surface_set_minimized(window->xdg_surface);
}
else
{
if (window->xdg_surface)
{
struct wl_array states;
uint32_t *s;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
_xdg_surface_cb_configure(window, window->xdg_surface,
window->geometry.w, window->geometry.h,
&states, 0);
wl_array_release(&states);
}
window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
}
window->minimized = iconified;
}
EAPI void
ecore_wl2_window_pointer_xy_get(Ecore_Wl2_Window *window, int *x, int *y)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN(window);
if (x) *x = 0;
if (y) *y = 0;
input = ecore_wl2_window_input_get(window);
if (!input) return;
if (x) *x = input->pointer.sx;
if (y) *y = input->pointer.sy;
}
EAPI void
ecore_wl2_window_pointer_set(Ecore_Wl2_Window *window, struct wl_surface *surface, int hot_x, int hot_y)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN(window);
input = ecore_wl2_window_input_get(window);
if (!input) return;
_ecore_wl2_input_cursor_update_stop(input);
if (input->wl.pointer)
wl_pointer_set_cursor(input->wl.pointer,
input->pointer.enter_serial,
surface, hot_x, hot_y);
}
EAPI void
ecore_wl2_window_cursor_from_name_set(Ecore_Wl2_Window *window, const char *cursor)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN(window);
eina_stringshare_replace(&window->cursor, cursor);
input = ecore_wl2_window_input_get(window);
if (!input) return;
_ecore_wl2_input_cursor_update_stop(input);
_ecore_wl2_input_cursor_set(input, cursor);
}
EAPI void
ecore_wl2_window_type_set(Ecore_Wl2_Window *window, Ecore_Wl2_Window_Type type)
{
EINA_SAFETY_ON_NULL_RETURN(window);
window->type = type;
}
EAPI Ecore_Wl2_Input *
ecore_wl2_window_input_get(Ecore_Wl2_Window *window)
{
Ecore_Wl2_Input *input;
EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(window->display, NULL);
if (window->input) return window->input;
EINA_INLIST_FOREACH(window->display->inputs, input)
{
if (input->focus.pointer) return input;
}
return NULL;
}

View File

@ -0,0 +1,167 @@
/*
* Copyright © 2012-2013 Collabora, Ltd.
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef SUBSURFACE_CLIENT_PROTOCOL_H
#define SUBSURFACE_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct wl_subcompositor;
struct wl_subsurface;
extern const struct wl_interface wl_subcompositor_interface;
extern const struct wl_interface wl_subsurface_interface;
#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
#define WL_SUBCOMPOSITOR_ERROR_ENUM
enum wl_subcompositor_error {
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
};
#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
#define WL_SUBCOMPOSITOR_DESTROY 0
#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
static inline void
wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
}
static inline void *
wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
}
static inline void
wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
{
wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
WL_SUBCOMPOSITOR_DESTROY);
wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
}
static inline struct wl_subsurface *
wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
{
struct wl_proxy *id;
id = wl_proxy_create((struct wl_proxy *) wl_subcompositor,
&wl_subsurface_interface);
if (!id)
return NULL;
wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent);
return (struct wl_subsurface *) id;
}
#ifndef WL_SUBSURFACE_ERROR_ENUM
#define WL_SUBSURFACE_ERROR_ENUM
enum wl_subsurface_error {
WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
};
#endif /* WL_SUBSURFACE_ERROR_ENUM */
#define WL_SUBSURFACE_DESTROY 0
#define WL_SUBSURFACE_SET_POSITION 1
#define WL_SUBSURFACE_PLACE_ABOVE 2
#define WL_SUBSURFACE_PLACE_BELOW 3
#define WL_SUBSURFACE_SET_SYNC 4
#define WL_SUBSURFACE_SET_DESYNC 5
static inline void
wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
}
static inline void *
wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
}
static inline void
wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_DESTROY);
wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
}
static inline void
wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_SET_POSITION, x, y);
}
static inline void
wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_PLACE_ABOVE, sibling);
}
static inline void
wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_PLACE_BELOW, sibling);
}
static inline void
wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_SET_SYNC);
}
static inline void
wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
{
wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
WL_SUBSURFACE_SET_DESYNC);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,70 @@
/*
* Copyright © 2012-2013 Collabora, Ltd.
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_subsurface_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface wl_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
&wl_subsurface_interface,
&wl_surface_interface,
&wl_surface_interface,
&wl_surface_interface,
&wl_surface_interface,
};
static const struct wl_message wl_subcompositor_requests[] = {
{ "destroy", "", types + 0 },
{ "get_subsurface", "noo", types + 2 },
};
WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
"wl_subcompositor", 1,
2, wl_subcompositor_requests,
0, NULL,
};
static const struct wl_message wl_subsurface_requests[] = {
{ "destroy", "", types + 0 },
{ "set_position", "ii", types + 0 },
{ "place_above", "o", types + 5 },
{ "place_below", "o", types + 6 },
{ "set_sync", "", types + 0 },
{ "set_desync", "", types + 0 },
};
WL_EXPORT const struct wl_interface wl_subsurface_interface = {
"wl_subsurface", 1,
6, wl_subsurface_requests,
0, NULL,
};

View File

@ -0,0 +1,561 @@
/*
* Copyright © 2008-2013 Kristian Høgsberg
* Copyright © 2013 Rafael Antognolli
* Copyright © 2013 Jasper St. Pierre
* Copyright © 2010-2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#ifndef XDG_SHELL_CLIENT_PROTOCOL_H
#define XDG_SHELL_CLIENT_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
struct wl_client;
struct wl_resource;
struct wl_output;
struct wl_seat;
struct wl_surface;
struct xdg_popup;
struct xdg_shell;
struct xdg_surface;
extern const struct wl_interface xdg_shell_interface;
extern const struct wl_interface xdg_surface_interface;
extern const struct wl_interface xdg_popup_interface;
#ifndef XDG_SHELL_VERSION_ENUM
#define XDG_SHELL_VERSION_ENUM
/**
* xdg_shell_version - latest protocol version
* @XDG_SHELL_VERSION_CURRENT: Always the latest version
*
* The 'current' member of this enum gives the version of the protocol.
* Implementations can compare this to the version they implement using
* static_assert to ensure the protocol and implementation versions match.
*/
enum xdg_shell_version {
XDG_SHELL_VERSION_CURRENT = 5,
};
#endif /* XDG_SHELL_VERSION_ENUM */
#ifndef XDG_SHELL_ERROR_ENUM
#define XDG_SHELL_ERROR_ENUM
enum xdg_shell_error {
XDG_SHELL_ERROR_ROLE = 0,
XDG_SHELL_ERROR_DEFUNCT_SURFACES = 1,
XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP = 2,
XDG_SHELL_ERROR_INVALID_POPUP_PARENT = 3,
};
#endif /* XDG_SHELL_ERROR_ENUM */
/**
* xdg_shell - create desktop-style surfaces
* @ping: check if the client is alive
*
* xdg_shell allows clients to turn a wl_surface into a "real window"
* which can be dragged, resized, stacked, and moved around by the user.
* Everything about this interface is suited towards traditional desktop
* environments.
*/
struct xdg_shell_listener {
/**
* ping - check if the client is alive
* @serial: pass this to the pong request
*
* The ping event asks the client if it's still alive. Pass the
* serial specified in the event back to the compositor by sending
* a "pong" request back with the specified serial.
*
* Compositors can use this to determine if the client is still
* alive. It's unspecified what will happen if the client doesn't
* respond to the ping request, or in what timeframe. Clients
* should try to respond in a reasonable amount of time.
*
* A compositor is free to ping in any way it wants, but a client
* must always respond to any xdg_shell object it created.
*/
void (*ping)(void *data,
struct xdg_shell *xdg_shell,
uint32_t serial);
};
static inline int
xdg_shell_add_listener(struct xdg_shell *xdg_shell,
const struct xdg_shell_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_shell,
(void (**)(void)) listener, data);
}
#define XDG_SHELL_DESTROY 0
#define XDG_SHELL_USE_UNSTABLE_VERSION 1
#define XDG_SHELL_GET_XDG_SURFACE 2
#define XDG_SHELL_GET_XDG_POPUP 3
#define XDG_SHELL_PONG 4
static inline void
xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data);
}
static inline void *
xdg_shell_get_user_data(struct xdg_shell *xdg_shell)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell);
}
static inline void
xdg_shell_destroy(struct xdg_shell *xdg_shell)
{
wl_proxy_marshal((struct wl_proxy *) xdg_shell,
XDG_SHELL_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_shell);
}
static inline void
xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version)
{
wl_proxy_marshal((struct wl_proxy *) xdg_shell,
XDG_SHELL_USE_UNSTABLE_VERSION, version);
}
static inline struct xdg_surface *
xdg_shell_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface);
return (struct xdg_surface *) id;
}
static inline struct xdg_popup *
xdg_shell_get_xdg_popup(struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y);
return (struct xdg_popup *) id;
}
static inline void
xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial)
{
wl_proxy_marshal((struct wl_proxy *) xdg_shell,
XDG_SHELL_PONG, serial);
}
#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM
#define XDG_SURFACE_RESIZE_EDGE_ENUM
/**
* xdg_surface_resize_edge - edge values for resizing
* @XDG_SURFACE_RESIZE_EDGE_NONE: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM: (none)
* @XDG_SURFACE_RESIZE_EDGE_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT: (none)
* @XDG_SURFACE_RESIZE_EDGE_RIGHT: (none)
* @XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT: (none)
* @XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT: (none)
*
* These values are used to indicate which edge of a surface is being
* dragged in a resize operation. The server may use this information to
* adapt its behavior, e.g. choose an appropriate cursor image.
*/
enum xdg_surface_resize_edge {
XDG_SURFACE_RESIZE_EDGE_NONE = 0,
XDG_SURFACE_RESIZE_EDGE_TOP = 1,
XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2,
XDG_SURFACE_RESIZE_EDGE_LEFT = 4,
XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5,
XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6,
XDG_SURFACE_RESIZE_EDGE_RIGHT = 8,
XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9,
XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10,
};
#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */
#ifndef XDG_SURFACE_STATE_ENUM
#define XDG_SURFACE_STATE_ENUM
/**
* xdg_surface_state - types of state on the surface
* @XDG_SURFACE_STATE_MAXIMIZED: the surface is maximized
* @XDG_SURFACE_STATE_FULLSCREEN: the surface is fullscreen
* @XDG_SURFACE_STATE_RESIZING: (none)
* @XDG_SURFACE_STATE_ACTIVATED: (none)
*
* The different state values used on the surface. This is designed for
* state values like maximized, fullscreen. It is paired with the configure
* event to ensure that both the client and the compositor setting the
* state can be synchronized.
*
* States set in this way are double-buffered. They will get applied on the
* next commit.
*
* Desktop environments may extend this enum by taking up a range of values
* and documenting the range they chose in this description. They are not
* required to document the values for the range that they chose. Ideally,
* any good extensions from a desktop environment should make its way into
* standardization into this enum.
*
* The current reserved ranges are:
*
* 0x0000 - 0x0FFF: xdg-shell core values, documented below. 0x1000 -
* 0x1FFF: GNOME
*/
enum xdg_surface_state {
XDG_SURFACE_STATE_MAXIMIZED = 1,
XDG_SURFACE_STATE_FULLSCREEN = 2,
XDG_SURFACE_STATE_RESIZING = 3,
XDG_SURFACE_STATE_ACTIVATED = 4,
};
#endif /* XDG_SURFACE_STATE_ENUM */
/**
* xdg_surface - A desktop window
* @configure: suggest a surface change
* @close: surface wants to be closed
*
* An interface that may be implemented by a wl_surface, for
* implementations that provide a desktop-style user interface.
*
* It provides requests to treat surfaces like windows, allowing to set
* properties like maximized, fullscreen, minimized, and to move and resize
* them, and associate metadata like title and app id.
*
* The client must call wl_surface.commit on the corresponding wl_surface
* for the xdg_surface state to take effect. Prior to committing the new
* state, it can set up initial configuration, such as maximizing or
* setting a window geometry.
*
* Even without attaching a buffer the compositor must respond to initial
* committed configuration, for instance sending a configure event with
* expected window geometry if the client maximized its surface during
* initialization.
*
* For a surface to be mapped by the compositor the client must have
* committed both an xdg_surface state and a buffer.
*/
struct xdg_surface_listener {
/**
* configure - suggest a surface change
* @width: (none)
* @height: (none)
* @states: (none)
* @serial: (none)
*
* The configure event asks the client to resize its surface or
* to change its state.
*
* The width and height arguments specify a hint to the window
* about how its surface should be resized in window geometry
* coordinates. See set_window_geometry.
*
* If the width or height arguments are zero, it means the client
* should decide its own window dimension. This may happen when the
* compositor need to configure the state of the surface but
* doesn't have any information about any previous or expected
* dimension.
*
* The states listed in the event specify how the width/height
* arguments should be interpreted, and possibly how it should be
* drawn.
*
* Clients should arrange their surface for the new size and
* states, and then send a ack_configure request with the serial
* sent in this configure event at some point before committing the
* new surface.
*
* If the client receives multiple configure events before it can
* respond to one, it is free to discard all but the last event it
* received.
*/
void (*configure)(void *data,
struct xdg_surface *xdg_surface,
int32_t width,
int32_t height,
struct wl_array *states,
uint32_t serial);
/**
* close - surface wants to be closed
*
* The close event is sent by the compositor when the user wants
* the surface to be closed. This should be equivalent to the user
* clicking the close button in client-side decorations, if your
* application has any...
*
* This is only a request that the user intends to close your
* window. The client may choose to ignore this request, or show a
* dialog to ask the user to save their data...
*/
void (*close)(void *data,
struct xdg_surface *xdg_surface);
};
static inline int
xdg_surface_add_listener(struct xdg_surface *xdg_surface,
const struct xdg_surface_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_surface,
(void (**)(void)) listener, data);
}
#define XDG_SURFACE_DESTROY 0
#define XDG_SURFACE_SET_PARENT 1
#define XDG_SURFACE_SET_TITLE 2
#define XDG_SURFACE_SET_APP_ID 3
#define XDG_SURFACE_SHOW_WINDOW_MENU 4
#define XDG_SURFACE_MOVE 5
#define XDG_SURFACE_RESIZE 6
#define XDG_SURFACE_ACK_CONFIGURE 7
#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8
#define XDG_SURFACE_SET_MAXIMIZED 9
#define XDG_SURFACE_UNSET_MAXIMIZED 10
#define XDG_SURFACE_SET_FULLSCREEN 11
#define XDG_SURFACE_UNSET_FULLSCREEN 12
#define XDG_SURFACE_SET_MINIMIZED 13
static inline void
xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data);
}
static inline void *
xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface);
}
static inline void
xdg_surface_destroy(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_surface);
}
static inline void
xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_PARENT, parent);
}
static inline void
xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_TITLE, title);
}
static inline void
xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_APP_ID, app_id);
}
static inline void
xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y);
}
static inline void
xdg_surface_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_MOVE, seat, serial);
}
static inline void
xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_RESIZE, seat, serial, edges);
}
static inline void
xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_ACK_CONFIGURE, serial);
}
static inline void
xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height);
}
static inline void
xdg_surface_set_maximized(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_MAXIMIZED);
}
static inline void
xdg_surface_unset_maximized(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_UNSET_MAXIMIZED);
}
static inline void
xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_FULLSCREEN, output);
}
static inline void
xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_UNSET_FULLSCREEN);
}
static inline void
xdg_surface_set_minimized(struct xdg_surface *xdg_surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_surface,
XDG_SURFACE_SET_MINIMIZED);
}
/**
* xdg_popup - short-lived, popup surfaces for menus
* @popup_done: popup interaction is done
*
* A popup surface is a short-lived, temporary surface that can be used
* to implement menus. It takes an explicit grab on the surface that will
* be dismissed when the user dismisses the popup. This can be done by the
* user clicking outside the surface, using the keyboard, or even locking
* the screen through closing the lid or a timeout.
*
* When the popup is dismissed, a popup_done event will be sent out, and at
* the same time the surface will be unmapped. The xdg_popup object is now
* inert and cannot be reactivated, so clients should destroy it.
* Explicitly destroying the xdg_popup object will also dismiss the popup
* and unmap the surface.
*
* Clients will receive events for all their surfaces during this grab
* (which is an "owner-events" grab in X11 parlance). This is done so that
* users can navigate through submenus and other "nested" popup windows
* without having to dismiss the topmost popup.
*
* Clients that want to dismiss the popup when another surface of their own
* is clicked should dismiss the popup using the destroy request.
*
* The parent surface must have either an xdg_surface or xdg_popup role.
*
* Specifying an xdg_popup for the parent means that the popups are nested,
* with this popup now being the topmost popup. Nested popups must be
* destroyed in the reverse order they were created in, e.g. the only popup
* you are allowed to destroy at all times is the topmost one.
*
* If there is an existing popup when creating a new popup, the parent must
* be the current topmost popup.
*
* A parent surface must be mapped before the new popup is mapped.
*
* When compositors choose to dismiss a popup, they will likely dismiss
* every nested popup as well. When a compositor dismisses popups, it will
* follow the same dismissing order as required from the client.
*
* The x and y arguments passed when creating the popup object specify
* where the top left of the popup should be placed, relative to the local
* surface coordinates of the parent surface. See xdg_shell.get_xdg_popup.
*
* The client must call wl_surface.commit on the corresponding wl_surface
* for the xdg_popup state to take effect.
*
* For a surface to be mapped by the compositor the client must have
* committed both the xdg_popup state and a buffer.
*/
struct xdg_popup_listener {
/**
* popup_done - popup interaction is done
*
* The popup_done event is sent out when a popup is dismissed by
* the compositor. The client should destroy the xdg_popup object
* at this point.
*/
void (*popup_done)(void *data,
struct xdg_popup *xdg_popup);
};
static inline int
xdg_popup_add_listener(struct xdg_popup *xdg_popup,
const struct xdg_popup_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_popup,
(void (**)(void)) listener, data);
}
#define XDG_POPUP_DESTROY 0
static inline void
xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data);
}
static inline void *
xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup);
}
static inline void
xdg_popup_destroy(struct xdg_popup *xdg_popup)
{
wl_proxy_marshal((struct wl_proxy *) xdg_popup,
XDG_POPUP_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_popup);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,125 @@
/*
* Copyright © 2008-2013 Kristian Høgsberg
* Copyright © 2013 Rafael Antognolli
* Copyright © 2013 Jasper St. Pierre
* Copyright © 2010-2013 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this
* software and its documentation for any purpose is hereby granted
* without fee, provided that the above copyright notice appear in
* all copies and that both that copyright notice and this permission
* notice appear in supporting documentation, and that the name of
* the copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
extern const struct wl_interface wl_output_interface;
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface xdg_popup_interface;
extern const struct wl_interface xdg_surface_interface;
static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
NULL,
&xdg_surface_interface,
&wl_surface_interface,
&xdg_popup_interface,
&wl_surface_interface,
&wl_surface_interface,
&wl_seat_interface,
NULL,
NULL,
NULL,
&xdg_surface_interface,
&wl_seat_interface,
NULL,
NULL,
NULL,
&wl_seat_interface,
NULL,
&wl_seat_interface,
NULL,
NULL,
&wl_output_interface,
};
static const struct wl_message xdg_shell_requests[] = {
{ "destroy", "", types + 0 },
{ "use_unstable_version", "i", types + 0 },
{ "get_xdg_surface", "no", types + 4 },
{ "get_xdg_popup", "nooouii", types + 6 },
{ "pong", "u", types + 0 },
};
static const struct wl_message xdg_shell_events[] = {
{ "ping", "u", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_shell_interface = {
"xdg_shell", 1,
5, xdg_shell_requests,
1, xdg_shell_events,
};
static const struct wl_message xdg_surface_requests[] = {
{ "destroy", "", types + 0 },
{ "set_parent", "?o", types + 13 },
{ "set_title", "s", types + 0 },
{ "set_app_id", "s", types + 0 },
{ "show_window_menu", "ouii", types + 14 },
{ "move", "ou", types + 18 },
{ "resize", "ouu", types + 20 },
{ "ack_configure", "u", types + 0 },
{ "set_window_geometry", "iiii", types + 0 },
{ "set_maximized", "", types + 0 },
{ "unset_maximized", "", types + 0 },
{ "set_fullscreen", "?o", types + 23 },
{ "unset_fullscreen", "", types + 0 },
{ "set_minimized", "", types + 0 },
};
static const struct wl_message xdg_surface_events[] = {
{ "configure", "iiau", types + 0 },
{ "close", "", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_surface_interface = {
"xdg_surface", 1,
14, xdg_surface_requests,
2, xdg_surface_events,
};
static const struct wl_message xdg_popup_requests[] = {
{ "destroy", "", types + 0 },
};
static const struct wl_message xdg_popup_events[] = {
{ "popup_done", "", types + 0 },
};
WL_EXPORT const struct wl_interface xdg_popup_interface = {
"xdg_popup", 1,
1, xdg_popup_requests,
1, xdg_popup_events,
};

View File

@ -334,6 +334,7 @@ _ecore_key_press(int event,
KeySym sym;
XComposeStatus status;
int val;
int key_len, keyname_len, compose_len;
_ecore_x_last_event_mouse_move = 0;
keyname = XKeysymToString(_ecore_x_XKeycodeToKeysym(xevent->display,
@ -370,14 +371,18 @@ _ecore_key_press(int event,
if (!key)
key = keyname;
e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
(compose ? strlen(compose) : 0) + 3);
key_len = strlen(key);
keyname_len = strlen(keyname);
compose_len = (compose) ? strlen(compose) : 0;
e = calloc(1, sizeof(Ecore_Event_Key) + key_len + keyname_len +
compose_len + 3);
if (!e)
goto on_error;
e->keyname = (char *)(e + 1);
e->key = e->keyname + strlen(keyname) + 1;
e->compose = (compose) ? e->key + strlen(key) + 1 : NULL;
e->key = e->keyname + keyname_len + 1;
e->compose = (compose) ? e->key + key_len + 1 : NULL;
e->string = e->compose;
strcpy((char *)e->keyname, keyname);

View File

@ -113,16 +113,6 @@ typedef Eo Ector_Renderer;
// FIXME: Enable that when we have merged Emile
/* typedef Evas_Colorspace Ector_Colorspace; */
/**
* Raster operations at pixel level
*/
typedef enum _Ector_Rop
{
ECTOR_ROP_BLEND, /**< D = S + D(1 - Sa) */
ECTOR_ROP_COPY, /**< D = S */
ECTOR_ROP_LAST
} Ector_Rop;
/**
* Quality values
*/

View File

@ -13,6 +13,7 @@ typedef Eo Ector_Cairo_Surface;
typedef struct _cairo_t cairo_t;
#include "cairo/ector_cairo_surface.eo.h"
#include "cairo/ector_cairo_software_surface.eo.h"
#include "cairo/ector_renderer_cairo_base.eo.h"
#include "cairo/ector_renderer_cairo_shape.eo.h"
#include "cairo/ector_renderer_cairo_gradient_linear.eo.h"

View File

@ -1,6 +1,8 @@
#ifndef ECTOR_CAIRO_PRIVATE_H_
# define ECTOR_CAIRO_PRIVATE_H_
#include "draw.h"
typedef void cairo_pattern_t;
typedef struct {
@ -58,15 +60,12 @@ _ector_cairo_extent_get(Efl_Gfx_Gradient_Spread s)
if (!Sym) return Error;
static inline void *
_ector_cairo_symbol_get(Eo *obj, const char *name)
_ector_cairo_symbol_get(Ector_Renderer_Generic_Base_Data *base,
const char *name)
{
Eo *parent;
void *sym;
eo_do(obj, parent = eo_parent_get());
if (!parent) return NULL;
eo_do(parent, sym = ector_cairo_surface_symbol_get(name));
eo_do(base->surface, sym = ector_cairo_surface_symbol_get(name));
return sym;
}
@ -74,15 +73,12 @@ extern void (*cairo_pattern_add_color_stop_rgba)(cairo_pattern_t *pattern, doubl
double red, double green, double blue, double alpha);
static inline void
_ector_renderer_cairo_gradient_prepare(Eo *obj,
cairo_pattern_t *pat,
_ector_renderer_cairo_gradient_prepare(cairo_pattern_t *pat,
Ector_Renderer_Generic_Gradient_Data *src,
unsigned int mul_col)
{
unsigned int i;
USE(obj, cairo_pattern_add_color_stop_rgba, );
for (i = 0; i < src->colors_count; i++)
{
int r,g,b,a;

View File

@ -2,15 +2,13 @@
#include "config.h" /* so that EAPI in Evas.h is correctly defined */
#endif
#include <Ector.h>
#include <cairo/Ector_Cairo.h>
#include "Ector_Cairo.h"
#include "ector_private.h"
#include <software/Ector_Software.h>
#include "evas_common_private.h"
#include "evas_private.h"
#include "ector_cairo_software_surface.eo.h"
#define MY_CLASS ECTOR_CAIRO_SOFTWARE_SURFACE_CLASS
#define USE(Obj, Sym, Error) \
if (!Sym) Sym = _ector_cairo_symbol_get(Obj, #Sym); \
if (!Sym) return Error;
@ -49,57 +47,76 @@ typedef struct _Ector_Cairo_Software_Surface_Data Ector_Cairo_Software_Surface_D
struct _Ector_Cairo_Software_Surface_Data
{
cairo_surface_t *surface;
void *pixels;
unsigned int width;
unsigned int height;
Ector_Software_Buffer_Base_Data *base;
};
void
_ector_cairo_software_surface_surface_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd, void *pixels, unsigned int width, unsigned int height)
EOLIAN static Eina_Bool
_ector_cairo_software_surface_ector_generic_buffer_pixels_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd,
void *pixels, int width, int height, int stride,
Efl_Gfx_Colorspace cspace, Eina_Bool writable,
unsigned char l, unsigned char r, unsigned char t, unsigned char b)
{
cairo_t *ctx = NULL;
Eina_Bool ok = EINA_FALSE;
USE(obj, cairo_image_surface_create_for_data, );
USE(obj, cairo_surface_destroy, );
USE(obj, cairo_create, );
USE(obj, cairo_destroy, );
if ((cspace != EFL_GFX_COLORSPACE_ARGB8888) || !writable)
{
ERR("Unsupported surface type!");
return EINA_FALSE;
}
if (pd->surface) cairo_surface_destroy(pd->surface); pd->surface = NULL;
USE(obj, cairo_image_surface_create_for_data, EINA_FALSE);
USE(obj, cairo_surface_destroy, EINA_FALSE);
USE(obj, cairo_create, EINA_FALSE);
USE(obj, cairo_destroy, EINA_FALSE);
pd->pixels = NULL;
pd->width = 0;
pd->height = 0;
if (pd->surface)
cairo_surface_destroy(pd->surface);
pd->surface = NULL;
if (pixels)
eo_do_super(obj, MY_CLASS,
ok = ector_buffer_pixels_set(pixels, width, height, stride,
cspace, writable, l, r, t, b));
if (ok && pixels)
{
pd->surface = cairo_image_surface_create_for_data(pixels,
CAIRO_FORMAT_ARGB32,
width, height, width * sizeof (int));
width, height, pd->base->stride);
if (!pd->surface) goto end;
ctx = cairo_create(pd->surface);
}
pd->pixels = pixels;
pd->width = width;
pd->height = height;
end:
evas_common_cpu_end_opt();
eo_do(obj,
ector_cairo_surface_context_set(ctx),
ector_surface_size_set(pd->width, pd->height));
/* evas_common_cpu_end_opt(); // do we need this? */
eo_do(obj, ector_cairo_surface_context_set(ctx));
return ok;
}
void
_ector_cairo_software_surface_surface_get(Eo *obj EINA_UNUSED, Ector_Cairo_Software_Surface_Data *pd, void **pixels, unsigned int *width, unsigned int *height)
{
if (pixels) *pixels = pd->pixels;
if (width) *width = pd->width;
if (height) *height = pd->height;
if (pixels) *pixels = pd->base->pixels.u8;
if (width) *width = pd->base->generic->w;
if (height) *height = pd->base->generic->h;
}
static Eo_Base *
_ector_cairo_software_surface_eo_base_constructor(Eo *obj, Ector_Cairo_Software_Surface_Data *pd)
{
eo_do_super(obj, MY_CLASS, obj = eo_constructor());
pd->base = eo_data_ref(obj, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
pd->base->generic = eo_data_ref(obj, ECTOR_GENERIC_BUFFER_MIXIN);
pd->base->generic->eo = obj;
return obj;
}
EOLIAN static void
_ector_cairo_software_surface_eo_base_destructor(Eo *obj, Ector_Cairo_Software_Surface_Data *pd)
{
eo_data_unref(obj, pd->base);
eo_do_super(obj, MY_CLASS, eo_destructor());
}
#include "ector_cairo_software_surface.eo.c"

View File

@ -0,0 +1,11 @@
class Ector.Cairo_Software.Surface (Ector.Cairo.Surface, Ector.Software.Buffer.Base)
{
eo_prefix: ector_cairo_software_surface;
legacy_prefix: null;
methods {}
implements {
Ector.Generic.Buffer.pixels_set;
Eo.Base.constructor;
Eo.Base.destructor;
}
}

View File

@ -62,11 +62,15 @@ _ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
const Eo_Class *type)
{
if (type == ECTOR_RENDERER_GENERIC_SHAPE_MIXIN)
return eo_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj);
return eo_add(ECTOR_RENDERER_CAIRO_SHAPE_CLASS, NULL,
ector_renderer_surface_set(obj));
else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN)
return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, obj);
return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, NULL,
ector_renderer_surface_set(obj));
else if (type == ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN)
return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, obj);
return eo_add(ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, NULL,
ector_renderer_surface_set(obj));
ERR("Couldn't find class for type: %s\n", eo_class_name_get(type));
return NULL;
}
@ -82,18 +86,13 @@ static cairo_t *(*cairo_create)(cairo_surface_t *target) = NULL;
static cairo_surface_t *internal = NULL;
static void
_ector_cairo_surface_context_set(Eo *obj,
_ector_cairo_surface_context_set(Eo *obj EINA_UNUSED,
Ector_Cairo_Surface_Data *pd,
cairo_t *ctx)
{
USE(obj, cairo_destroy, );
if (pd->cairo) cairo_destroy(pd->cairo);
if (!ctx)
{
USE(obj, cairo_image_surface_create, );
USE(obj, cairo_create, );
if (!internal) internal = cairo_image_surface_create(0, 1, 1);
ctx = cairo_create(internal);
}
@ -121,7 +120,13 @@ static Eo *
_ector_cairo_surface_eo_base_constructor(Eo *obj,
Ector_Cairo_Surface_Data *pd)
{
obj = eo_do_super_ret(obj, ECTOR_CAIRO_SURFACE_CLASS, obj, eo_constructor());
USE(obj, cairo_destroy, NULL);
USE(obj, cairo_image_surface_create, NULL);
USE(obj, cairo_create, NULL);
eo_do_super(obj, ECTOR_CAIRO_SURFACE_CLASS, obj = eo_constructor());
if (!obj) return NULL;
_cairo_count++;
_ector_cairo_surface_context_set(obj, pd, NULL);
@ -135,8 +140,6 @@ _ector_cairo_surface_eo_base_destructor(Eo *obj EINA_UNUSED,
{
eo_do_super(obj, ECTOR_CAIRO_SURFACE_CLASS, eo_destructor());
if (--_cairo_count) return ;
if (_cairo_so) eina_module_free(_cairo_so);
_cairo_so = NULL;

View File

@ -1,4 +1,4 @@
class Ector.Cairo.Surface (Ector.Generic.Surface)
class Ector.Cairo.Surface (Eo.Base, Ector.Generic.Surface)
{
eo_prefix: ector_cairo_surface;
legacy_prefix: null;

View File

@ -99,16 +99,10 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_prepare(Eo *obj, Ector_Re
{
if (!pd->parent)
{
Eo *parent;
eo_do(obj, parent = eo_parent_get());
if (!parent) return EINA_FALSE;
pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
pd->parent = eo_data_xref(pd->generic->surface, ECTOR_CAIRO_SURFACE_CLASS, obj);
}
if (pd->generic->m)
{
USE(obj, cairo_matrix_init, EINA_FALSE);
if (!pd->m) pd->m = malloc(sizeof (cairo_matrix_t));
cairo_matrix_init(pd->m,
pd->generic->m->xx, pd->generic->m->yx,
@ -125,9 +119,9 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_prepare(Eo *obj, Ector_Re
}
static Eina_Bool
_ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
_ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj EINA_UNUSED,
Ector_Renderer_Cairo_Base_Data *pd,
Ector_Rop op,
Efl_Gfx_Render_Op op,
Eina_Array *clips EINA_UNUSED,
unsigned int mul_col)
{
@ -135,17 +129,12 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
cairo_operator_t cop;
double cx, cy;
USE(obj, cairo_translate, EINA_FALSE);
USE(obj, cairo_set_source_rgba, EINA_FALSE);
USE(obj, cairo_transform, EINA_FALSE);
USE(obj, cairo_set_operator, EINA_FALSE);
switch (op)
{
case ECTOR_ROP_BLEND:
case EFL_GFX_RENDER_OP_BLEND:
cop = CAIRO_OPERATOR_OVER;
break;
case ECTOR_ROP_COPY:
case EFL_GFX_RENDER_OP_COPY:
default:
cop = CAIRO_OPERATOR_SOURCE;
break;
@ -159,11 +148,6 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
cairo_set_operator(pd->parent->cairo, cop);
USE(obj, cairo_new_path, EINA_FALSE);
USE(obj, cairo_rectangle, EINA_FALSE);
USE(obj, cairo_clip, EINA_FALSE);
USE(obj, cairo_device_to_user, EINA_FALSE);
if (clips)
{
int clip_count = eina_array_count(clips);
@ -198,11 +182,30 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
static Eo *
_ector_renderer_cairo_base_eo_base_constructor(Eo *obj, Ector_Renderer_Cairo_Base_Data *pd EINA_UNUSED)
{
obj = eo_do_super_ret(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, obj, eo_constructor());
eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, obj = eo_constructor());
if (!obj) return NULL;
pd->generic = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj);
USE(obj, cairo_matrix_init_identity, NULL);
return obj;
}
static Eo_Base *
_ector_renderer_cairo_base_eo_base_finalize(Eo *obj, Ector_Renderer_Cairo_Base_Data *pd)
{
eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, obj = eo_finalize());
if (!obj) return NULL;
USE(pd->generic, cairo_matrix_init, NULL);
USE(pd->generic, cairo_translate, NULL);
USE(pd->generic, cairo_set_source_rgba, NULL);
USE(pd->generic, cairo_transform, NULL);
USE(pd->generic, cairo_set_operator, NULL);
USE(pd->generic, cairo_new_path, NULL);
USE(pd->generic, cairo_rectangle, NULL);
USE(pd->generic, cairo_clip, NULL);
USE(pd->generic, cairo_device_to_user, NULL);
USE(pd->generic, cairo_matrix_init_identity, NULL);
cairo_matrix_init_identity(&identity);
@ -212,14 +215,14 @@ _ector_renderer_cairo_base_eo_base_constructor(Eo *obj, Ector_Renderer_Cairo_Bas
static void
_ector_renderer_cairo_base_eo_base_destructor(Eo *obj, Ector_Renderer_Cairo_Base_Data *pd)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
eo_data_xunref(base->surface, pd->parent, obj);
eo_data_xunref(obj, pd->generic, obj);
free(pd->m);
eo_do(obj, parent = eo_parent_get());
eo_data_xunref(parent, pd->parent, obj);
eo_data_xunref(obj, pd->generic, obj);
eo_do_super(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS, eo_destructor());
}

View File

@ -16,6 +16,7 @@ abstract Ector.Renderer.Cairo.Base (Ector.Renderer.Generic.Base)
Ector.Renderer.Generic.Base.color.set;
Ector.Renderer.Generic.Base.color.get;
Eo.Base.constructor;
Eo.Base.finalize;
Eo.Base.destructor;
}
}

View File

@ -27,21 +27,18 @@ struct _Ector_Renderer_Cairo_Gradient_Linear_Data
};
static cairo_pattern_t *
_ector_renderer_cairo_gradient_linear_prepare(Eo *obj,
_ector_renderer_cairo_gradient_linear_prepare(Eo *obj EINA_UNUSED,
Ector_Renderer_Generic_Gradient_Linear_Data *gld,
Ector_Renderer_Generic_Gradient_Data *gd,
unsigned int mul_col)
{
cairo_pattern_t *pat;
USE(obj, cairo_pattern_create_linear, NULL);
pat = cairo_pattern_create_linear(gld->start.x, gld->start.y,
gld->end.x, gld->end.y);
if (!pat) return NULL;
_ector_renderer_cairo_gradient_prepare(obj, pat, gd, mul_col);
_ector_renderer_cairo_gradient_prepare(pat, gd, mul_col);
USE(obj, cairo_pattern_set_extend, NULL);
cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
return pat;
@ -55,11 +52,10 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_prepare(Eo *ob
if (!pd->parent)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
eo_do(obj, parent = eo_parent_get());
if (!parent) return EINA_FALSE;
pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, obj);
}
return EINA_FALSE;
@ -68,7 +64,7 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_prepare(Eo *ob
static Eina_Bool
_ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_draw(Eo *obj,
Ector_Renderer_Cairo_Gradient_Linear_Data *pd,
Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
Efl_Gfx_Render_Op op, Eina_Array *clips, unsigned int mul_col)
{
Ector_Renderer_Generic_Gradient_Linear_Data *gld;
Ector_Renderer_Generic_Gradient_Data *gd;
@ -84,11 +80,6 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_draw(Eo *obj,
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, ector_renderer_draw(op, clips, mul_col));
USE(obj, cairo_rectangle, EINA_FALSE);
USE(obj, cairo_fill, EINA_FALSE);
USE(obj, cairo_pattern_destroy, EINA_FALSE);
USE(obj, cairo_set_source, EINA_FALSE);
cairo_rectangle(pd->parent->cairo, gld->start.x, gld->start.y,
gld->end.x - gld->start.x,
gld->end.y - gld->start.y);
@ -115,9 +106,6 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_cairo_base_fill(Eo *obj,
pat = _ector_renderer_cairo_gradient_linear_prepare(obj, gld, gd, mul_col);
if (!pat) return EINA_FALSE;
USE(obj, cairo_set_source, EINA_FALSE);
USE(obj, cairo_pattern_destroy, EINA_FALSE);
cairo_set_source(pd->parent->cairo, pat);
cairo_pattern_destroy(pat);
@ -141,19 +129,42 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_bounds_get(Eo
gld->end.y - gld->start.x);
}
void
static Eo_Base *
_ector_renderer_cairo_gradient_linear_eo_base_finalize(Eo *obj, Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED)
{
Ector_Renderer_Generic_Base_Data *base;
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, obj = eo_finalize());
if (!obj) return NULL;
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
USE(base, cairo_set_source, NULL);
USE(base, cairo_pattern_destroy, NULL);
USE(base, cairo_rectangle, NULL);
USE(base, cairo_fill, NULL);
USE(base, cairo_pattern_destroy, NULL);
USE(base, cairo_set_source, NULL);
USE(base, cairo_pattern_set_extend, NULL);
USE(base, cairo_pattern_create_linear, NULL);
USE(base, cairo_pattern_add_color_stop_rgba, NULL);
return obj;
}
static void
_ector_renderer_cairo_gradient_linear_eo_base_destructor(Eo *obj,
Ector_Renderer_Cairo_Gradient_Linear_Data *pd)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
eo_do(obj, parent = eo_parent_get());
eo_data_xunref(parent, pd->parent, obj);
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
eo_data_xunref(base->surface, pd->parent, obj);
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_LINEAR_CLASS, eo_destructor());
}
void
static void
_ector_renderer_cairo_gradient_linear_efl_gfx_gradient_base_stop_set(Eo *obj,
Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED,
const Efl_Gfx_Gradient_Stop *colors,

View File

@ -8,6 +8,7 @@ class Ector.Renderer.Cairo.Gradient_Linear (Ector.Renderer.Cairo.Base, Ector.Ren
Ector.Renderer.Generic.Base.bounds_get;
Ector.Renderer.Generic.Base.crc.get;
Ector.Renderer.Cairo.Base.fill;
Eo.Base.finalize;
Eo.Base.destructor;
Efl.Gfx.Gradient.Base.stop.set;
}

View File

@ -38,33 +38,29 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *ob
if (!pd->parent)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
eo_do(obj, parent = eo_parent_get());
if (!parent) return EINA_FALSE;
pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, obj);
}
return EINA_FALSE;
}
static cairo_pattern_t *
_ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
_ector_renderer_cairo_gradient_radial_prepare(Eo *obj EINA_UNUSED,
Ector_Renderer_Generic_Gradient_Radial_Data *grd,
Ector_Renderer_Generic_Gradient_Data *gd,
unsigned int mul_col)
{
cairo_pattern_t *pat;
USE(obj, cairo_pattern_create_radial, NULL);
pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0,
grd->radial.x, grd->radial.y, grd->radius);
if (!pat) return NULL;
_ector_renderer_cairo_gradient_prepare(obj, pat, gd, mul_col);
_ector_renderer_cairo_gradient_prepare(pat, gd, mul_col);
USE(obj, cairo_pattern_set_extend, NULL);
cairo_pattern_set_extend(pat, _ector_cairo_extent_get(gd->s));
return pat;
@ -72,7 +68,7 @@ _ector_renderer_cairo_gradient_radial_prepare(Eo *obj,
// Clearly duplicated and should be in a common place...
static Eina_Bool
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Efl_Gfx_Render_Op op, Eina_Array *clips, unsigned int mul_col)
{
Ector_Renderer_Generic_Gradient_Radial_Data *grd;
Ector_Renderer_Generic_Gradient_Data *gd;
@ -88,11 +84,6 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj,
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_draw(op, clips, mul_col));
USE(obj, cairo_arc, EINA_FALSE);
USE(obj, cairo_fill, EINA_FALSE);
USE(obj, cairo_set_source, EINA_FALSE);
USE(obj, cairo_pattern_destroy, EINA_FALSE);
cairo_arc(pd->parent->cairo,
grd->radial.x, grd->radial.y,
grd->radius,
@ -121,9 +112,6 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_cairo_base_fill(Eo *obj,
pat = _ector_renderer_cairo_gradient_radial_prepare(obj, grd, gd, mul_col);
if (!pat) return EINA_FALSE;
USE(obj, cairo_set_source, EINA_FALSE);
USE(obj, cairo_pattern_destroy, EINA_FALSE);
cairo_set_source(pd->parent->cairo, pat);
cairo_pattern_destroy(pat);
@ -146,19 +134,41 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_bounds_get(Eo
gld->radius * 2, gld->radius * 2);
}
void
static Eo_Base *
_ector_renderer_cairo_gradient_radial_eo_base_finalize(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED)
{
Ector_Renderer_Generic_Base_Data *base;
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, obj = eo_finalize());
if (!obj) return NULL;
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
USE(base, cairo_set_source, NULL);
USE(base, cairo_pattern_destroy, NULL);
USE(base, cairo_arc, NULL);
USE(base, cairo_fill, NULL);
USE(base, cairo_set_source, NULL);
USE(base, cairo_pattern_destroy, NULL);
USE(base, cairo_pattern_set_extend, NULL);
USE(base, cairo_pattern_create_radial, NULL);
return obj;
}
static void
_ector_renderer_cairo_gradient_radial_eo_base_destructor(Eo *obj,
Ector_Renderer_Cairo_Gradient_Radial_Data *pd)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
eo_do(obj, parent = eo_parent_get());
eo_data_xunref(parent, pd->parent, obj);
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
eo_data_xunref(base->surface, pd->parent, obj);
eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, eo_destructor());
}
void
static void
_ector_renderer_cairo_gradient_radial_efl_gfx_gradient_base_stop_set(Eo *obj,
Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED,
const Efl_Gfx_Gradient_Stop *colors,

View File

@ -9,6 +9,7 @@ class Ector.Renderer.Cairo.Gradient_Radial (Ector.Renderer.Cairo.Base, Ector.Ren
Ector.Renderer.Generic.Base.crc.get;
Ector.Renderer.Cairo.Base.fill;
Eo.Base.destructor;
Eo.Base.finalize;
Efl.Gfx.Gradient.Base.stop.set;
}
}

View File

@ -26,6 +26,11 @@ typedef enum _cairo_line_join {
CAIRO_LINE_JOIN_BEVEL
} cairo_line_join_t;
typedef enum _cairo_fill_rule {
CAIRO_FILL_RULE_WINDING,
CAIRO_FILL_RULE_EVEN_ODD
} cairo_fill_rule_t;
static void (*cairo_move_to)(cairo_t *cr, double x, double y) = NULL;
static void (*cairo_line_to)(cairo_t *cr, double x, double y) = NULL;
static void (*cairo_curve_to)(cairo_t *cr,
@ -56,23 +61,25 @@ static void (*cairo_save)(cairo_t *cr) = NULL;
static void (*cairo_restore)(cairo_t *cr) = NULL;
static void (*cairo_set_dash) (cairo_t *cr, const double *dashes, int num_dashes, double offset) = NULL;
static void (*cairo_set_fill_rule) (cairo_t *cr, cairo_fill_rule_t fill_rule);
typedef struct _Ector_Renderer_Cairo_Shape_Data Ector_Renderer_Cairo_Shape_Data;
struct _Ector_Renderer_Cairo_Shape_Data
{
Efl_Gfx_Shape_Public *public_shape;
Ector_Cairo_Surface_Data *parent;
Ector_Renderer_Generic_Shape_Data *shape;
Ector_Renderer_Generic_Base_Data *base;
cairo_path_t *path;
};
static Eina_Bool
_ector_renderer_cairo_shape_path_changed(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
_ector_renderer_cairo_shape_path_changed(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
Ector_Renderer_Cairo_Shape_Data *pd = data;
USE(obj, cairo_path_destroy, EINA_TRUE);
if (pd->path) cairo_path_destroy(pd->path);
pd->path = NULL;
@ -97,19 +104,15 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
// shouldn't that be moved to the cairo base object
if (!pd->parent)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
eo_do(obj, parent = eo_parent_get());
if (!parent) return EINA_FALSE;
pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
if (!pd->parent) return EINA_FALSE;
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
pd->parent = eo_data_xref(base->surface, ECTOR_CAIRO_SURFACE_CLASS, obj);
}
eo_do(obj, efl_gfx_shape_path_get(&cmds, &pts));
if (!pd->path && cmds)
{
USE(obj, cairo_new_path, EINA_FALSE);
cairo_new_path(pd->parent->cairo);
for (; *cmds != EFL_GFX_PATH_COMMAND_TYPE_END; cmds++)
@ -117,34 +120,24 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
switch (*cmds)
{
case EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO:
USE(obj, cairo_move_to, EINA_FALSE);
cairo_move_to(pd->parent->cairo, pts[0], pts[1]);
pts += 2;
break;
case EFL_GFX_PATH_COMMAND_TYPE_LINE_TO:
USE(obj, cairo_line_to, EINA_FALSE);
cairo_line_to(pd->parent->cairo, pts[0], pts[1]);
pts += 2;
break;
case EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO:
USE(obj, cairo_curve_to, EINA_FALSE);
// Be careful, we do have a different order than
// cairo, first is destination point, followed by
// the control point. The opposite of cairo.
cairo_curve_to(pd->parent->cairo,
pts[2], pts[3], pts[4], pts[5], // control points
pts[0], pts[1]); // destination point
pts[0], pts[1], pts[2], pts[3], // control points
pts[4], pts[5]); // destination point
pts += 6;
break;
case EFL_GFX_PATH_COMMAND_TYPE_CLOSE:
USE(obj, cairo_close_path, EINA_FALSE);
cairo_close_path(pd->parent->cairo);
break;
case EFL_GFX_PATH_COMMAND_TYPE_LAST:
@ -153,8 +146,6 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
}
}
USE(obj, cairo_copy_path, EINA_FALSE);
pd->path = cairo_copy_path(pd->parent->cairo);
}
@ -162,78 +153,70 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
}
static Eina_Bool
_ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
_ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd, Efl_Gfx_Render_Op op, Eina_Array *clips, unsigned int mul_col)
{
int r, g, b, a;
unsigned i;
Efl_Gfx_Fill_Rule fill_rule;
if (pd->path == NULL) return EINA_FALSE;
USE(obj, cairo_save, EINA_FALSE);
cairo_save(pd->parent->cairo);
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, ector_renderer_draw(op, clips, mul_col));
USE(obj, cairo_new_path, EINA_FALSE);
USE(obj, cairo_append_path, EINA_FALSE);
cairo_new_path(pd->parent->cairo);
cairo_append_path(pd->parent->cairo, pd->path);
eo_do(obj, fill_rule = efl_gfx_shape_fill_rule_get());
if (fill_rule == EFL_GFX_FILL_RULE_ODD_EVEN)
cairo_set_fill_rule(pd->parent->cairo, CAIRO_FILL_RULE_EVEN_ODD);
else
cairo_set_fill_rule(pd->parent->cairo, CAIRO_FILL_RULE_WINDING);
if (pd->shape->fill)
eo_do(pd->shape->fill, ector_renderer_cairo_base_fill(mul_col));
if (pd->shape->stroke.fill || pd->shape->stroke.color.a > 0)
if (pd->shape->stroke.fill || pd->public_shape->stroke.color.a > 0)
{
USE(obj, cairo_fill_preserve, EINA_FALSE);
USE(obj, cairo_set_source_rgba, EINA_FALSE);
USE(obj, cairo_stroke, EINA_FALSE);
USE(obj, cairo_set_line_width, EINA_FALSE);
USE(obj, cairo_set_line_cap, EINA_FALSE);
USE(obj, cairo_set_line_join, EINA_FALSE);
cairo_fill_preserve(pd->parent->cairo);
if (pd->shape->stroke.fill)
eo_do(pd->shape->stroke.fill, ector_renderer_cairo_base_fill(mul_col));
else
{
r = (((pd->shape->stroke.color.r * R_VAL(&mul_col)) + 0xff) >> 8);
g = (((pd->shape->stroke.color.g * G_VAL(&mul_col)) + 0xff) >> 8);
b = (((pd->shape->stroke.color.b * B_VAL(&mul_col)) + 0xff) >> 8);
a = (((pd->shape->stroke.color.a * A_VAL(&mul_col)) + 0xff) >> 8);
r = (((pd->public_shape->stroke.color.r * R_VAL(&mul_col)) + 0xff) >> 8);
g = (((pd->public_shape->stroke.color.g * G_VAL(&mul_col)) + 0xff) >> 8);
b = (((pd->public_shape->stroke.color.b * B_VAL(&mul_col)) + 0xff) >> 8);
a = (((pd->public_shape->stroke.color.a * A_VAL(&mul_col)) + 0xff) >> 8);
ector_color_argb_unpremul(a, &r, &g, &b);
cairo_set_source_rgba(pd->parent->cairo, r/255.0, g/255.0, b/255.0, a/255.0);
if (pd->shape->stroke.dash)
if (pd->public_shape->stroke.dash)
{
double *dashinfo;
USE(obj, cairo_set_dash, EINA_FALSE);
dashinfo = (double *) malloc(2 * pd->shape->stroke.dash_length * sizeof(double));
for (i = 0; i < pd->shape->stroke.dash_length; i++)
dashinfo = (double *) malloc(2 * pd->public_shape->stroke.dash_length * sizeof(double));
for (i = 0; i < pd->public_shape->stroke.dash_length; i++)
{
dashinfo[i*2] = pd->shape->stroke.dash[i].length;
dashinfo[i*2 + 1] = pd->shape->stroke.dash[i].gap;
dashinfo[i*2] = pd->public_shape->stroke.dash[i].length;
dashinfo[i*2 + 1] = pd->public_shape->stroke.dash[i].gap;
}
cairo_set_dash(pd->parent->cairo, dashinfo, pd->shape->stroke.dash_length * 2, 0);
cairo_set_dash(pd->parent->cairo, dashinfo, pd->public_shape->stroke.dash_length * 2, 0);
free(dashinfo);
}
}
// Set dash, cap and join
cairo_set_line_width(pd->parent->cairo, (pd->shape->stroke.width * pd->shape->stroke.scale * 2));
cairo_set_line_cap(pd->parent->cairo, (cairo_line_cap_t) pd->shape->stroke.cap);
cairo_set_line_join(pd->parent->cairo, (cairo_line_join_t) pd->shape->stroke.join);
cairo_set_line_width(pd->parent->cairo, (pd->public_shape->stroke.width * pd->public_shape->stroke.scale * 2));
cairo_set_line_cap(pd->parent->cairo, (cairo_line_cap_t) pd->public_shape->stroke.cap);
cairo_set_line_join(pd->parent->cairo, (cairo_line_join_t) pd->public_shape->stroke.join);
cairo_stroke(pd->parent->cairo);
}
else
{
USE(obj, cairo_fill, EINA_FALSE);
cairo_fill(pd->parent->cairo);
}
USE(obj, cairo_restore, EINA_FALSE);
cairo_restore(pd->parent->cairo);
return EINA_TRUE;
}
@ -267,33 +250,66 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_bounds_get(Eo *obj,
Eo *
_ector_renderer_cairo_shape_eo_base_constructor(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd)
{
obj = eo_do_super_ret(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj, eo_constructor());
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj = eo_constructor());
if (!obj) return NULL;
pd->public_shape = eo_data_xref(obj, EFL_GFX_SHAPE_MIXIN, obj);
pd->shape = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_SHAPE_MIXIN, obj);
pd->base = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj);
eo_do(obj,
eo_event_callback_add(EFL_GFX_PATH_CHANGED, _ector_renderer_cairo_shape_path_changed, pd));
return obj;
}
static Eo_Base *
_ector_renderer_cairo_shape_eo_base_finalize(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd)
{
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, obj = eo_finalize());
if (!obj) return NULL;
USE(pd->base, cairo_path_destroy, NULL);
USE(pd->base, cairo_restore, NULL);
USE(pd->base, cairo_fill, NULL);
USE(pd->base, cairo_set_dash, NULL);
USE(pd->base, cairo_fill_preserve, NULL);
USE(pd->base, cairo_set_source_rgba, NULL);
USE(pd->base, cairo_stroke, NULL);
USE(pd->base, cairo_set_line_width, NULL);
USE(pd->base, cairo_set_line_cap, NULL);
USE(pd->base, cairo_set_line_join, NULL);
USE(pd->base, cairo_new_path, NULL);
USE(pd->base, cairo_append_path, NULL);
USE(pd->base, cairo_save, NULL);
USE(pd->base, cairo_copy_path, NULL);
USE(pd->base, cairo_close_path, NULL);
USE(pd->base, cairo_curve_to, NULL);
USE(pd->base, cairo_line_to, NULL);
USE(pd->base, cairo_move_to, NULL);
USE(pd->base, cairo_set_fill_rule, NULL);
return obj;
}
void
_ector_renderer_cairo_shape_eo_base_destructor(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd)
{
Eo *parent;
Ector_Renderer_Generic_Base_Data *base;
//FIXME, As base class destructor can't call destructor of mixin class.
// call explicit API to free shape data.
eo_do(obj, efl_gfx_shape_reset());
eo_do(obj, parent = eo_parent_get());
eo_data_xunref(parent, pd->parent, obj);
base = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS);
eo_data_xunref(base->surface, pd->parent, obj);
eo_data_xunref(obj, pd->shape, obj);
eo_data_xunref(obj, pd->base, obj);
eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, eo_destructor());
USE(obj, cairo_path_destroy, );
if (pd->path) cairo_path_destroy(pd->path);
}
@ -307,17 +323,17 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_crc_get(Eo *obj,
crc = ector_renderer_crc_get());
crc = eina_crc((void*) &pd->shape->stroke.marker, sizeof (pd->shape->stroke.marker), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->shape->stroke.scale, sizeof (pd->shape->stroke.scale) * 3, crc, EINA_FALSE); // scale, width, centered
crc = eina_crc((void*) &pd->shape->stroke.color, sizeof (pd->shape->stroke.color), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->shape->stroke.cap, sizeof (pd->shape->stroke.cap), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->shape->stroke.join, sizeof (pd->shape->stroke.join), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->public_shape->stroke.scale, sizeof (pd->public_shape->stroke.scale) * 3, crc, EINA_FALSE); // scale, width, centered
crc = eina_crc((void*) &pd->public_shape->stroke.color, sizeof (pd->public_shape->stroke.color), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->public_shape->stroke.cap, sizeof (pd->public_shape->stroke.cap), crc, EINA_FALSE);
crc = eina_crc((void*) &pd->public_shape->stroke.join, sizeof (pd->public_shape->stroke.join), crc, EINA_FALSE);
if (pd->shape->fill) crc = _renderer_crc_get(pd->shape->fill, crc);
if (pd->shape->stroke.fill) crc = _renderer_crc_get(pd->shape->stroke.fill, crc);
if (pd->shape->stroke.marker) crc = _renderer_crc_get(pd->shape->stroke.marker, crc);
if (pd->shape->stroke.dash_length)
if (pd->public_shape->stroke.dash_length)
{
crc = eina_crc((void*) pd->shape->stroke.dash, sizeof (Efl_Gfx_Dash) * pd->shape->stroke.dash_length, crc, EINA_FALSE);
crc = eina_crc((void*) pd->public_shape->stroke.dash, sizeof (Efl_Gfx_Dash) * pd->public_shape->stroke.dash_length, crc, EINA_FALSE);
}
return crc;

View File

@ -9,6 +9,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo.Base, Ector.Renderer.Gene
Ector.Renderer.Generic.Base.crc.get;
Ector.Renderer.Cairo.Base.fill;
Eo.Base.constructor;
Eo.Base.finalize;
Eo.Base.destructor;
}
}

View File

@ -0,0 +1,32 @@
#ifndef ECTOR_BUFFER_H
#define ECTOR_BUFFER_H
#include <Ector.h>
#include "ector_generic_buffer.eo.h"
#include "software/ector_software_buffer_base.eo.h"
typedef struct _Ector_Generic_Buffer_Data
{
Eo *eo;
unsigned int w, h;
unsigned char l, r, t, b;
Efl_Gfx_Colorspace cspace;
} Ector_Generic_Buffer_Data;
typedef struct _Ector_Software_Buffer_Base_Data
{
Ector_Generic_Buffer_Data *generic; /* ugly */
union {
unsigned int *u32;
unsigned char *u8;
} pixels;
unsigned int stride;
unsigned int pixel_size; // in bytes
unsigned int map_count;
Eina_Bool writable : 1;
Eina_Bool nofree : 1; // pixel data should not be free()'ed
Eina_Bool span_free : 1;
} Ector_Software_Buffer_Base_Data;
#endif

View File

@ -0,0 +1,40 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#else
# define EFL_BETA_API_SUPPORT
#endif
#include <Eo.h>
#include "ector_private.h"
#include "ector_generic_buffer.eo.h"
EOLIAN static Efl_Gfx_Colorspace
_ector_generic_buffer_cspace_get(Eo *obj EINA_UNUSED, Ector_Generic_Buffer_Data *pd)
{
return pd->cspace;
}
EOLIAN static void
_ector_generic_buffer_border_get(Eo *obj EINA_UNUSED, Ector_Generic_Buffer_Data *pd EINA_UNUSED, int *l, int *r, int *t, int *b)
{
if (l) *l = pd->l;
if (r) *r = pd->r;
if (t) *t = pd->t;
if (b) *b = pd->b;
}
EOLIAN static void
_ector_generic_buffer_size_get(Eo *obj EINA_UNUSED, Ector_Generic_Buffer_Data *pd, int *w, int *h)
{
if (w) *w = pd->w;
if (h) *h = pd->h;
}
EOLIAN static Ector_Buffer_Flag
_ector_generic_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Generic_Buffer_Data *pd EINA_UNUSED)
{
return ECTOR_BUFFER_FLAG_NONE;
}
#include "ector_generic_buffer.eo.c"
#include "ector_generic_surface.eo.c"

View File

@ -0,0 +1,131 @@
enum Ector.Buffer.Flag {
none = 0x00, [[Buffer may not have any backing]]
cpu_readable = 0x01, [[Can be read from the CPU after map. Reading may still be very slow.]]
cpu_writable = 0x02, [[Can be written to by the CPU after map. Writing may still be very slow.]]
renderable = 0x04, [[Can be rendered to, ie CPU memory for SW rendering, or an FBO for GL engine]]
cpu_readable_fast = 0x08, [[Can be read by the CPU at high speed, ie no need for glReadPixels]]
cpu_writable_fast = 0x0A, [[Can be written by the CPU at high speed, ie no need for GPU texture upload]]
uncached = 0x10, [[Backed by uncached memory, ie. slow-ish reads but faster than glReadPixels]]
/* non_coherent = 0x20, [[Memory may be mapped but will not be coherent between GPU and CPU. Call flush or invalidate to synchronize it.]] */
}
enum Ector.Buffer.Access_Flag {
none = 0x0,
read = 0x1,
write = 0x2,
}
mixin Ector.Generic.Buffer
{
[[2D pixel buffer interface for Ector
@since 1.17
]]
eo_prefix: ector_buffer;
legacy_prefix: null;
methods {
@property size {
get {
[[Retrieves the (rectangular) size of the pixel buffer.]]
}
values {
w: int;
h: int;
}
}
@property cspace {
get {}
values {
cspace: Efl.Gfx.Colorspace;
}
}
map {
[[Map a region of this buffer for read or write access by the CPU,
fetch data from the GPU if needed.
]]
params {
@out offset: int; [[Byte offset to the first requested pixel]]
@out length: uint; [[Accessible buffer size in bytes]]
@in mode: Ector.Buffer.Access_Flag;
@in x: uint;
@in y: uint;
@in w: uint; [[If 0, defaults to the buffer width]]
@in h: uint; [[If 0, defaults to the buffer height]]
@in cspace: Efl.Gfx.Colorspace; [[Requested colorspace. If difference from the internal cspace, map may either fail or convert slowly]]
@out stride: uint; [[Optional]]
}
return: uint8* @warn_unused; [[Top-left pixel is at offset bytes after this address. Returns $null in case of failure]]
}
unmap {
[[Unmap a region of this buffer, and upload data to the GPU (if needed).]]
params {
@in data: void*; [[Data pointer returned by a previous call to map]]
@in offset: int;
@in length: uint;
}
}
pixels_set {
[[Set the source pixels for this buffer, or allocate a new memory region]]
params {
@in pixels: void*; [[If $null, allocates an empty buffer]]
@in width: int;
@in height: int;
@in stride: int; [[Can be 0]]
@in cspace: Efl.Gfx.Colorspace;
@in writable: bool;
@in l: ubyte; [[Left border pixels, usually 0 or 1]]
@in r: ubyte; [[Right border pixels, usually 0 or 1]]
@in t: ubyte; [[Top border pixels, usually 0 or 1]]
@in b: ubyte; [[Bottom border pixels, usually 0 or 1]]
}
return: bool;
}
span_get {
[[Get a single horizontal span of length w starting from (x,y)
Call span_free() to release it. This function will try not to
allocate any new buffer, whenever possible. This means the data
might be mapped directly from the backing memory buffer.
]]
params {
@in x: int; [[Ranges from -l to w+r-1]]
@in y: int; [[Ranges from -t to h+b-1]]
@in w: uint; [[Ranges from 1 to w+l+r]]
@in cspace: Efl.Gfx.Colorspace; [[Requested colorspace, may trigger conversion on the fly.]]
@out length: uint; [[Length in bytes of the returned buffer]]
}
return: uint8*; [[A temporary memory buffer containing the pixels requested.]]
}
span_free {
[[Must be called as soon as possible after span_get]]
params {
data: uint8*;
}
}
@property flags {
get { [[Get the capabilities of this buffer]] }
values {
flag: Ector.Buffer.Flag; [[A bitmask of capability flags]]
}
}
@property border {
[[Duplicated pixel borders of this buffer, used for GL scaling]]
get {}
values {
l: int;
r: int;
t: int;
b: int;
}
}
}
events {
detached; [[Emitted whenever the previously attached pixels are detached during pixels_set]]
}
implements {
@virtual .pixels_set;
@virtual .span_get;
@virtual .span_free;
@virtual .map;
@virtual .unmap;
}
}

Some files were not shown because too many files have changed in this diff Show More