+
+void DumpGadgetIdentifiers()
+{
+ struct GadgetInfo *gi;
+
+ printf("Gadgets on current screen (any prefix 'gfx.' can be omitted):\n");
+
+ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
+ if (gi->mapped && gi->image_id != -1)
+ printf("- '%s'\n", getTokenFromImageID(gi->image_id));
+
+ printf("Done.\n");
+}
+
+boolean DoGadgetAction(int image_id)
+{
+ struct GadgetInfo *gi;
+
+ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next)
+ {
+ if (gi->mapped && gi->image_id == image_id)
+ {
+ gi->callback_action(gi);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}