The notnull.cocci script from Coccinelle finds places where you check if a
variable is NULL, but it's known not to be NULL. The check can be safely
removed. For example, this code would be caught by notnull:
if (!var) return;
if (var && var->fld) { ... }
It's needless to check again if var is not NULL because if it's in fact NULL,
it would have returned on the previous "if". This commit removes all the
trivial places where this pattern happens. Another patch will be generated for
the more complex cases.
SVN revision: 50241
internal representation.
The objectiv is to simplify code, consume less CPU and memory
without loosing feature. Please report any breakage when you
see them. It will take a few weeks before we change the file
layout, during that time the load time may increase.
SVN revision: 49922
Edje Edit was writing the info in the struct before verify if the value
can be set. New the verify works and the old value is recover if verify
fails.
By: Fabiano Fidencio <fidencio@profusion.mobi>
SVN revision: 49745
Now we can set and retrieve, name and descripition of the api
property, from Parts and Programs.
By: Thiago Ribeiro Masaki <masaki@profusion.mobi>
SVN revision: 49678
You can now adress them with somethin like part[name]:subpart
or part[index]:subpart in all signal emit code and API that
require a part to be specified.
TODO: we need to add this index/name information when a signal
is emitted from a subpart.
SVN revision: 49614
WARNING: I don't know why in the first it doesn't map correctly to
an object. So if someone with more knowledge on this piece of code
could give it a look.
SVN revision: 49613
This fix the issue with elementary cursor end set function.
The cursor is now after the last textblock node, and not before it, as
it was until now.
SVN revision: 49242
Upon creating a timer, it's callback must return an int, otherwise it
would panic. The python bindings do the nicety of, if the callback
function returns nothing, automatically canceling the reschedule of
the timer.
This patch does the same for lua. It's a oneliner.
SVN revision: 49051
items. mulling over how an item href name will map to having an evas object
attached/supplied (once there, its' easy to just control the object like href
objects, selection and cursor objects are).
SVN revision: 48311
To use the Edje Edit API now you need to add the object to the canvas with edje_edit_object_add().
Normal edje functions will work as usual, but it's no longer possible to tamper with the standard objects internals.
Also, big reformat of Edje_Edit.h while fixing docs. Yes, monster commit.
SVN revision: 48220
Others types, like TEXT/TEXTBLOCK/SWALLOW/GROUP (others?), are similar to Externals. And may can recalc some properties only in description_apply, not on every call to part_recalc.
Some generic boolean properties, like "visible", can be moved to description_appy too.
SVN revision: 48144
Remaining:
edje_lua.c:328: ‘_edje_lua_reg_count’ defined but not used
edje_lua.c:409: ‘_edje_lua_rawgetfield’ defined but not used
edje_lua.c:445: ‘_edje_lua_free_metatable’ defined but not used
edje_lua.c:2182: ‘_edje_lua_object_set_pointer_mode’ defined but not used
edje_lua.c:2190: ‘_edje_lua_object_set_precise_is_inside’ defined but not used
SVN revision: 48142
Pretty much moving some things around and extending the smart class
to allow overloading some common functions. Edje_Edit will make use
of this.
SVN revision: 47841
All state functions now receive the value as a double, separate from
the state name.
Getting the list of states from the part still returns a list of strings
with everything together, but we'll change that soon too.
SVN revision: 47811
but it could be much much much cleaner/better so i started a minimalist redo.
it's temporarily enabled right now. will disable soon to do in the background.
SVN revision: 47782
Sometimes you want to catch an action like "clicked" from elm/button
or "mouse,clicked,1" from a regular part and want to set a property
like "play" on some object. In this case there is no source property
to copy, so setting the destination makes sense. This was possible
with Embryo, and now it is with regular "program".
Sample EDC:
{{{
// test.edc, compile with edje_cc and run with edje_player
externals {
external: "elm";
}
collections {
group { name: "main";
parts {
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "button"; type: EXTERNAL;
source: "elm/button";
description { state: "default" 0.0;
rel2.relative: 1.0 0.5;
}
}
part { name: "display"; type: TEXT;
description { state: "default" 0.0;
color: 0 128 0 255;
rel1.relative: 0.0 0.5;
rel2.relative: 0.5 1.0;
text { font: "Sans"; size: 16; }
}
}
part { name: "entry"; type: EXTERNAL;
source: "elm/scrolled_entry";
description { state: "default" 0.0;
rel1.relative: 0.5 0.5;
params.bool: "editable" 0;
}
}
programs {
program {
signal: "clicked";
source: "button";
action: PARAM_SET "display" "text" "hello world!";
}
program {
signal: "clicked";
source: "button";
action: PARAM_SET "entry" "text" "bla!";
}
}
}
}
}
}}}
SVN revision: 47635
Choices are useful to represent enumerations and restricted set of
elements to user. Usually this is displayed in hoversel/comboboxes.
SVN revision: 47570
Edje got a new program action called PARAM_COPY in the form:
action: PARAM_COPY "src_part" "src_param" "dst_part" "dst_param";
This will copy the parameter "src_param" from part "src_part" to
parameter "dst_param" of part "dst_part".
So far so good, why the "crazy" in the first line? Because this also:
* do type conversion!
* set properties of native parts, not just EXTERNAL!
The type conversion allows one to get an integer and display that in a
text property, or get an string and convert into a float.
The set of native parts is quite simple, basically a map of Edje.h
edje_object_part_*_set(). With that one can set the string to be used
by a TEXT, or set drag page/step/size/value! (page/step increments are
not supported at the moment, if it is worth, they may be supported in
future).
Sample EDC:
{{{
// test.edc, compile with edje_cc and run with edje_player
externals {
external: "elm";
}
collections {
group { name: "main";
parts {
part { name: "bg"; type: RECT;
description { state: "default" 0.0;
color: 255 255 255 255;
}
}
part { name: "entry"; type: EXTERNAL;
source: "elm/scrolled_entry";
description { state: "default" 0.0;
rel2.relative: 1.0 0.5;
}
}
part { name: "display"; type: TEXT;
description { state: "default" 0.0;
color: 0 128 0 255;
rel1.relative: 0.0 0.5;
text { font: "Sans"; size: 16; }
}
}
programs {
program {
signal: "changed";
source: "entry";
action: PARAM_COPY "entry" "text" "display" "text";
}
}
}
}
}
}}}
SVN revision: 47500
I'm now introducing a couple of goodies to make externals more useful,
they are:
* add: extra parameter with the part name. This may be used by
external objects to emit signals in the name of that part.
* param_set/param_get: set parameters at runtime, given their names
and types. This avoids requiring users to get the actual object and
call methods. This abstraction is also good because it let one uses
Elementary without even linking to it ;-) (this have limits, like
complex types are not supported). Right now this is just exposed
to C, but goal is to have it exposed in Embryo and Lua as well.
* translate: new method to translate previously strings that are
specified statically, such as the parameters names.
Four new functions got added to the Edje API:
* edje_object_part_external_object_get() so we don't have to abuse
edje_object_part_swallow_get()
* edje_object_part_external_param_set() and
edje_object_part_external_param_get() that call the external type's
functions.
* edje_external_param_type_str() to convert types to string and
provide nicer debugs :-)
TODO:
* expose external_param_set()/external_param_get() to Embryo and Lua.
SVN revision: 47456