Changeset 86


Ignore:
Timestamp:
Jun 1, 2009, 11:03:17 PM (5 years ago)
Author:
simon
Message:

start of the ruleset class implementation

Location:
branches/client-library-split
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/client-library-split/memphis-renderer.c

    r85 r86  
    1818 */ 
    1919 
    20 #include "memphis.h" 
     20#include "memphis-renderer.h" 
    2121#include "mlib.h" 
    2222 
  • branches/client-library-split/memphis-renderer.h

    r82 r86  
    2424#include <glib-object.h> 
    2525#include <cairo.h> 
     26#include "memphis.h" 
    2627 
    2728/* 
  • branches/client-library-split/memphis-rule-set.c

    r82 r86  
    5252 
    5353static void 
     54memphis_rule_set_dispose (GObject *object) 
     55{ 
     56  MemphisRuleSet *self = MEMPHIS_RULESET (object); 
     57 
     58  rulesetFree(self->ruleset); 
     59  G_OBJECT_CLASS (memphis_rule_set_parent_class)->dispose (object); 
     60} 
     61 
     62static void 
    5463memphis_rule_set_class_init (MemphisRuleSetClass *klass) 
    5564{ 
     
    6069  object_class->get_property = memphis_rule_set_get_property; 
    6170  object_class->set_property = memphis_rule_set_set_property; 
     71  object_class->dispose = memphis_rule_set_dispose; 
    6272} 
    6373 
     
    6575memphis_rule_set_init (MemphisRuleSet *self) 
    6676{ 
     77  self->ruleset = NULL; 
    6778} 
    6879 
    6980MemphisRuleSet* 
    70 memphis_rule_set_new (void) 
     81memphis_rule_set_new_from_file (gchar* filename) 
    7182{ 
     83  MemphisRuleSet* mruleset = g_object_new (MEMPHIS_TYPE_RULESET, NULL); 
     84  mruleset->ruleset = (cfgRules *) rulesetRead (filename); 
     85  return mruleset; 
     86} 
     87 
     88MemphisRuleSet* 
     89memphis_rule_set_new_from_data (gchar* data) 
     90{ 
     91  // TODO 
    7292  return g_object_new (MEMPHIS_TYPE_RULESET, NULL); 
    7393} 
    7494 
     95void 
     96memphis_rule_set_free (MemphisRuleSet* rules) 
     97{ 
     98  g_object_unref (G_OBJECT (rules)); 
     99} 
  • branches/client-library-split/memphis-rule-set.h

    r82 r86  
    2222 
    2323#include <glib-object.h> 
     24#include "ruleset.h" 
    2425 
    2526G_BEGIN_DECLS 
     
    4445typedef struct { 
    4546  GObject parent; 
     47  cfgRules *ruleset; 
    4648} MemphisRuleSet; 
    4749 
     
    5254GType memphis_rule_set_get_type (void); 
    5355 
    54 MemphisRuleSet* memphis_rule_set_new (void); 
     56MemphisRuleSet* memphis_rule_set_new_from_file (gchar* filename); 
     57MemphisRuleSet* memphis_rule_set_new_from_data (gchar* data); 
     58void memphis_rule_set_free (MemphisRuleSet* rules); 
    5559 
    5660G_END_DECLS 
Note: See TracChangeset for help on using the changeset viewer.