12 char *notificationA
= "notificationA";
13 char *notificationB
= "notificationB";
14 char *notificationC
= "notificationC";
17 observer1(void *data
, WMNotification
*notification
)
19 printf("ObserverAction 1 got %s with object=%s, clientdata=%s\n",
20 WMGetNotificationName(notification
),
21 (char*)WMGetNotificationObject(notification
),
22 (char*)WMGetNotificationClientData(notification
));
26 observer3(void *data
, WMNotification
*notification
)
28 printf("ObserverAction 3 got %s with object=%s, clientdata=%s\n",
29 WMGetNotificationName(notification
),
30 (char*)WMGetNotificationObject(notification
),
31 (char*)WMGetNotificationClientData(notification
));
35 observer2(void *data
, WMNotification
*notification
)
37 printf("ObserverAction 2 got %s with object=%s, clientdata=%s\n",
38 WMGetNotificationName(notification
),
39 (char*)WMGetNotificationObject(notification
),
40 (char*)WMGetNotificationClientData(notification
));
48 main(int argc
, char **argv
)
51 char *obser1
= "obser1";
52 char *obser2
= "obser2";
53 char *obser3
= "obser3";
57 char *cdata1
= "client data1";
58 char *cdata2
= "client data2";
59 char *cdata3
= "client data3";
61 WMInitializeApplication("test", &argc
, argv
);
63 WMAddNotificationObserver(observer1
, obser1
, notificationA
, obj1
);
65 WMAddNotificationObserver(observer1
, obser1
, notificationA
, obj2
);
67 WMAddNotificationObserver(observer1
, obser1
, notificationA
, obj3
);
70 WMPostNotificationName(notificationA
, obj3
, cdata1
);
72 WMPostNotificationName(notificationA
, obj2
, cdata2
);
74 WMPostNotificationName(notificationA
, obj1
, cdata3
);
77 WMRemoveNotificationObserverWithName(obser1
, notificationA
, obj2
);
80 WMRemoveNotificationObserverWithName(obser1
, notificationA
, obj2
);
83 WMPostNotificationName(notificationA
, obj3
, cdata1
);
85 WMPostNotificationName(notificationA
, obj2
, cdata2
);
87 WMPostNotificationName(notificationA
, obj1
, cdata3
);