]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/datasource.qh
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / datasource.qh
index 87c614ab737b31a34d5a2c447693b69679e6a3a7..5a8723004ee95a090fb2cf6350ae45e12850d22f 100644 (file)
@@ -1,34 +1,43 @@
 #pragma once
 
 CLASS(DataSource, Object)
-    STATIC_ATTRIB(DataSource, true, entity, NEW(Object));
-    STATIC_ATTRIB(DataSource, false, entity, NULL);
-    /**
-     * get entry `i` passing `name` and `icon` through `returns` if it is not null
-     * returns `DataSource_false` if out of bounds
-     * otherwise returns an entity or `DataSource_true`
-     */
-    METHOD(DataSource, getEntry, entity(entity this, int i, void(string name, string icon) returns)) { return DataSource_false; }
-    /** return the index of the first match for `find`. optional */
-    METHOD(DataSource, indexOf, int(entity this, string find)) { return -1; }
-    /** reload all entries matching `filter` returning how many matches were found */
-    METHOD(DataSource, reload, int(entity this, string filter)) { return 0; }
-    /** cleanup on shutdown. optional */
-    METHOD(DataSource, destroy, void(entity this)) { }
+       STATIC_ATTRIB(DataSource, true, entity, NEW(Object));
+       STATIC_ATTRIB(DataSource, false, entity, NULL);
+       /**
+        * get entry `i` passing `name` and `icon` through `returns` if it is not null
+        * returns `DataSource_false` if out of bounds
+        * otherwise returns an entity or `DataSource_true`
+        */
+       METHOD(DataSource, getEntry, entity(entity this, int i, void(string name, string icon) returns))
+       {
+               return DataSource_false;
+       }
+       /** return the index of the first match for `find`. optional */
+       METHOD(DataSource, indexOf, int(entity this, string find))
+       {
+               return -1;
+       }
+       /** reload all entries matching `filter` returning how many matches were found */
+       METHOD(DataSource, reload, int(entity this, string filter))
+       {
+               return 0;
+       }
+       /** cleanup on shutdown. optional */
+       METHOD(DataSource, destroy, void(entity this)) {}
 ENDCLASS(DataSource)
 
 
 CLASS(StringSource, DataSource)
-    ATTRIB(StringSource, StringSource_str, string);
-    ATTRIB(StringSource, StringSource_sep, string);
-    CONSTRUCTOR(StringSource, string str, string sep);
-    METHOD(StringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
-    METHOD(StringSource, reload, int(entity this, string filter));
+       ATTRIB(StringSource, StringSource_str, string);
+       ATTRIB(StringSource, StringSource_sep, string);
+       CONSTRUCTOR(StringSource, string str, string sep);
+       METHOD(StringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
+       METHOD(StringSource, reload, int(entity this, string filter));
 ENDCLASS(StringSource)
 
 CLASS(CvarStringSource, StringSource)
-    ATTRIB(CvarStringSource, CvarStringSource_cvar, string);
-    CONSTRUCTOR(CvarStringSource, string cv, string sep);
-    METHOD(CvarStringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
-    METHOD(CvarStringSource, reload, int(entity this, string filter));
+       ATTRIB(CvarStringSource, CvarStringSource_cvar, string);
+       CONSTRUCTOR(CvarStringSource, string cv, string sep);
+       METHOD(CvarStringSource, getEntry, entity(entity this, int i, void(string name, string icon) returns));
+       METHOD(CvarStringSource, reload, int(entity this, string filter));
 ENDCLASS(CvarStringSource)