forked from enlightenment/efl
eldbus/eo: improve API
remove setters that do not make sense, they are set in the constructor functions and cannot be changed. define the Eldbus_Connection_Type in .eo, properly type functions using it.
This commit is contained in:
parent
d8ad2507bc
commit
7b590c126e
|
@ -39,7 +39,7 @@ _eldbus_model_connection_efl_object_constructor(Eo *obj, Eldbus_Model_Connection
|
|||
static void
|
||||
_eldbus_model_connection_constructor(Eo *obj EINA_UNUSED,
|
||||
Eldbus_Model_Connection_Data *pd,
|
||||
int type,
|
||||
Eldbus_Connection_Type type,
|
||||
const char* address,
|
||||
Eina_Bool private)
|
||||
{
|
||||
|
@ -212,37 +212,18 @@ _eldbus_model_connection_address_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connectio
|
|||
return pd->address;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_connection_address_set(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd, const char *value)
|
||||
{
|
||||
eina_stringshare_del(pd->address);
|
||||
pd->address = eina_stringshare_add(value);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_eldbus_model_connection_private_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd)
|
||||
{
|
||||
return pd->private;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_connection_private_set(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd, Eina_Bool value)
|
||||
{
|
||||
pd->private = value;
|
||||
}
|
||||
|
||||
static int
|
||||
static Eldbus_Connection_Type
|
||||
_eldbus_model_connection_type_get(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd)
|
||||
{
|
||||
return pd->type;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_connection_type_set(Eo *obj EINA_UNUSED, Eldbus_Model_Connection_Data *pd, int value)
|
||||
{
|
||||
pd->type = value;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_connection_connect(Eldbus_Model_Connection_Data *pd)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import eldbus_types;
|
||||
|
||||
class Eldbus.Model.Connection (Efl.Object, Efl.Model) {
|
||||
[[Eldbus model connection class]]
|
||||
|
||||
|
@ -7,25 +9,28 @@ class Eldbus.Model.Connection (Efl.Object, Efl.Model) {
|
|||
|
||||
@since 1.16]]
|
||||
params {
|
||||
@in type: int; [[The connection type]]
|
||||
@in type: Eldbus.Connection.Type; [[The connection type]]
|
||||
@in address: string; [[Remote address of DBus]]
|
||||
@in private_: bool; [[Non shared dbus connection]]
|
||||
}
|
||||
}
|
||||
@property type {
|
||||
[[Connection type]]
|
||||
get { }
|
||||
values {
|
||||
type: int; [[Connection type]]
|
||||
type: Eldbus.Connection.Type; [[Connection type]]
|
||||
}
|
||||
}
|
||||
@property address {
|
||||
[[Remote DBus address]]
|
||||
get { }
|
||||
values {
|
||||
address: string; [[Address]]
|
||||
}
|
||||
}
|
||||
@property private {
|
||||
[[Indicate if the DBus connection is shared or private]]
|
||||
get { }
|
||||
values {
|
||||
private_: bool; [[Private DBus connection]]
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ _eldbus_model_object_efl_object_constructor(Eo *obj, Eldbus_Model_Object_Data *p
|
|||
static void
|
||||
_eldbus_model_object_constructor(Eo *obj EINA_UNUSED,
|
||||
Eldbus_Model_Object_Data *pd,
|
||||
int type,
|
||||
Eldbus_Connection_Type type,
|
||||
const char* address,
|
||||
Eina_Bool private,
|
||||
const char* bus,
|
||||
|
@ -231,63 +231,30 @@ _eldbus_model_object_address_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *
|
|||
return pd->address;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_address_set(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd, const char *value)
|
||||
{
|
||||
eina_stringshare_del(pd->address);
|
||||
pd->address = eina_stringshare_add(value);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_eldbus_model_object_private_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
|
||||
{
|
||||
return pd->private;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_private_set(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd, Eina_Bool value)
|
||||
{
|
||||
pd->private = value;
|
||||
}
|
||||
|
||||
static int
|
||||
static Eldbus_Connection_Type
|
||||
_eldbus_model_object_type_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
|
||||
{
|
||||
return pd->type;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_type_set(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd, int value)
|
||||
{
|
||||
pd->type = value;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_eldbus_model_object_bus_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
|
||||
{
|
||||
return pd->bus;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_bus_set(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd, const char *value)
|
||||
{
|
||||
eina_stringshare_del(pd->bus);
|
||||
pd->bus = eina_stringshare_add(value);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_eldbus_model_object_path_get(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd)
|
||||
{
|
||||
return pd->path;
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_path_set(Eo *obj EINA_UNUSED, Eldbus_Model_Object_Data *pd, const char *value)
|
||||
{
|
||||
eina_stringshare_del(pd->path);
|
||||
pd->path = eina_stringshare_add(value);
|
||||
}
|
||||
|
||||
static void
|
||||
_eldbus_model_object_connect(Eldbus_Model_Object_Data *pd)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ class Eldbus.Model.Object (Efl.Object, Efl.Model) {
|
|||
|
||||
@since 1.16]]
|
||||
params {
|
||||
@in type: int; [[The connection type]]
|
||||
@in type: Eldbus.Connection.Type; [[The connection type]]
|
||||
@in address: string; [[Remote address of DBus]]
|
||||
@in private_: bool; [[Non shared DBus connection]]
|
||||
@in bus: string; [[DBus Name or unique-id]]
|
||||
|
@ -29,30 +29,35 @@ class Eldbus.Model.Object (Efl.Object, Efl.Model) {
|
|||
}
|
||||
@property type {
|
||||
[[Connection type]]
|
||||
get { }
|
||||
values {
|
||||
type: int; [[Connection type]]
|
||||
type: Eldbus.Connection.Type; [[Connection type]]
|
||||
}
|
||||
}
|
||||
@property address {
|
||||
[[Remote address of DBus]]
|
||||
get { }
|
||||
values {
|
||||
address: string; [[Address]]
|
||||
}
|
||||
}
|
||||
@property private {
|
||||
[[Indicate if the DBus connection is shared or private]]
|
||||
get { }
|
||||
values {
|
||||
private_: bool; [[Private DBus connection]]
|
||||
}
|
||||
}
|
||||
@property bus {
|
||||
[[DBus Name or unique-id]]
|
||||
get { }
|
||||
values {
|
||||
bus: string; [[DBus name]]
|
||||
}
|
||||
}
|
||||
@property path {
|
||||
[[DBus path]]
|
||||
get { }
|
||||
values {
|
||||
path: string; [[DBus path]]
|
||||
}
|
||||
|
|
|
@ -4,6 +4,16 @@ struct Eldbus.Proxy; [[Represents a client object bound to an interface]]
|
|||
struct Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]]
|
||||
struct Eldbus.Object; [[Represents an object path already attached with bus name or unique id]]
|
||||
|
||||
enum @extern Eldbus.Connection.Type
|
||||
{
|
||||
unknown = 0, [[sentinel, not a real type]]
|
||||
session, [[regular user session bus, used for applications and services running per user]]
|
||||
system, [[system-wide connection bus, used for system services]]
|
||||
starter, [[Uses whatever bus started our application, be session or system]]
|
||||
address, [[A private bus at a specific address]]
|
||||
last, [[sentinel, not a real type]]
|
||||
}
|
||||
|
||||
enum Eldbus.Introspection.Argument_Direction
|
||||
{
|
||||
[[Argument direction]]
|
||||
|
|
Loading…
Reference in New Issue